Is the gpsmon daemon active?

Hi everyone! On my APU2 board running with OpenWrt, I connected a simple GNSS module to an application in order to use GPS data.
This application connects directly to the gpsd daemon in order to get data.
Issuing gpsmon I am able to see the correct positioning data but the application doesn't receive it.
Is is possible that the daemon is not active? How do you think I can solve this issue?

Thank you very much for your help and for your time!

What application?

How is this "application" taking to gpsd ?

Checked if it is active?

I did not wrote the application but I talked to the author. He said that this application gets the data directly from the daeomn of the gpsd.
Do you know if there is a command to check if the daemon is active?

You're/He's not answering the question.

service gpsd status
ps -ef

?

With service gpsd status it says

active with no instances

with ps -ef it says

ps: unrecognized option: e

BusyBox v1.33.2 (2023-03-30 12:18:04 UTC) multi-call binary.

 

Usage: ps

 

Show list of processes

 

           w        Wide output

Skip -ef, it's for standard Linux, not BusyBox.

Ok, with ps it shows:

PID USER       VSZ STAT COMMAND

    1 root      1220 S    /sbin/procd

    2 root         0 SW   [kthreadd]

    3 root         0 IW<  [rcu_gp]

    4 root         0 IW<  [rcu_par_gp]

    6 root         0 IW<  [kworker/0:0H-kb]

    8 root         0 IW<  [mm_percpu_wq]

    9 root         0 SW   [ksoftirqd/0]

   10 root         0 IW   [rcu_sched]

   11 root         0 SW   [migration/0]

   12 root         0 SW   [cpuhp/0]

   13 root         0 SW   [cpuhp/1]

   14 root         0 SW   [migration/1]

   15 root         0 SW   [ksoftirqd/1]

   17 root         0 IW<  [kworker/1:0H-kb]

   18 root         0 SW   [cpuhp/2]

   19 root         0 SW   [migration/2]

   20 root         0 SW   [ksoftirqd/2]

   22 root         0 IW<  [kworker/2:0H-kb]

   23 root         0 SW   [cpuhp/3]

   24 root         0 SW   [migration/3]

   25 root         0 SW   [ksoftirqd/3]

   27 root         0 IW<  [kworker/3:0H-ev]

   28 root         0 IW<  [netns]

   31 root         0 IW   [kworker/2:1-eve]

   41 root         0 IW   [kworker/3:1-eve]

   50 root         0 IW   [kworker/0:1-eve]

   69 root         0 IW   [kworker/1:1-eve]

  305 root         0 SW   [oom_reaper]

  312 root         0 IW<  [writeback]

  341 root         0 SW   [kcompactd0]

  365 root         0 IW<  [pencrypt_serial]

  367 root         0 IW<  [pdecrypt_serial]

  369 root         0 IW<  [cryptd]

  374 root         0 IW<  [kintegrityd]

  376 root         0 IW<  [kblockd]

  377 root         0 IW<  [blkcg_punt_bio]

  494 root         0 IW<  [ata_sff]

  512 root         0 IW<  [kworker/u9:0]

  516 root         0 SW   [watchdogd]

  638 root         0 SW   [kswapd0]

  758 root         0 IW<  [kthrotld]

  796 root         0 IW<  [acpi_thermal_pm]

  868 root         0 IW<  [nvme-wq]

  870 root         0 IW<  [nvme-reset-wq]

  872 root         0 IW<  [nvme-delete-wq]

  883 root         0 SW   [scsi_eh_0]

  884 root         0 IW<  [scsi_tmf_0]

  888 root         0 SW   [scsi_eh_1]

  889 root         0 IW<  [scsi_tmf_1]

  951 root         0 IW<  [sdhci]

  952 root         0 SW   [irq/16-mmc0]

  956 root         0 IW   [kworker/0:2-eve]

  963 root         0 IW   [kworker/3:2-eve]

  971 root         0 IW<  [ipv6_addrconf]

  978 root         0 IW   [kworker/2:2-eve]

1006 root         0 IW<  [ext4-rsv-conver]

1142 root         0 IW<  [kworker/2:1H-kb]

1167 root         0 IW<  [ext4-rsv-conver]

1168 root         0 IW<  [kworker/0:1H-kb]

1467 ubus       916 S    /sbin/ubusd

1482 root       712 S    /sbin/askfirst /usr/libexec/login.sh

1483 root       712 S    /sbin/askfirst /usr/libexec/login.sh

1532 root       772 S    /sbin/urngd

1609 root         0 IW   [kworker/1:2-eve]

1748 root         0 IW<  [kworker/1:1H-kb]

1832 root         0 IW<  [ixgbe]

2119 root         0 IW<  [cfg80211]

2662 logd       956 S    /sbin/logd -S 64

2732 root      1348 S    /sbin/rpcd -s /var/run/ubus/ubus.sock -t 30

3058 root       900 S    /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p

