¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

GPS Update Tool - I want to set time based on its data from my iPhone - possible?


 

I was doing a POTA activation today. Rather than take my trailer to the park, I packed up my radio, battery, RPi and computer. There was no internet, so I was using the RPi as a hotspot. My generally unreliable GPS dongle was unreliable... But I had my iPhone running GPS2IP. Got everything configured - and had location being delivered to the RPi from my iPhone. But - the time was off by about 45 minutes (probably when I shut down the RPi before heading to the park).?

Is there a way to have the RPi sync time with the incredibly accurate time from the iPhone delivered in the GPS data?

Ultimately I used "sudo date -s "date/time string" --utc
Hitting the return key within about a second of the time (shown on my iPhone). Kind of tricky sitting in the sun...

Jim
KM6GUO


 

You could do a few things, but to?set gpsd to listen for a push from the app (example config of port 9999) is one, this way most Linux can talk gpsd. Link your phone to device via WiFi hotspot. Use the device IP addresses. Push from phone to device IP:9999?


Edit the /etc/sysconfig/gpsd or could be /etc/default/gpsd config file and make sure that the OPTIONS parameter has a UDP source that accepts packets on port 9999 (for example)?

# Options for gpsd, including serial devices

OPTIONS="udp://*:9999"

# Set to 'true' to add USB devices automatically via udev

USBAUTO="false"


 

I use a number of BU-353 GPS puck receivers with RPis with almost zero
problems. There are a whole bunch of various GPS puck receivers out
there from $20-50. You don't want a dongle, you want a puck on the end
of a wire.

Michael WA7SKG


Jim KM6GUO wrote on 3/22/24 3:33 PM:

I was doing a POTA activation today. Rather than take my trailer to the
park, I packed up my radio, battery, RPi and computer. There was no
internet, so I was using the RPi as a hotspot. My generally unreliable
GPS dongle was unreliable... But I had my iPhone running GPS2IP. Got
everything configured - and had location being delivered to the RPi from
my iPhone. But - the time was off by about 45 minutes (probably when I
shut down the RPi before heading to the park).

Is there a way to have the RPi sync time with the incredibly accurate
time from the iPhone delivered in the GPS data?

Ultimately I used "sudo date -s "date/time string" --utc
Hitting the return key within about a second of the time (shown on my
iPhone). Kind of tricky sitting in the sun...

Jim
KM6GUO


 

Kelly - thank you.

I had set up GPS2IP (iOS application) with what I believe was the default port of 11123. I did not have the OPTIONS entry - and added that. In GPS2IP i have selected NMEA Message types RMC, GGA and GLL.

The lat and long are displayed correctly when I run cgps. And the location is displayed in CONKY. The correct time is displayed in cgps - but the time displayed in CONKY or using the date command is incorrect.?

Note that the above is when I am operating with the RPi as a hot spot - and have no internet connection (with internet connection the RPi syncs time off of the internet).?

I found these commands I can issue - but this results in a time setting off by 2 seconds or so. I need more accuracy to dependable run wsjtx.
GPSDATE=`gpspipe -w | head -10 | grep TPV | sed -r 's/.*"time":"([^"]*)".*/\1/' | head -1`
sudo date -s "$GPSDATE"

It seems like there should be a way to have the time set from the gps data.

Jim
KM6GUO


 

one option is setting ntp to use gpsd, details on needed changes here?

-k


 

On Sat, Mar 23, 2024 at 01:44 AM, Michael WA7SKG wrote:
BU-353 GPS puck receiver
Thank you Michael - I will look at BU-353 GPS puck receivers - they may be a better solution inside my Airstream trailer (or may be useful enough that I should run the puck outside). The use case I have at the moment is when I leave the confines of my Airstream - take my radio portable and operate for a few hours (POTA) off the grid. In that case I only need to grab the GPS location and time at the beginning of the session. Sending the data from my iPhone seemed like a great quick solution. GPS2IP seems to (almost) do the job - successfully sending the lat/long. But the more important function I was hoping for was setting the time (which the iPhone always knows) on the RPi.

I hate to add another device to my deployment (like a puck) but that may be the right solution.

Setting time by hand works (but is tedious to get it close enough).?

Jim
KM6GUO


 

I use WSJT-x and my phone without internet all the time without issue but I am using GPSD forwarder from my Android phone. In my experience, Android is the better option for techies, tinkering, and ham radio. Might be something to consider next time you're looking at phones.


On Sun, Mar 24, 2024, 16:48 Jim KM6GUO <km6guo@...> wrote:
On Sat, Mar 23, 2024 at 01:44 AM, Michael WA7SKG wrote:
BU-353 GPS puck receiver
Thank you Michael - I will look at BU-353 GPS puck receivers - they may be a better solution inside my Airstream trailer (or may be useful enough that I should run the puck outside). The use case I have at the moment is when I leave the confines of my Airstream - take my radio portable and operate for a few hours (POTA) off the grid. In that case I only need to grab the GPS location and time at the beginning of the session. Sending the data from my iPhone seemed like a great quick solution. GPS2IP seems to (almost) do the job - successfully sending the lat/long. But the more important function I was hoping for was setting the time (which the iPhone always knows) on the RPi.

I hate to add another device to my deployment (like a puck) but that may be the right solution.

Setting time by hand works (but is tedious to get it close enough).?

Jim
KM6GUO


 

Aha - I am running timesyncd (I think) and don't have ntp on this RPi. I will need to find a few more wits before going after changing from timesyncd to ntp. But this suggestion - and sorting out the subtleties of ntp so I can switch back and forth between using this RPi in my base (a travel trailer) and using it as a portable rig for POTA on the go.

Thanks again for your timely suggestions.

Jim
KM6GUO


 

sudo apt install ntp will get things going?


 

I remember seeing a clever bit of software that watches the WSJTX receptions from the last x stations, interpolates your time offset from their average, and sets your computer time to that result. Supposed to get you close enough to operate WSJTX without need for Internet time or GPS time. I never used it myself but search for it, might ge good to have as a backup service on your computer anyway.
--
---
Steve Johnson
K0OIL


 

Thank you Steve - i found TimeFudge - referenced on W9MDB's QRZ.com page. I think that may be what you are referencing. I will take a look.


 

Thank you Kelly. I will try this.