Black Lives Matter - Action and Equality. ... Adafruit is part of the Stop Hate for Profit campaign. Adafruit is open and shipping.
0

Raspberry Pi GPS Stratum 1 NTP Server
Moderators: adafruit_support_bill, adafruit

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/
Please be positive and constructive with your questions and comments.

Re: Raspberry Pi GPS Stratum 1 NTP Server

by Tobi2707 on Thu Mar 26, 2015 12:26 pm

forgot to stop ntp, but after stopping same error..

running gpsstatus opens new windows, like "gpsmon" and this in the console:
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi ~ $ gpsstatus /dev/ttyAMA0
Traceback (most recent call last):
  File "/usr/local/bin/gpsstatus", line 577, in <module>
    rc = curses.wrapper(main)
  File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/local/bin/gpsstatus", line 571, in main
    input_loop(fg)
  File "/usr/local/bin/gpsstatus", line 437, in input_loop
    time.sleep(0.250)
KeyboardInterrupt

Tobi2707
 
Posts: 87
Joined: Thu Mar 12, 2015 8:07 am

Re: Raspberry Pi GPS Stratum 1 NTP Server

by Tobi2707 on Thu Mar 26, 2015 12:29 pm

ah wait, now i get this:
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi ~ $ gpsinit -s 115200 -f /etc/gpsinit_nav.conf /dev/ttyAMA0
Making sure the unit is in NMEA mode
Making sure the speeds match
GPS and port are now synchronized at 115200
Processing commands...
PMTK301,2
Failed to get ACK.
PMTK313,1
Failed to get ACK.
PMTK314,1,1,1,1,1,5,1,1,1,1,1,0,0,0,0,0,0,1,0
Failed to get ACK.
PMTK319,1
Failed to get ACK.
PMTK225,0
Failed to get ACK.
PMTK286,1
Failed to get ACK.
PMTK386,0.50
Failed to get ACK.
PMTK869,1,1
Failed to get ACK.
PMTK220,1000
Failed to get ACK.
Done
pi@raspberrypi ~ $

Tobi2707
 
Posts: 87
Joined: Thu Mar 12, 2015 8:07 am

Re: Raspberry Pi GPS Stratum 1 NTP Server

by gtj on Thu Mar 26, 2015 12:39 pm

Strange. I wonder if it's something with the older Pis?

Try this... Power down the Pi and remove the battery from the hat for a minute to reset it, then try again.

gtj
 
Posts: 109
Joined: Wed Feb 04, 2015 9:11 pm

Re: Raspberry Pi GPS Stratum 1 NTP Server

by Tobi2707 on Thu Mar 26, 2015 12:40 pm

Is the second output not right?
with the done at the end?

Tobi2707
 
Posts: 87
Joined: Thu Mar 12, 2015 8:07 am

Re: Raspberry Pi GPS Stratum 1 NTP Server

by gtj on Thu Mar 26, 2015 12:48 pm

Failed to get ack means the command was sent to the gps but it didn't reply. It may have worked however. The only way to tell is to get the gpsstatus working and I don't understand why it isn't.

gtj
 
Posts: 109
Joined: Wed Feb 04, 2015 9:11 pm

Re: Raspberry Pi GPS Stratum 1 NTP Server

by Tobi2707 on Thu Mar 26, 2015 12:50 pm

is gpsstatus not working? what should happen?
So i removed the battery for a minute an now?

Tobi2707
 
Posts: 87
Joined: Thu Mar 12, 2015 8:07 am

Re: Raspberry Pi GPS Stratum 1 NTP Server

by Tobi2707 on Thu Mar 26, 2015 12:54 pm

This after rebooting:
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi ~ $ gpsinit -s 115200 -f /etc/gpsinit_nav.conf /dev/ttyAMA0
Making sure the unit is in NMEA mode
Making sure the speeds match
The GPS speed and the port speed couldn't be synchronized.
Retrying
Making sure the speeds match
The GPS speed and the port speed couldn't be synchronized.
pi@raspberrypi ~ $ sudo service ntp stop
[ ok ] Stopping NTP server: ntpd.
pi@raspberrypi ~ $ gpsinit -s 115200 -f /etc/gpsinit_nav.conf /dev/ttyAMA0
Making sure the unit is in NMEA mode
Making sure the speeds match
The GPS speed and the port speed couldn't be synchronized.
Retrying
Making sure the speeds match
GPS and port are now synchronized at 115200
Processing commands...
PMTK301,2
Failed to get ACK.
PMTK313,1
Failed to get ACK.
PMTK314,1,1,1,1,1,5,1,1,1,1,1,0,0,0,0,0,0,1,0
PMTK319,1
Failed to get ACK.
PMTK225,0
PMTK286,1
Failed to get ACK.
PMTK386,0.50
Failed to get ACK.
PMTK869,1,1
PMTK220,1000
Done


What's with this?

Tobi2707
 
