Ultimate USB GPS PPS Driver
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- ndillman
- Posts: 5
- Joined: Thu Dec 05, 2019 9:06 pm
Ultimate USB GPS PPS Driver
Hello,
I am trying to use an Adafruit Ultimate GPS with USB (https://www.adafruit.com/product/4279) on a PICM3+ system. USB is the connectivity of choice as the GPIOs are not available.
The GPS appears to work properly, but the CP2104 does not appear to be set up to support RI (or any other signal). Given that this is an Adafruit product, I cannot imagine that there is no way to get PPS on a RI from the USB GPS on a Raspberry Pi.
I am currently running "4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux". Thanks in advance for any suggestions.
Regards,
Neal
I am trying to use an Adafruit Ultimate GPS with USB (https://www.adafruit.com/product/4279) on a PICM3+ system. USB is the connectivity of choice as the GPIOs are not available.
The GPS appears to work properly, but the CP2104 does not appear to be set up to support RI (or any other signal). Given that this is an Adafruit product, I cannot imagine that there is no way to get PPS on a RI from the USB GPS on a Raspberry Pi.
I am currently running "4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux". Thanks in advance for any suggestions.
Regards,
Neal
- mikeysklar
- Posts: 11695
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Ultimate USB GPS PPS Driver
Hello ndillman,
I think this issue came up in July in the forums.
viewtopic.php?f=8&t=153734&p=759712&hil ... PS#p759712
I see that our guide is using the PL2303 USB->TTL adapter. Would that be an option for you if gpsd does not currently support USB devices?
https://learn.adafruit.com/adafruit-ult ... rything-up
I think this issue came up in July in the forums.
viewtopic.php?f=8&t=153734&p=759712&hil ... PS#p759712
I see that our guide is using the PL2303 USB->TTL adapter. Would that be an option for you if gpsd does not currently support USB devices?
https://learn.adafruit.com/adafruit-ult ... rything-up
- ndillman
- Posts: 5
- Joined: Thu Dec 05, 2019 9:06 pm
Re: Ultimate USB GPS PPS Driver
Having read that it appears that the posting from adafruit_support_mike were not properly informed. GPSD supports all of the signals..mikeysklar wrote:Hello ndillman,
I think this issue came up in July in the forums.
From ppsthread.c, line 455:
Code: Select all
#define PPS_LINE_TIOC (TIOCM_CD|TIOCM_RI|TIOCM_CTS|TIOCM_DSR)
No, TTL is not an option.mikeysklar wrote: I see that our guide is using the PL2303 USB->TTL adapter. Would that be an option for you if gpsd does not currently support USB devices?
https://learn.adafruit.com/adafruit-ult ... rything-up
Adafruit designed a solution based on the CP2104. In fact, there are two of them, the other being the USB to serial converter (https://www.adafruit.com/product/3309). That product also appears to have the same issue as the GPS on the Raspberry PI, and possibly all Linuxes. The description clearly indicates that the signals are available, and that Linux requires no driver.
Perhaps this is a kernel revision issue? Or something in setup that is not yet well documented? I find it hard to believe that both products weren't tested to the specifications on the website, so there must be a simple answer that is being missed.
Regards,
Neal
- mikeysklar
- Posts: 11695
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Ultimate USB GPS PPS Driver
Just to confirm. The USB GPS device is working with your and shows up properly with lsusb or dmesg | grep ttyS? The issue is exclusively with PPS output on the Ring Indicator pin?
- ndillman
- Posts: 5
- Joined: Thu Dec 05, 2019 9:06 pm
Re: Ultimate USB GPS PPS Driver
That is correct.
The issue appears to be related to the CP2104 driver. While data flows to/fro, no IOCTLs work.
Regards,
Neal
The issue appears to be related to the CP2104 driver. While data flows to/fro, no IOCTLs work.
Regards,
Neal
- mikeysklar
- Posts: 11695
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Ultimate USB GPS PPS Driver
Looking at GPSD supported hardware it seems that they are not presently support PPS on the Adafruit MT3339 based modules.
https://gpsd.gitlab.io/gpsd/hardware.html
https://gpsd.gitlab.io/gpsd/hardware.html
- ndillman
- Posts: 5
- Joined: Thu Dec 05, 2019 9:06 pm
Re: Ultimate USB GPS PPS Driver
Mike,mikeysklar wrote:Looking at GPSD supported hardware it seems that they are not presently support PPS on the Adafruit MT3339 based modules.
That is a reference to the Hat which supports PPS via GPIO, and BTW, does work just fine with PPS (viewtopic.php?f=50&t=70133&start=60#p359668). This issue has nothing to do with gpsd (and I probably will not use gpsd in the long run). It can be demonstrated with anything that uses the PPS API on the PI -- or probably any Linux.
Or you can demonstrate it without the PPS API just by attempting IOCTLs on the device (or the other CP2104 device I mentioned above). They fail. It appears to be something with the driver, as the IOCTLs fail immediately.
As far as I can tell, the GPS is working fine, the issue is solely with the USB to serial device that is on the Adafruit solutions (both standalone and GPS). It is advertised to work on Linux (of various flavors), so it must have been tested. And I cannot imagine that it was only tested on Windows. I'm just looking for a pointer to a Linux solution for the CP2104 interfaces that Adafruit advertises as working.
Thanks in advance.
Regards,
Neal
- mikeysklar
- Posts: 11695
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Ultimate USB GPS PPS Driver
Neal,
Looking at the FAQ for the Ultimate GPS it does have an entry for getting PPS data on the USB version under linux. If you have not already setup the CircuitPython code with your USB unit you might want to play with that.
https://learn.adafruit.com/adafruit-ultimate-gps/f-a-q
https://learn.adafruit.com/adafruit-ult ... on-parsing
Looking at the FAQ for the Ultimate GPS it does have an entry for getting PPS data on the USB version under linux. If you have not already setup the CircuitPython code with your USB unit you might want to play with that.
https://learn.adafruit.com/adafruit-ultimate-gps/f-a-q
https://learn.adafruit.com/adafruit-ult ... on-parsing
How can I read the PPS signal on the Ultimate GPS USB?
The PPS line is tied to the serial port RI (Ring Indicator) pin. You can read this with your serial-port interface code. for example here's a version in Python using pyserial:
Code: Select all
import serial
ser = serial.Serial('/dev/ttyS34') # open serial port
print(ser.name) # check which port was really used
last_ri = ser.ri
while True:
if ser.ri != last_ri:
last_ri = ser.ri
if last_ri:
print("\n---------- Pulse high ----------")
else:
print("\n---------- Pulse low ----------")
if ser.in_waiting:
print(ser.read(ser.in_waiting).decode('utf-8'), end="")
- ndillman
- Posts: 5
- Joined: Thu Dec 05, 2019 9:06 pm
Re: Ultimate USB GPS PPS Driver
Sorry for the slow response.
I took a look again at the FAQ you referenced as well as the sample code. Unfortunately, that code is not useful for the purpose of PPS.
PPS is a Pulse Per Second that is used for precision timing. In order for a PPS to work it has to be driven by the PPS event on the GPS. The sample code is polled, thereby making the PPS output useless.
I did some digging and found that as I suspected, the CP2104 driver is not properly equipped to provide PPS. I had some hope that newer versions of the driver might be so equipped, but that is also not the case. Finally I tried modifying the driver to add the proper callbacks. That worked in that PPS then connected without timing out, however a signal was never fired, meaning that the underpinnings to support PPS is not present.
As far as I can tell the USB Ultimate GPS is useless for PPS unless there is an updated driver somewhere.
-Neal-
I took a look again at the FAQ you referenced as well as the sample code. Unfortunately, that code is not useful for the purpose of PPS.
PPS is a Pulse Per Second that is used for precision timing. In order for a PPS to work it has to be driven by the PPS event on the GPS. The sample code is polled, thereby making the PPS output useless.
I did some digging and found that as I suspected, the CP2104 driver is not properly equipped to provide PPS. I had some hope that newer versions of the driver might be so equipped, but that is also not the case. Finally I tried modifying the driver to add the proper callbacks. That worked in that PPS then connected without timing out, however a signal was never fired, meaning that the underpinnings to support PPS is not present.
As far as I can tell the USB Ultimate GPS is useless for PPS unless there is an updated driver somewhere.
-Neal-
- mikeysklar
- Posts: 11695
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Ultimate USB GPS PPS Driver
Neal,
I appreciate your additional digging into this and attempts to make PPS functional with the CP2104 driver. If I see anything I'll update this thread.
I appreciate your additional digging into this and attempts to make PPS functional with the CP2104 driver. If I see anything I'll update this thread.
- bjmcculloch
- Posts: 1
- Joined: Wed Oct 07, 2020 5:59 pm
Re: Ultimate USB GPS PPS Driver
Not only does the Linux driver driver not implement the required functionality, it's likely that it never will. As Neal noted, the hardware appears to not support the required functionality.
https://www.spinics.net/lists/linux-usb/msg197608.html
https://www.silabs.com/community/interf ... ngmod-Lxtj
It seems to me that a re-spin of the Ultimate GPS w/ USB is in order. The current version simply doesn't provide the level of functionality advertised. Granted it's due to an esoteric error, and it works, more or less, but if the whole point of the device is accurate timing, then it's really not acceptable for this use case.
https://www.spinics.net/lists/linux-usb/msg197608.html
https://www.silabs.com/community/interf ... ngmod-Lxtj
It seems to me that a re-spin of the Ultimate GPS w/ USB is in order. The current version simply doesn't provide the level of functionality advertised. Granted it's due to an esoteric error, and it works, more or less, but if the whole point of the device is accurate timing, then it's really not acceptable for this use case.
Please be positive and constructive with your questions and comments.