Gnss-share.service questions

I get these results for the status of the gnss-share.service:

systemctl status gnss-share.service 
● gnss-share.service - Manage access to and AGPS on GNSS devices
     Loaded: loaded (/lib/systemd/system/gnss-share.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2024-04-23 00:39:30 CEST; 4min 4s ago
       Docs: https://gitlab.com/postmarketOS/gnss-share
   Main PID: 2553 (gnss-share)
      Tasks: 10 (limit: 3015)
     Memory: 4.9M
        CPU: 201ms
     CGroup: /system.slice/gnss-share.service
             └─2553 /usr/bin/gnss-share

Apr 23 00:39:30 morgana systemd[1]: Started Manage access to and AGPS on GNSS devices.
Apr 23 00:39:30 morgana gnss-share[2553]: Starting GNSS server, accepting connections at:  /var/run/gnss-share.sock
Apr 23 00:39:39 morgana gnss-share[2553]: server: unable to subscribe to topic:  stm unable to open device: stm device is not ready
Apr 23 00:43:25 morgana gnss-share[2553]: stm received a request to start but it seems to already be started...
Apr 23 00:43:25 morgana gnss-share[2553]: Client connected
Apr 23 00:43:25 morgana gnss-share[2553]: Checking date/time on module...
Apr 23 00:43:30 morgana gnss-share[2553]: error: stm unable to set time: stm/setTime: timed out waiting for device

I tried to use this command via ssh:

$ sudo socat unix:///var/run/gnss-share.sock -

but it did not print any info on the console.

Is this normal? If not, what could be going on?

1 Like

I tested the above now on another Librem 5. There I do see the sentences from the GPS module being printed in the terminal when running:

sudo socat unix:///var/run/gnss-share.sock -

The phone where it does not work was flashed yesterday to byzantium stable. I did try to use the assisted GPS scripts from here: Assisted GNSS ($1207) · Snippets · GitLab

Could that be the reason for not getting any GPS strings from gnss-share?

1 Like

Two things to check:

1 Like

All kill switches are up, so everything is unlocked.
I booted and did the sudo socat unix:///var/run/gnss-share.sock - as the first thing.
There are still no GPS strings. Could it be that the GPS module is somehow switched off? Or wrongly configured? Is there any firmware involved?

1 Like

Maybe go lower level. Does /dev/gnss0 exist? If so, does sudo cat /dev/gnss0 produce any output?

1 Like
$ ls -sla  /dev/gnss0
0 crw-rw---- 1 root dialout 240, 0 Apr 23 12:49 /dev/gnss0

And:

$ sudo cat /dev/gnss0

does not print anything on the terminal, it just “hangs” until I press Ctrl+C

1 Like

Do sudo systemctl disable gnss-share.service, unplug USB, turn the phone off, wait half a minute, turn it back on and retry sudo cat /dev/gnss0 before doing anything else.

2 Likes

Wow. I followed your instructions (actually waited several minutes before turning the phone on again) and I see the GPS sentences now. Would you mind explaining what could have caused this behavior?

2 Likes

dos’ instructions verify that the HW is working.

Now you need to re-enable gnss-share and figure out where your software stack is broken

3 Likes

I started gnss-share as a test now manually with:

sudo gnss-share -d

And then I checked again:

sudo socat unix:///var/run/gnss-share.sock -

And this command now also prints GPS sequences.

1 Like

It really needs to be investigated by someone who actually knows stuff but my speculation would be a timing / dependency problem. By disabling the service and starting the underlying program manually, you are changing the timing of events at system boot.

Anyway, you got good news: The GNSS module is fine. It just needs work on the software.

2 Likes

After that the gnss-share service started working, I put the Librem 5 outside, and it had quite quickly a GPS fix. Note that I did ran the agps.py script from Assisted GNSS ($1207) · Snippets · GitLab roughly a day earlier. Thanks for all support and information!

1 Like