Posts: 87
Joined: Thu Mar 12, 2015 8:07 am

Re: Raspberry Pi GPS Stratum 1 NTP Server

by gtj on Thu Mar 26, 2015 1:11 pm

Looks like some of the commands are working and some aren't.

I wonder if the hat is making intermittent connection to the Pi? You might want to double check that the pins are all soldered correctly, particularly the TXD and RXD pins. Maybe re-solder them just to make sure. Then re-seat the hat on the Pi.

gtj
 
Posts: 109
Joined: Wed Feb 04, 2015 9:11 pm

Re: Raspberry Pi GPS Stratum 1 NTP Server

by Tobi2707 on Thu Mar 26, 2015 1:16 pm

i don't have something to solder hat home, it's at work... would gaps work if the connections were not right?
when i run gpsstatus is see a black window with my time and my coordinates..and see satellites, my device and the nmea sentences...
what if we just go on and see if it's working? with the next command?

What's the command the set the gps module and the RPi back to factory state?

If nothing doesn't help, i get the RPi 2 within the next week, I'm waiting for 2 weeks for it:D

Tobi2707
 
Posts: 87
Joined: Thu Mar 12, 2015 8:07 am

Re: Raspberry Pi GPS Stratum 1 NTP Server

by gtj on Thu Mar 26, 2015 1:21 pm

Yeah, if gpsstatus is working, keep going.

To reset to factory state use "gpssend PMTK104 /dev/ttyAMA0" PMTK104 is the GPS command to reset to factory state.

gtj
 
Posts: 109
Joined: Wed Feb 04, 2015 9:11 pm

Re: Raspberry Pi GPS Stratum 1 NTP Server

by Tobi2707 on Thu Mar 26, 2015 1:23 pm

Now after the second command i get this:
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi ~ $ gpsinit -s 115200 -f /etc/gpsinit_time.conf /dev/ttyAMA0
Making sure the unit is in NMEA mode
Making sure the speeds match
The GPS speed and the port speed couldn't be synchronized.
Retrying
Making sure the speeds match
GPS and port are now synchronized at 115200
Processing commands...
PMTK314,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0
PMTK220,1000
Done


Is this right? What's after?

Is there any difference to:
Code: Select all | TOGGLE FULL SIZE
./gpsinit -s 9600 -i factory_reset /dev/ttyAMA0

Tobi2707
 
Posts: 87
Joined: Thu Mar 12, 2015 8:07 am

Re: Raspberry Pi GPS Stratum 1 NTP Server

by gtj on Thu Mar 26, 2015 1:28 pm

YES!!

You should now be able to start ntp and watch with 'ntpq -pn'

There's no real between the 2 commands, gpssend just sends the one command while gpsinit -i factory_reset also does the baud rate changes. gpsinit is probably better.

gtj
 
Posts: 109
Joined: Wed Feb 04, 2015 9:11 pm

Re: Raspberry Pi GPS Stratum 1 NTP Server

by Tobi2707 on Thu Mar 26, 2015 1:30 pm

before the
Code: Select all | TOGGLE FULL SIZE
sudo update-rc.d nt. defaults
?
what is this for?
and then start ntp and then ntpq -pnß

Tobi2707
 
Posts: 87
Joined: Thu Mar 12, 2015 8:07 am

Re: Raspberry Pi GPS Stratum 1 NTP Server

by gtj on Thu Mar 26, 2015 1:35 pm

Tobi2707 wrote:before the
Code: Select all | TOGGLE FULL SIZE
sudo update-rc.d nt. defaults
?
what is this for?
and then start ntp and then ntpq -pnß


That just insures that ntp is started when the system boots.
Yep, go for it.

gtj
 
Posts: 109
Joined: Wed Feb 04, 2015 9:11 pm

Re: Raspberry Pi GPS Stratum 1 NTP Server

by Tobi2707 on Thu Mar 26, 2015 1:40 pm

The Output is:
Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi ~ $ sudo update-rc.d ntp defaults
update-rc.d: using dependency based boot sequencing
update-rc.d: warning: default stop runlevel arguments (0 1 6) do not match ntp Default-Stop values (none)
pi@raspberrypi ~ $ sudo service ntp start
[ ok ] Starting NTP server: ntpd.
pi@raspberrypi ~ $ sudo ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 127.127.20.0    .GPS0.           1 l   6h    8    0    0.000    0.000   0.004
 129.70.132.37   129.70.130.70    2 u    1   64    1   28.380    1.400   0.092
pi@raspberrypi ~ $ sudo ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*127.127.20.0    .GPS0.           1 l    5    8    1    0.000    0.016   0.004
 129.70.132.37   129.70.130.70    2 u    1   64    1   28.280    1.060   0.244


What do you mean?:)

Tobi2707
 
Posts: 87
Joined: Thu Mar 12, 2015 8:07 am

Please be positive and constructive with your questions and comments.