Score:1

How can gpsd correctly detect a usb GPS device when inserted after system boots?

gn flag

I'm using gpsd 3.22 on Ubuntu 22.10

I have a GlobalSat BU-353-S4 USB GPS Receiver device that identifies as Bus 001 Device 008: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port / Mobile Action MA-8910P

It is enumerated as /dev/ttyUSB0 The system is correctly detecting the plug and unplug - I can plug the device in and ls /dev/tty*shows ttyUSB0,. When I unplug it, ttyUSB0 disappears.

If the system is booted with the GPS device plugged in while the system is powered off, it works properly. cgps obtains a lock in a minute or two.

However if the GPS device is unplugged and replugged while the system is running, or the system is rebooted while the GPS device remains plugged in and powered, a lock is never obtained. cgps shows nmea sentences displayed at the bottom, and it shows 10 or more satellites. Of those satellites, maybe one is listed with a "Y" in the "use" column. All the rest have 0 SNR and are unused. I've waited 20 minutes and it never gets a lock.

After unplugging the GPS and restarting the computer, I can get a GPS lock almost immediately.

On the gpsd man page, there are mentions of "hotplug scripts", but no examples or details on what they need to do or how they are used. Do they already exist, or do I need to write them? Maybe that is what is needed to get gpsd to function again without a cold start?

Could anyone point me in the right direction? I have the one GPS receiver that I would like to work with gpsd upon insertion at any time.

Terrance avatar
id flag
See https://help.ubuntu.com/community/UsbDriveDoSomethingHowto how you can use UDEV and trigger scripts when devices are inserted.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.