Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Trying to get Adafruit GPS to Raspberry Pi NTP

by rnutter on Wed Feb 27, 2013 8:45 pm

I have been trying for several days now to get the Ultimate GPS Breakout. Doing a cat /dev/ttyUSB0 shows me the data coming from the GPS receiver, so that says that that the GPS receiver is working, the USB console cable from Adafruit is working and the data is making it to the RPi.

Using the cgps -s command gives me the data coming from the receiver and also points to things are working.

I have added the following lines to /etc/ntp.conf and have restarted the ntp service -

server 127.127.28.0 minpoll 4
fudge 127.127.28.0 time1 0.183 refid NMEA
server 127.127.28.1 minpoll 4 prefer
fudge 127.127.28.1 refid PPS

The clock never seems to set. When I run the following command,I would expect to see something in the delay and/or offset columns.

pi@raspberrypi:~$ ntpdc -p
remote local st poll reach delay offset disp
=======================================================================
=SHM(0) 127.0.0.1 0 16 0 0.00000 0.000000 3.99217
=SHM(1) 127.0.0.1 0 16 0 0.00000 0.000000 3.99217

I have checked several resources that got me started on this journey and I dont see anything different. I have to be closed but havent been able to find the problem. I have started with a new Raspian SD card several times and get the same result.

After initially posting this message, I looked at /var/log/syslog and found this line -

pi@raspberrypi:~$ tail /var/log/syslog
Dec 16 21:00:35 raspberrypi ntpd[3576]: ntpd 4.2.6p5@1.2349-o Fri May 18 20:30:57 UTC 2012 (1)
Dec 16 21:00:35 raspberrypi ntpd[3577]: proto: precision = 1.000 usec
Dec 16 21:00:35 raspberrypi ntpd[3577]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
Dec 16 21:00:35 raspberrypi ntpd[3577]: Listen normally on 1 lo 127.0.0.1 UDP 123
Dec 16 21:00:35 raspberrypi ntpd[3577]: Listen normally on 2 eth0 192.168.15.62 UDP 123
Dec 16 21:00:35 raspberrypi ntpd[3577]: peers refreshed
Dec 16 21:00:35 raspberrypi ntpd[3577]: Listening on routing socket on fd #19 for interface updates
Dec 16 21:00:35 raspberrypi ntpd[3577]: restrict: error in address '::' on line 42. Ignoring...
Dec 16 21:00:35 raspberrypi ntpd[3577]: restrict: error in address '::1' on line 46. Ignoring...
Dec 16 21:00:56 raspberrypi gpsd[3543]: gpsd:SHOUT: vendor/product match with 091e:0003 not found

Any ideas as to what that means or what the problem might be ?

Would appreciate any suggestions as to what I may be missing.
Thanks,
Ron
rnutter
 
Posts: 2
Joined: Wed Feb 27, 2013 8:25 pm

Re: Trying to get Adafruit GPS to Raspberry Pi NTP

by wildtang3nt on Thu Feb 28, 2013 5:40 pm

You won't be able to get the pps signal through the console cable. I wired up my setup directly to the UART. This is the guide I followed: http://open.konspyre.org/blog/2012/10/18/raspberry-pi-time-server/

If you use gpsd you can use the shm driver:
Code: Select all
server 127.127.28.0 minpoll 4
fudge 127.127.28.0 refid GPS
server 127.127.28.1 minpoll 4 prefer
fudge 127.127.28.1 refid PPS
Proud owner of (among other wonderful things):
Li-Poly MintyBoost
RGB LCD Pi Plate & Pi Dish
Ice Tube Clock & USBTinyISP
wildtang3nt
 
Posts: 32
Joined: Thu Aug 09, 2012 1:31 pm
Location: Hamilton, Ontario, Canada

Re: Trying to get Adafruit GPS to Raspberry Pi NTP

by rnutter on Thu Feb 28, 2013 9:49 pm

After posting this message, I removed the following lines from my ntp.conf -

server 127.127.28.1 minpoll 4 prefer
fudge 127.127.28.1 refid PPS

Still cant get the time from GPS to show up on the clock.

Since I am not trying to do PPS, is the shm driver still something I need to use ?
All the troubleshooting I have done doesnt give me any idea of what is causing the problem of the time feed from GPS receiver not making it to the clock on the RPi.

Ron
rnutter
 
Posts: 2
Joined: Wed Feb 27, 2013 8:25 pm

Re: Trying to get Adafruit GPS to Raspberry Pi NTP

by wildtang3nt on Fri Mar 01, 2013 2:26 am

If you have gpsd running I'm pretty certain shm is the way to go (but don't quote me). I had similar problems when I tried to have two programs (ntpd and gpsd) accessing the hardware at once. If you're using the NMEA driver, you only need ntpd. Make sure you create the udev rules to symlink /dev/ttyUSB0 to /dev/gps0.
Proud owner of (among other wonderful things):
Li-Poly MintyBoost
RGB LCD Pi Plate & Pi Dish
Ice Tube Clock & USBTinyISP
wildtang3nt
 
Posts: 32
Joined: Thu Aug 09, 2012 1:31 pm
Location: Hamilton, Ontario, Canada

Re: Trying to get Adafruit GPS to Raspberry Pi NTP

by wildtang3nt on Fri Mar 01, 2013 2:31 am

Code: Select all
$ sudo nano /etc/udev/rules.d/80-gps-to-ntp.rules
# Change MODE of ttyUSB0 so it is readable by NTP and provide a symlink to
# /dev/gps0
KERNEL=="ttyUSB0", SUBSYSTEM=="tty", DRIVER=="", SYMLINK+="gps0", MODE="0666"


Actually this may be all you were missing now that I think of it.
Proud owner of (among other wonderful things):
Li-Poly MintyBoost
RGB LCD Pi Plate & Pi Dish
Ice Tube Clock & USBTinyISP
wildtang3nt
 
Posts: 32
Joined: Thu Aug 09, 2012 1:31 pm
Location: Hamilton, Ontario, Canada