3198 root      1744 S    /usr/sbin/hostapd -s -g /var/run/hostapd/global

3200 root      1688 S    /usr/sbin/wpa_supplicant -n -s -g /var/run/wpa_suppl

3295 root      1336 S    /sbin/netifd

3432 root      1068 S    /usr/sbin/odhcpd

4381 root         0 IW<  [kworker/3:1H-kb]

4463 root      1072 S    /usr/sbin/uhttpd -f -h /www -r OpenWrt -x /cgi-bin -

4522 root      1324 S    /usr/bin/dbus-daemon --system

4674 root         0 IW   [kworker/u8:0-ph]

5138 root         0 IW   [kworker/u8:1-ev]

5435 root       728 S    autossh -M 11118 -N    -E /root/SSHerrors -o ServerA

5436 root      4520 R    /usr/bin/ssh -L 11118:127.0.0.1:11118 -R 11118:127.0

5456 root      1084 S    sleep 300s

5459 root         0 IW   [kworker/u8:2-ev]

5494 root       924 R    /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p

5502 root      1096 S    -ash

5506 root      4660 S    /usr/sbin/usbmuxd --systemd

5518 root      1084 S    sleep 30

5519 root      1084 R    ps

6107 dnsmasq   1124 S    /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c

6336 root      1300 S    sh /usr/bin/uqmi_d.sh

6451 root      1192 S    /bin/sh /root/SSHpersistent

6513 homebrid  238m S    {node} homebridge

6642 root      739m S    /usr/bin/dockerd --config-file=/tmp/dockerd/daemon.j

6721 root      736m S    containerd --config /var/run/docker/containerd/conta


I am sorry for not being able to give more specific details about the connection with the daemon. I tried to ask again but the answer was exactly the same as before.

Post ubus call system board too.

The output for ubus call system board is:

{
	"kernel": "5.4.154",
	"hostname": "OpenWrt",
	"system": "AMD GX-412TC SOC",
	"model": "PC Engines APU2",
	"board_name": "pc-engines-apu2",
	"release": {
		"distribution": "OpenWrt",
		"version": "21.02.1",
		"revision": "r16325-88151b8303",
		"target": "x86/64",
		"description": "OpenWrt 21.02.1 r16325-88151b8303"
	}
}

You should really start by upgrading, 21.02 is EOL.

I know, I will update everything once the project is functioning. Right now I am focusing on the communication of correct data between the GNSS module and the board.
Do you know a command to activate the daemon? Do you have any idea of what the problem could be?
Thank you very much for your help and for your time

Well, the gpsd doesn't seem to run.

Try service gpsd start, then do ps, see if there's a gpsd process, if not, check dmesg.

1 Like

First install and use the serial terminal package picocom to open the GPS device directly e.g.
picocom -b4800 /dev/ttyUSB0
You should see raw GPS data. Note that USB GPSs will require the appropriate kmod-usb-serial to drive the serial port.

Once you know that the GPS stream is working on a serial port, edit /etc/config/gpsd and change enabled to 1 and also configure the serial port device that the GPS is connected to. If you will be accessing gpsd from another machine, set listen_globally to 1. The firewall may also need adjustment if the other machine is not on the OpenWrt router's LAN. Restart gpsd after changing the configuration.

Install gpsd-clients and run cgps. If the gpsd daemon is running and receiving from the GPS hardware you will see GPS data. Any Linux desktop OS also has cgps so you can test remote access.

