4

It looks like the ntpd doesn't get the correct time with WiFi. My Raspberry Pi's are connected via WiFi dongles (which work without problems) to my network. The odd thing is, I read that the time should be on "Jan 1, 1970" if it doesn't work correctly. But my time is always on "Jun 13, 2013"...

When I perform the command:

sudo dpkg-reconfigure ntp

or wait for a while it gets the right time. Maybe the ntpd starts before the WiFi has connected successfully? Can I change this in an easy way?

I found something similar, but it was for Arch Linux which doesn't help me.

Dominik
  • 350
  • 1
  • 4
  • 10

1 Answers1

3

You could add that command (sudo dpkg-reconfigure ntp) to the bottom of .bashrc. That way, every time you log in the time will be updated (assuming the WiFi device is connected to the Raspberry Pi and running properly).

  1. Make sure you are in the pi folder: $ cd ~
  2. Open up .bashrc for configuration: $ sudo nano .bashrc
  3. Scroll down to the bottom and add the line sudo dpkg-reconfigure ntp
  4. Exit and save: Ctrl+X, Y, Enter

If you are looking for a solution that works on bootup, take a look at this link. Basic rundown:

  1. Create a file for your startup "script": $ sudo nano /etc/init.d/scriptname
  2. Add the line sudo dpkg-reconfigure ntp to your file.
  3. Exit and save: Ctrl+X, Y, Enter
  4. Make the "script" executable: $ sudo chmod 755 /etc/init.d/scriptname
  5. Register script to be run at start-up: $ sudo update-rc.d scriptname defaults
syb0rg
  • 8,178
  • 4
  • 38
  • 51