I’m currently working on a Nvidia Jetson TX2 with Ubuntu 18, using an Emlid Reach GPS Module connected by USB and getting NMEA messages through a TCP connection plus a 1-PPS signal through a UART pin.
I’m not being able to correctly sync the system clock with the GPS clock.
I managed to correctly expose the PPS signal using a GPIO pin in the Jetson (recompiling kernel with proper flags), and obtained two linux devices: /dev/pps0 and /dev/pps1. pps0 corresponds to the Jetson kernel PPS and pps1 is the GPS PPS related to the GPIO pin in the board.
The GPS module is connected with a USB cable but provides data by creating a USB-To-Ethernet interface and responding on IP 192.168.2.15, TCP port for data acquisition is configurable and set at port 9001. The PPS signal is connected to the pin in the jetson.
My issue is that some gps+pps tools give me satisfactory results while others fail horribly.
Testing both pps signals:
sudo ppstest /dev/pps0
sudo ppstest /dev/pps1
Gives satisfactory results:
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
source 0 - assert 1657740302.347287559, sequence: 6590 - clear 0.000000000, sequence: 0
...
But the ppscheck tool doesn’t and fails with:
sudo ppscheck /dev/pps0
# Seconds nanoSecs Signals
PPS ioctl(TIOCMIWAIT) failed: 25 Inappropriate ioctl for device
gpsmon is able to get the NMEA data from the TCP connection but not the PPS, the PPS line remains blank with:
sudo gpsmon -D 5 192.168.2.15:9001:/dev/pps0
or
sudo gpsmon -D 5 192.168.2.15:9001:/dev/pps1
On the other hand trying to configure gpsd fails, and I’m getting:
sudo gpsd -D 5 -N -n tcp://192.168.2.15:9001
gpsd:INFO: launching (Version 3.17)
gpsd:IO: opening IPv4 socket
gpsd:ERROR: can't bind to IPv4 port gpsd, Address already in use
gpsd:ERROR: maybe gpsd is already running!
Using the GPS PPS signal, /dev/pps1 in those examples gives me the same results.
Is this the intended way of synchronizing clocks with the GPS Module?
Does anyone has some information on the proper way to configure gpsd to take NMEA data from the TCP connection + the device PPS signal?
Any information on that PPS “Inappropriate ioctl for device” error?
Thankss