Using service gpsd start and ps the output is

  PID USER       VSZ STAT COMMAND
    1 root      1220 S    /sbin/procd
    2 root         0 SW   [kthreadd]
    3 root         0 IW<  [rcu_gp]
    4 root         0 IW<  [rcu_par_gp]
    6 root         0 IW<  [kworker/0:0H-kb]
    8 root         0 IW<  [mm_percpu_wq]
    9 root         0 SW   [ksoftirqd/0]
   10 root         0 IW   [rcu_sched]
   11 root         0 SW   [migration/0]
   12 root         0 SW   [cpuhp/0]
   13 root         0 SW   [cpuhp/1]
   14 root         0 SW   [migration/1]
   15 root         0 SW   [ksoftirqd/1]
   17 root         0 IW<  [kworker/1:0H-kb]
   18 root         0 SW   [cpuhp/2]
   19 root         0 SW   [migration/2]
   20 root         0 SW   [ksoftirqd/2]
   22 root         0 IW<  [kworker/2:0H-kb]
   23 root         0 SW   [cpuhp/3]
   24 root         0 SW   [migration/3]
   25 root         0 SW   [ksoftirqd/3]
   27 root         0 IW<  [kworker/3:0H-ev]
   28 root         0 IW<  [netns]
   31 root         0 IW   [kworker/2:1-eve]
   41 root         0 IW   [kworker/3:1-eve]
   50 root         0 IW   [kworker/0:1-eve]
   69 root         0 IW   [kworker/1:1-eve]
  305 root         0 SW   [oom_reaper]
  312 root         0 IW<  [writeback]
  341 root         0 SW   [kcompactd0]
  365 root         0 IW<  [pencrypt_serial]
  367 root         0 IW<  [pdecrypt_serial]
  369 root         0 IW<  [cryptd]
  374 root         0 IW<  [kintegrityd]
  376 root         0 IW<  [kblockd]
  377 root         0 IW<  [blkcg_punt_bio]
  494 root         0 IW<  [ata_sff]
  512 root         0 IW<  [kworker/u9:0]
  516 root         0 SW   [watchdogd]
  638 root         0 SW   [kswapd0]
  758 root         0 IW<  [kthrotld]
  796 root         0 IW<  [acpi_thermal_pm]
  868 root         0 IW<  [nvme-wq]
  870 root         0 IW<  [nvme-reset-wq]
  872 root         0 IW<  [nvme-delete-wq]
  883 root         0 SW   [scsi_eh_0]
  884 root         0 IW<  [scsi_tmf_0]
  888 root         0 SW   [scsi_eh_1]
  889 root         0 IW<  [scsi_tmf_1]
  951 root         0 IW<  [sdhci]
  952 root         0 SW   [irq/16-mmc0]
  956 root         0 IW   [kworker/0:2-eve]
  963 root         0 IW   [kworker/3:2-eve]
  971 root         0 IW<  [ipv6_addrconf]
  978 root         0 IW   [kworker/2:2-eve]
 1006 root         0 IW<  [ext4-rsv-conver]
 1142 root         0 IW<  [kworker/2:1H-kb]
 1167 root         0 IW<  [ext4-rsv-conver]
 1168 root         0 IW<  [kworker/0:1H-kb]
 1467 ubus       916 S    /sbin/ubusd
 1482 root       712 S    /sbin/askfirst /usr/libexec/login.sh
 1483 root       712 S    /sbin/askfirst /usr/libexec/login.sh
 1532 root       772 S    /sbin/urngd
 1609 root         0 IW   [kworker/1:2-eve]
 1748 root         0 IW<  [kworker/1:1H-kb]
 1832 root         0 IW<  [ixgbe]
 2119 root         0 IW<  [cfg80211]
 2662 logd       956 S    /sbin/logd -S 64
 2732 root      1348 S    /sbin/rpcd -s /var/run/ubus/ubus.sock -t 30
 3058 root       900 S    /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p
 3198 root      1744 S    /usr/sbin/hostapd -s -g /var/run/hostapd/global
 3200 root      1688 S    /usr/sbin/wpa_supplicant -n -s -g /var/run/wpa_suppl
 3295 root      1336 S    /sbin/netifd
 3432 root      1068 S    /usr/sbin/odhcpd
 4381 root         0 IW<  [kworker/3:1H-kb]
 4463 root      1072 S    /usr/sbin/uhttpd -f -h /www -r OpenWrt -x /cgi-bin -
 4522 root      1324 S    /usr/bin/dbus-daemon --system
 5506 root      4660 S    /usr/sbin/usbmuxd --systemd
 6107 dnsmasq   1124 S    /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c
 6336 root      1300 S    sh /usr/bin/uqmi_d.sh
 6451 root      1192 S    /bin/sh /root/SSHpersistent
 6513 homebrid  238m S    {node} homebridge
 6642 root      739m S    /usr/bin/dockerd --config-file=/tmp/dockerd/daemon.j
 6721 root      736m S    containerd --config /var/run/docker/containerd/conta
 7896 root         0 IW   [kworker/u8:1-ev]
 8514 root         0 IW   [kworker/u8:2-ev]
 9351 root         0 IW   [kworker/u8:0]
 9376 root       728 S    autossh -M 11118 -N    -E /root/SSHerrors -o ServerA
 9377 root      4520 R    /usr/bin/ssh -L 11118:127.0.0.1:11118 -R 11118:127.0
 9382 root      1084 S    sleep 300s
 9400 root       924 R    /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p
 9401 root      1096 S    -ash
 9424 root      1084 S    sleep 30
 9473 root      1084 R    ps


The dmesg do not show any gpsd process active.

I couldn't find any gpsd process running in both of the output. Do you have any idea how could I activate it?

gpsd is disabled by default, see my post above.

1 Like

Thank you very much, for your help! I tried following your guide but I couldn't manage to use the positioning data.
Now there is the line

 3568 nobody    2060 S<   /usr/sbin/gpsd -N -n -G -S 2947 /dev/ttyACM0

when issued ps on the teminal.
Do you have any other suggestions?

It's now up and running, so what does gpsmon give you?

Issuing gpsmon this is what appears on the terminal

It's working then. On the lhs, you can see sats 0, 1, 2, 3, 7, 8, 9, 12, 13 & 14 are all being used. If you do

gpsmon -n

you'll see the nmea sentences. And try and use a bigger terminal then you'll see more info. And let it run for a few minutes.