PINE64
gpsd issues - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Software (https://forum.pine64.org/forumdisplay.php?fid=121)
+---- Forum: Mobian on PinePhone (https://forum.pine64.org/forumdisplay.php?fid=139)
+---- Thread: gpsd issues (/showthread.php?tid=15962)



gpsd issues - io. - 02-03-2022

Hi everyone,

I am trying for a while now to get gps running. I went through the wiki page (https://wiki.mobian-project.org/doku.php?id=location), multiple times (also with at least one clean install of mobian) but run into some issues - I cannot find this mentioned anywhere.

What I did: I follow the steps and did manage to get some meaningful output from

Code:
mmcli -m 0 --location-enable-gps-nmea

(with the right modem number)

But the moment I move on to setup gpsd, I get no signal at all. I started gpsd, then run

Code:
gpspipe --nmea

The first time, the inital output looks normal, it recognizes ttyUSB1 and waits for a signal. A signal never comes, even leaving it for 8 hours at a window. No output at all. When I checked dmesg, I find this:


Code:
[17010.473495] usb 2-1: USB disconnect, device number 2
[17010.482390] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[17010.491396] option 2-1:1.0: device disconnected
[17010.507679] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[17010.516152] option 2-1:1.1: device disconnected
[17010.525462] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
[17010.533818] option 2-1:1.2: device disconnected
[17010.547007] option1 ttyUSB3: GSM modem (1-port) converter now disconnected from ttyUSB3
[17010.555419] option 2-1:1.3: device disconnected
[17010.581592] qmi_wwan 2-1:1.4 wwan0: unregister 'qmi_wwan' usb-1c1b000.usb-1, WWAN/QMI devic
[17010.913371] usb 2-1: new high-speed USB device number 3 using ehci-platform
[17011.089623] usb 2-1: New USB device found, idVendor=2c7c, idProduct=0125, bcdDevice= 3.18
[17011.097896] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[17011.105096] usb 2-1: Product: EG25-G
[17011.108780] usb 2-1: Manufacturer: Quectel
[17011.121451] option 2-1:1.0: GSM modem (1-port) converter detected
[17011.132864] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0
[17011.144117] option 2-1:1.1: GSM modem (1-port) converter detected
[17011.154905] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB2
[17011.170701] option 2-1:1.2: GSM modem (1-port) converter detected
[17011.182066] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB3
[17011.194272] option 2-1:1.3: GSM modem (1-port) converter detected
[17011.206092] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB4

So the modem disconnects and reconnects, but it loses ttyUSB1 and I assume moves it to ttyUSB2. /dev/ttyUSB1 does not exist anymore and gpsd is listening to nothing, as /etc/default/gpsd is sets devices to ttyUSB1. At least that's what I think the problem is.

I did not find anything on the forum or wiki about this so far, anyone has an idea?

Thanks!


RE: gpsd issues - wibble - 02-04-2022

The modem presents multiple USB ports with different uses. IIRC ttyUSB1 is NMEA output only, while ttyUSB2 is used for the AT commands that control it. Some modem failure modes cause one or more of the USB ports to disappear until the modem is restarted. You don't mention whether you're checking the NMEA output to see if it's getting a fix before you start gpsd. I don't know if the AGPS is now handled automatically or whether you'll need to do that manually, but without it you need a clear sky view, patience and luck to get a fix at all. Some people have trouble getting a fix even with the AGPS working. I don't remember what I did to get gpsd working while ModemManager was running - I'll see if I can find anything in my notes.


RE: gpsd issues - jhasler - 05-05-2022

I'm having a similar problem. "sudo watch -n 5 mmcli -m any --location-get" produces a valid report with correct location data
but Foxtrotgps says "No GPS found" and cgps prints a screen full of "n/a".


RE: gpsd issues - wibble - 05-06-2022

How are you enabling the gps, and how are you configuring and starting gpsd?


RE: gpsd issues - jhasler - 05-06-2022

>How are you enabling the gps,

How should I enable it?

>how are you configuring and starting gpsd?

ps and systemctl tell me it's running. I've made no configuration changes other than experimenting with replacing the line

DEVICES=""

in /etc/default/gpsd with

DEVICES="/dev/ttyUSB1"

and restarting gpsd via systemctl. Made no difference and I changed it back.


RE: gpsd issues - wibble - 05-07-2022

From memory you need to use mmcli's --location-enable-gps-unmanaged option when enabling the GPS, and make sure other gps access methods aren't enabled, otherwise ModemManager will connect to the USB port and prevent gpsd using it. Check the mmcli man page for details. It should be possible to automate this using the /etc/gpsd/device-hook scripting, so that unmanaged location is started when a gpsd client connects, and stopped when the last client disconnects, but I never got around to trying it. I think PmOS was using that hook to load AGPS data at start too. I can't test at the moment as I don't have a SIM in, and ModemManager still won't let you access the location without it even though the modem itself is capable of doing it.