Setting hardware clock in MP01 with SECN2.0

25 views
Skip to first unread message

Carlos Rey-Moreno

unread,
Apr 16, 2015, 2:26:15 PM4/16/15
to village-telco-dev
Good evening,

I've set up a time server so all the MPs in the network can synchronize in the absence of an Internet connection. The synchronization works fine but it takes considerable time after an MP boots (up to 10 minutes).

I'd like to create a crontab that periodically sets the current time to the hardware clock, so when the it boots ntp does not need to sychronize from 1s Jan 2014, but from the last time that was saved in the hardware clock. I've read that this is done with the following command "hwclock -w" but as you can see from the output, it does not work. Any pointer about how to do this?

root@MP-20:~# hwclock -w
hwclock: can't open '/dev/misc/rtc': No such file or directory

best,

carlos

--
Carlos Rey-Moreno
Research Assistant
Office 1.28
Department of Computer Science
University of the Western Cape
Private Bag X17 - Bellville, 7535
Cape Town - South Africa
Tel: +27 (0) 21 959 2562 Cel: +27 (0) 76 986 3633
Skype: carlos.reymoreno Twitter: Creym

T Gillett

unread,
Apr 16, 2015, 6:30:00 PM4/16/15
to village-telco-dev
Hi Carlos

To my best knowledge the MP1 does not have a hardware real time clock so you can't set it.

However I don't understand why your NTP is taking so long to synchronise.

As you can see from the logread output below, the NTP sync typically happens during the startup cycle, in this case at about the 40 second mark.

This is a best case example though.
The device that this test was run on is a gateway device so it has an upstream connection on its WAN port, so it does not have to wait for the mesh to be established in order to get upstream access.

I ran another test with a MP2 device connected via mesh to the gateway.
It takes two minutes from rebooting till the device responded to a ping across the mesh. By the time I was able to log in to the device and check the date from the command line, it was already set correctly. (There were no entries in the log to show the time after the init sequence was complete.)

So it may be worth looking into what is happening with your NTP sync to try to figure out why it is taking so long. It should happen very shortly after the device establishes connectivity across the mesh.

Regards
Terry


Gateway Device test
------------------------------
Wed Jan  1 00:00:25 2014 kern.info kernel: [   40.100000] br-lan: port 3(bat0) entered forwarding state
Wed Jan  1 00:00:25 2014 user.emerg syslog: + uci get secn.accesspoint.ap_isol
Wed Jan  1 00:00:25 2014 user.emerg syslog: + AP_ISOL=0
Wed Jan  1 00:00:25 2014 user.emerg syslog: + [ 0 = 1 ]
Wed Jan  1 00:00:25 2014 user.emerg syslog: + batctl ap 0
Wed Jan  1 00:00:25 2014 user.emerg syslog: - init complete -
Fri Apr 17 08:00:24 2015 kern.info kernel: [   42.100000] br-lan: port 3(bat0) entered forwarding state
Fri Apr 17 08:00:27 2015 kern.warn kernel: [   44.960000] br-lan: received packet on bat0 with own address as source address


Mesh device test
-------------------------




--
You received this message because you are subscribed to the Google Groups "Village Telco Development Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to village-telco-...@googlegroups.com.
To post to this group, send email to village-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/village-telco-dev/CAPkwMUfVPC%3DQ1he3DCGX3dZgWR9qanZ8dF%2B4%3DSsf1emKV5BZJA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages