ntp and wifi

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

ntp and wifi

Postby Nico38 » Wed Jan 09, 2013 8:44 pm

Hi,

When booting RaspberryPi with an ethernet cable connected, date/time is intialised correctly.
My project uses wifi only. The problem with wifi is that date/time is not automatically setup correctly.
What do I have to do to get date/time initialised automatically when wifi is up ?

Nicolas
Nico38
 
Posts: 16
Joined: Mon Aug 06, 2012 8:44 pm
Location: Grenoble, France

Re: ntp and wifi

Postby pepedog » Wed Jan 09, 2013 8:56 pm

How are you starting wireless now?
Use netcfg and then ntp daemon has to wait for network to start
Hint, use an example from /etc/network.d/examples/ and put in /etc/network.d/, that filename goes where you see last in /etc/conf.d/netcfg
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: ntp and wifi

Postby Nico38 » Wed Jan 09, 2013 9:04 pm

I tried many solutions.

I currently use wicd. Perfect for wifi management.
I have added scripts in /etc/wicd/scripts/postconnect and /etc/wicd/scripts/predisconnect.
It seems that the scripts are executed, openntpd is run but date is not set. If I sart openntpd manually, date is set correctly.
Every solution I tried failed when automatically run but succeeded when manually run.

Nicolas
Nico38
 
Posts: 16
Joined: Mon Aug 06, 2012 8:44 pm
Location: Grenoble, France

Re: ntp and wifi

Postby pepedog » Wed Jan 09, 2013 9:07 pm

Maybe in postconnect add a sleep 10
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: ntp and wifi

Postby Nico38 » Wed Jan 09, 2013 9:22 pm

Tried with shorter delay without success.
10s seems ok.

Thanks

Nicolas
Nico38
 
Posts: 16
Joined: Mon Aug 06, 2012 8:44 pm
Location: Grenoble, France

Re: ntp and wifi

Postby pepedog » Wed Jan 09, 2013 10:19 pm

It's a shame to introduce such delays, but legs move quicker than body. To be reliable maybe 20s?
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 8 guests