gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-users] PPS to gpsd from Pi GPIO pin


From: Pete Nevill
Subject: [gpsd-users] PPS to gpsd from Pi GPIO pin
Date: Wed, 9 Mar 2016 11:10:23 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0


Hi. I wonder if anyone can help? I have a question about getting PPS to gpsd from a gps via GPIO pins using a Raspberry PI.

I have an Ultimate GPS Breakout V3 board https://www.adafruit.com/products/746

I have connected the PPS pin directly to my Pi via GPIO pin 18.

I have added the following line to /boot/config.txt
dtoverlay=pps-gpio,gpiopin=18

When I boot the pi I get the following:

[    9.859705] pps_core: LinuxPPS API ver. 1 registered
[ 9.863843] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <address@hidden>
[   10.052295] pps pps0: new PPS source pps.-1
[   10.054528] pps pps0: Registered IRQ 412 as PPS source
[   14.209399] pps_ldisc: PPS line discipline registered

Looking good so far... Do a quick test to see if we have any ticks!

sudo ppstest /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
source 0 - assert 1457520369.538064030, sequence: 180812 - clear 0.000000000, sequence: 0 source 0 - assert 1457520370.538051840, sequence: 180813 - clear 0.000000000, sequence: 0 source 0 - assert 1457520371.538039843, sequence: 180814 - clear 0.000000000, sequence: 0

Yes... we are cooking.

I connected the TX and RX (of the break out) to a serial to USB adapter like this https://www.adafruit.com/products/954

My gpsd config:

START_DAEMON="true"
GPSD_OPTIONS="-n -G"
DEVICES="/dev/ttyUSB0"
USBAUTO=""
GPSD_SOCKET="/var/run/gpsd.sock"

When I start up gpsd everything works fine. I get 10 or so satellites and a good fix. My problem is that gpsd is not getting the PPS signal. When I run gpsmon the pps section is empty, this is the output of gpsd when run in debug mode.

gpsd:INFO: gpsd_activate(2): activated GPS (fd 5)
gpsd:PROG: PPS:/dev/ttyUSB0 chrony socket /var/run/chrony.ttyUSB_gps.sock doesn't exist
gpsd:PROG: KPPS:/dev/ttyUSB0 checking /sys/devices/virtual/pps/pps0/path,
gpsd:PROG: KPPS:/dev/ttyUSB0 checking /sys/devices/virtual/pps/pps1/path, /dev/ttyUSB0
gpsd:INFO: KPPS:/dev/ttyUSB0 device not found.
gpsd:WARN: KPPS:/dev/ttyUSB0 kernel PPS unavailable, PPS accuracy will suffer
gpsd:PROG: PPS:/dev/ttyUSB0 thread launched
gpsd:INFO: PPS:/dev/ttyUSB0 ntpshm_link_activate: 1
gpsd:INFO: device /dev/ttyUSB0 activated

It appears to look in the right place "pps0" but then ignores it, why, this is a good pps signal???? I guess I do not understand the link with ttyUSB0 and PPS. It then creates its own pps device on /dev/pps1 which is linked to ttyUSB0 but we know that PPS is already available via pps0 (Pin18), there is no PPS via USB! Is this a bug or is there a way to tell gpsd to use PPS from pps0 and not waste time creating its own trying to get it from ttyUSB0....! Although gpsd does acknowledge that PPS is unavailable via ttyUSB0, why not fall back to pps0?

I tried to trick gpsd by creating a symlink to pps0 from pps1 "sudo ln -fs /dev/pps0 /dev/pps1". The ppstest worked on pps1 as it is now linked to pps0 but when I run gpsmon again still empty pps section, I guess gpsd has no knowledge of either as it sort of failed during initialisation.

Another way would be to somehow pass the PPS via the USB but its not obvious how I would do this and I actually want to take the USB out of the equation, connect the break-out board direct to the Pi GPIO pins to reduce the latency.

Any suggestion or am I asking too much?

Thanks,

Pete





reply via email to

[Prev in Thread] Current Thread [Next in Thread]