Problems getting GPSD to work

I have a GPS plugged in to the Pi running GPSD, and I have installed the GPSD package, pluls the GPSD clients and utils. The service is running, at least status says so. And I have the config file set up like this:

root@OpenWrt:/etc/config# uci show gpsd
gpsd.core=gpsd
gpsd.core.enabled='true'
gpsd.core.device='/dev/ttyUSB0'
gpsd.core.port='2947'
gpsd.core.listen_globally='true'
root@OpenWrt:/etc/config# reboot

I tried with 1 first, but that didn't But when trying to connect with cgps from a Pi inside the there's nothing there. And with cgps locallly I get:

cgps: no gpsd running or network error: -6, can't connect to host/port pair

Can somebody please give me a hint as to why this is happening? I would like to have the GPS on OpenWRT beause that's the one thing in the system that almost never is rebooted, so it will almost never loose the fix.

Once the serial port is available (even the wrong one), gpsd will start listening on port 2947/tcp.
I was able to reproduce the same error if the configuration specified a non-existent port.
With the correct port it just works, tested with LTE modem as a source of GPS data.

@AndrewZ Thank you for answering!How do I find out where it's connected? I tried the ls /dev/tty* from Debian/Raspberry Pi OS, but that's not the right way for sure.

What kind of GPS device do you have and how it is physically connected to the router?

It's an GlobalSat BU-353N5 USB, and it's connected to the Pi 3b+ with USB, I thought I said that I was running OpenWRT on a Pi, not a router in the first message, but I see it's ambigous, sorry.

Please show the output of cat /sys/kernel/debug/usb/devices

Does /dev/ttyUSB0 exist? If not, you'll need to identify the chip on your GPS and install the USB-serial device driver for it. OpenWRT does not include USB-serial drivers in the release ROM.

@AndrewZ This is the output:

T:  Bus=01 Lev=03 Prnt=10 Port=03 Cnt=01 Dev#= 11 Spd=12   MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=067b ProdID=23a3 Rev= 1.05
S:  Manufacturer=Prolific Technology Inc. 
S:  Product=USB-Serial Controller 
S:  SerialNumber=ARA>b109X16
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=pl2303
E:  Ad=81(I) Atr=03(Int.) MxPS=  10 Ivl=1ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=83(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms

@mk24 Oh, I didn't know that! This is a Prolific 2303, so I have installed the package kmod-usb-serial-pl2303. And now I don't get the error, but I still do not get a fix. I tried the same GPS device in a Pi, and that got a 3D-fix.

Once you have a driver loaded check that you have a serial port available, like /dev/ttyUSB0 or /dev/ttyACM0.
Temporary disable GPSD and connect to the serial port via a terminal like picocom:
picocom /dev/ttyUSB0
and see if you have anything coming from the device. I'm not familiar with that one, but some devices need an activation or start command to be sent first.

Edit: Google tells me that "-b" should be added to gpsd command line.

It's alive! :rofl: Thank you, I got output when I run it from the command line /etc/init.d/gpsd start (the -b was not necessary). Then I tried again cgps, and suddenlly it was working! Even after a couple of reboots of OpenWRT. So it seems like the fix was the driver.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.