You are here

(Solved!) Grandstream 2160 will not get correct date/time from AREDN node NTP server

4 posts / 0 new
Last post
KY4G
(Solved!) Grandstream 2160 will not get correct date/time from AREDN node NTP server
I recently added the package whereandwhen to my AREDN node and connected a GPS antenna to it.  It pulls the position, time, and date just fine.  I added the ntp service to the list of advertised services.  I have a Grandstream 2160 VOIP phone that will not get correct date/time from AREDN node NTP server.  I have successfully retrieved time/date info from us.pool.ntp.org with the phone while connected to the WAN, so I know that it is capable of retrieving and applying it.  I've also set up DHCP option #42 on the AREDN node and populated it with the IP value of the AREDN node.  I have set both the primary and secondary ntp_server IP addresses in the phone to the IP of the AREDN node and also checked the box allowing the DHCP option #42 to override the primary and secondary ntp server addresses.  I've also tried about every known combination of these settings to get it to pull date/time info from the AREDN node while disconnected from the WAN.  I've searched the relevant forums here, but did not find any similar issue.  I have also read through the Node Admin Guide as well as the Grandstream DHCP Options Guide and the Grandstream GXP2160 Administration Guide.  With all of that said, I'm at a loss for why this isn't working.  Am I correct in thinking that a VOIP phone should be able to pull time/date info from an AREDN node using GPS for location/time/date information from the GPS antenna if it is set up as a NTP server?  I'm including relevant screen images in a Word document attachment for reference.


 
File Attachment: 
KY4G
How it got solved the first time
I had installed the whereaandwhen package in order to use a GPS antenna to obtain both location and date/time information on a "Go-Kit" node that would be deployed as part of our local ARES capabilities in case of an emergency and also for use in the ARES Simulated Emergency Test (SET).  We also use VOIP phones in our SET and they have been invaluable to passing traffic and for demostrations to our served agencies.  It always gets brought up that the date/time is not correct on the phones (this also happened at a Jamboree On The Air event with the Boy Scouts).  This had bugged our group for some time, but other than having a connection to the internet (which could be down at least locally in an actual emergency such as the hurricane that hit the Carolinas this year). I incorrectly thought that this would also allow other nodes and devices to use this as a source of timing as is.  It turns out it is more complicated than that.  I was trying to pass this information to the phones using DHCP option 42, but without success when pointing it to the AREDN node (you have to use the actual IP according to the standard) with the GPS antenna attached.  Here is what I did to get it working.  The node I was testing on was an AR-300M16 running nightly build 20241024-7d9ac7e which uses OpenWRT 23.05.5.  It turns out OpenWRT (and hence AREDN) uses BusyBox to provide a lot of stuff including ntpd.  I had to SSH into the node and edit /etc/config/system which involved locating the "ntp" section, and setting the "enable_server" option to '1'. Next, commit the change using "uci commit system". Finally, restart the NTP service using the command "/etc/init.d/sysntpd restart" to apply the changes. Once I did this, the phone picked up the correct date/time in short order.  Unfortunately, I have to redo these steps every time I boot the node.  As a workaround, I added the "-l" flag after the "-n -N" flags in /etc/init.d/sysntpd.  I don't like this, but at least it gets to a stopping point until I can look into it further.
KY4G
Trying to make the change persistent...
Making this change persistent has been a challenge.  I manipulated the copy of the file /overlay/upper/etc/config/system; however, it did no good.  Apparently, that file gets overwritten by /rom/etc/config/system.  So I'm back defeating the original sysntpd script the way I did before.
 
nc8q
nc8q's picture
edit /usr/local/bin/start_ntp

edit /usr/local/bin/start_ntp.sh

#!/bin/sh
sed -i 's/option enable_server \'0\'/option enable_server \'1\'/' /etc/config/system
#check the above syntax
uci commit system
/etc/init.d/sysntpd restart

chmod +x /usr/local/bin/start_ntp.sh

Then you could ssh into the node and execute
/usr/local/bin/start_ntp.sh

or add those commands to /etc/rc.local and reboot
or something like that.
You may want to get the script commands into non-volatile memory.

73, Chuck

 

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer