Pi-Star 4.1.0-RC7 - NTP error...

General support for the Pi-Star System
G8OGJ
Posts: 65
Joined: Mon May 06, 2019 8:13 pm
Location: Matlock
Contact:

Pi-Star 4.1.0-RC7 - NTP error...

Post by G8OGJ »

Folks,

I have just built a Pi-Star JumboSpot hotspot using a Raspberry Pi Zero W and loaded 4.1.0-RC7. Everything is working ok save that the date and time are WRONG. Yesterday evening (20:00 UK time) it thought that it was 05:00 on 20.12.19 (it was 22.12.19) and this morning it thinks that it is around 15:00 on 20.12.19 (I'm not saying that it is counting hours incorrectly).

Now, my WiFi router has an NTP server which is locked to the local (Europe) NTP cluster so is bank-on. The router thinks that it is 23.12.19 this morning which is correct.

Any thoughts?

I cannot seem to update or upgrade this installation - unable to access error as usual.

Regards,

Ian
Amateur Radio Station G8OGJ
User avatar
KE0FHS
Posts: 1122
Joined: Wed Apr 11, 2018 8:40 pm
Location: Colorado, USA
Contact:

Re: Pi-Star 4.1.0-RC7 - NTP error...

Post by KE0FHS »

UPDATE: This process doesn't work for Pi-Star 4.1.x. For the updated process, see the post by KC7NGC below.

Hi Ian,

The RPi uses Network Time Protocol (NTP) to synchronize its clock to UTC. In some cases, the time may get out of sync. In that case, you can simply restart the RPi and the NTP daemon should re-synchronize to UTC. If necessary, you can force a manual re-synchronization via Pi-Star 3.4.x:
Log into Pi-Star via SSH, and then run the following commands:

Code: Select all

sudo systemctl stop ntp.service
sudo ntpdate pool.ntp.org
sudo systemctl start ntp.service
Last edited by KE0FHS on Mon Dec 23, 2019 7:20 pm, edited 1 time in total.
73, Toshen, KE0FHS
Playing with Pi-Star (unofficial notes about setting up and using Pi-Star):
https://amateurradionotes.com/pi-star.htm
G8OGJ
Posts: 65
Joined: Mon May 06, 2019 8:13 pm
Location: Matlock
Contact:

Re: Pi-Star 4.1.0-RC7 - NTP error...

Post by G8OGJ »

Toshen,

Thank you for your reply. Unfortunately:

sudo: ntpdate: command not found

I've tried installing but "no candidate for ntpdate".

Sad.

I didn't understand how it can have found the date that it has - then I realised that the release was dated 19th December.

Ian
Amateur Radio Station G8OGJ
G8OGJ
Posts: 65
Joined: Mon May 06, 2019 8:13 pm
Location: Matlock
Contact:

Re: Pi-Star 4.1.0-RC7 - NTP error...

Post by G8OGJ »

Further to my last. the Pi thinks that ntp is installed so I have removed it with the intention of re-installing but then it says again "no release candidate" so I cannot even reinstall ntp! sntp is installed still. There is no ntpdate function:-(

Ian
Amateur Radio Station G8OGJ
AF6VN
Posts: 821
Joined: Fri Jul 20, 2018 1:15 am

Re: Pi-Star 4.1.0-RC7 - NTP error...

Post by AF6VN »

pi-star@pi-star-3b(rw):~$ apt search ntpdate
Sorting... Done
Full Text Search... Done
htpdate/stable 1.2.0-3 armhf
HTTP based time synchronization tool

ntp-doc/stable 1:4.2.8p12+dfsg-4 all
Network Time Protocol documentation

ntpdate/stable,now 1:4.2.8p12+dfsg-4 armhf [residual-config]
client for setting system time from NTP servers (deprecated)

ntpsec-doc/stable 1.1.3+dfsg1-2 all
Network Time Protocol documentation

ntpsec-ntpdate/stable 1.1.3+dfsg1-2 armhf
client for setting system time from NTP servers

pi-star@pi-star-3b(rw):~$
pi-star@pi-star-3b(rw):~$ apt search ntp
Sorting... Done
Full Text Search... Done
adjtimex/stable 1.29-10 armhf
kernel time variables configuration utility

<SNIP>

chrony/stable 3.4-4 armhf
Versatile implementation of the Network Time Protocol

<SNIP>

htpdate/stable 1.2.0-3 armhf
HTTP based time synchronization tool

<SNIP>

ntp/stable,now 1:4.2.8p12+dfsg-4 armhf [installed]
Network Time Protocol daemon and utility programs

ntp-doc/stable 1:4.2.8p12+dfsg-4 all
Network Time Protocol documentation

ntpdate/stable,now 1:4.2.8p12+dfsg-4 armhf [residual-config]
client for setting system time from NTP servers (deprecated)

ntpsec/stable 1.1.3+dfsg1-2 armhf
Network Time Protocol daemon and utility programs

ntpsec-doc/stable 1.1.3+dfsg1-2 all
Network Time Protocol documentation

ntpsec-ntpdate/stable 1.1.3+dfsg1-2 armhf
client for setting system time from NTP servers

ntpsec-ntpviz/stable 1.1.3+dfsg1-2 armhf
NTP statistics graphing utility

ntpstat/stable 0.0.0.1-2 armhf
show network time protocol (ntp) status

openntpd/stable 1:6.2p3-4 armhf
OpenBSD NTP daemon

<SNIP>

sntp/stable,now 1:4.2.8p12+dfsg-4 armhf [installed,automatic]
Network Time Protocol - sntp client

<SNIP>
pi-star@pi-star-3b(rw):~$
I'm afraid just search on NTP also picks up everything that mentions NNTP... Hence all the <SNIP>

Make sure you've set the clock fairly accurately before doing "apt update" -- if the clock is off, it may reject package lists as being "released in the future".

--
AF6VN
Dennis L Bieber
G8OGJ
Posts: 65
Joined: Mon May 06, 2019 8:13 pm
Location: Matlock
Contact:

Re: Pi-Star 4.1.0-RC7 - NTP error...

Post by G8OGJ »

I cannot set the clock - the date command fails and says that it cannot (I say will not) update the clock - it is 2 days out.

Ian
Amateur Radio Station G8OGJ
User avatar
KE0FHS
Posts: 1122
Joined: Wed Apr 11, 2018 8:40 pm
Location: Colorado, USA
Contact:

Re: Pi-Star 4.1.0-RC7 - NTP error...

Post by KE0FHS »

Apologies, this must be a recent change in Pi-Star.

Dennis, do you know how to set the system time using the new ntpsec-ntpdate command?
73, Toshen, KE0FHS
Playing with Pi-Star (unofficial notes about setting up and using Pi-Star):
https://amateurradionotes.com/pi-star.htm
G8OGJ
Posts: 65
Joined: Mon May 06, 2019 8:13 pm
Location: Matlock
Contact:

Re: Pi-Star 4.1.0-RC7 - NTP error...

Post by G8OGJ »

I have reverted to 3.14.17 - problem solved! So much for progress.

Thanks for the helpful input guys.

Ian
Amateur Radio Station G8OGJ
kc7ngc
Posts: 48
Joined: Fri Sep 21, 2018 2:47 am

Re: Pi-Star 4.1.0-RC7 - NTP error...

Post by kc7ngc »

I realize OP has reverted back so doesn't have an issue. But posting here just in case someone has same issue:

If machine gets to far out of sync ntpd won't automatically resync as it can cause logging issues etc. So usually need to set date to something close and ntpd will then get it back on track. If date it to far out of sync also won't be able to install new packages so sometimes have to force time from command line:

Code: Select all

 sudo date -s "23 DEC 2019 09:52:30"
ntpdate is deprecated in new versions of linux distros as its functionality is now all built into the ntpd executable itself. If you want to force ntpd to update date/time regardless how bad the timesync offset is then then stop ntpd, run it on command line with a force, then restart service.

Code: Select all

sudo systemctl stop ntp
sudo ntpd -gq
sudo systemctl start ntp
User avatar
KE0FHS
Posts: 1122
Joined: Wed Apr 11, 2018 8:40 pm
Location: Colorado, USA
Contact:

Re: Pi-Star 4.1.0-RC7 - NTP error...

Post by KE0FHS »

kc7ngc wrote: Mon Dec 23, 2019 6:20 pm I realize OP has reverted back so doesn't have an issue. But posting here just in case someone has same issue:
Thanks, Craig!
73, Toshen, KE0FHS
Playing with Pi-Star (unofficial notes about setting up and using Pi-Star):
https://amateurradionotes.com/pi-star.htm
Post Reply