the_ntp_functions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
the_ntp_functions [2017/03/17 18:34] – [Edit NTP Configuration File] walkeradmin | the_ntp_functions [2023/03/09 22:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 135: | Line 135: | ||
\\ | \\ | ||
+ | ---- | ||
+ | ==== Restart NTP ==== | ||
+ | \\ | ||
+ | To get the Raspberry Pi to sync, we can restart the NTP service. Use the following to restart the NTP server. | ||
+ | \\ | ||
+ | sudo service ntp restart | ||
+ | \\ | ||
+ | \\ | ||
+ | Now check the current time and date using the <color # | ||
+ | \\ | ||
+ | date | ||
+ | | ||
+ | Fri 17 Mar 18:38:59 UTC 2017 | ||
+ | \\ | ||
+ | If the time and date are correct, then you are good to go. | ||
+ | \\ | ||
+ | \\ | ||
+ | ---- | ||
+ | ==== Check NTP Servers ==== | ||
+ | \\ | ||
+ | You can test to see if NTP on the Raspberry Pi is actually using any external time servers by using the <color # | ||
+ | \\ | ||
+ | < | ||
+ | ntpq -pn | ||
+ | | ||
+ | ============================================================================== | ||
+ | *130.159.196.118 193.62.22.90 | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | \\ | ||
+ | After running the command <color # | ||
+ | \\ | ||
+ | \\ | ||
+ | ---- | ||
+ | ==== Synchronising Clients ==== | ||
+ | \\ | ||
+ | ** LINUX ** | ||
+ | \\ | ||
+ | \\ | ||
+ | Synchronising <color # | ||
+ | \\ | ||
+ | \\ | ||
+ | ** WINDOWS ** | ||
+ | \\ | ||
+ | \\ | ||
+ | For <color # | ||
+ | \\ | ||
+ | \\ | ||
+ | {{: | ||
+ | \\ | ||
+ | \\ | ||
+ | Select ' | ||
+ | \\ | ||
+ | \\ | ||
+ | When the next page opens, scroll down. | ||
+ | \\ | ||
+ | \\ | ||
+ | {{: | ||
+ | \\ | ||
+ | \\ | ||
+ | Select ' | ||
+ | \\ | ||
+ | \\ | ||
+ | When the next page opens. | ||
+ | \\ | ||
+ | \\ | ||
+ | {{: | ||
+ | \\ | ||
+ | \\ | ||
+ | Select 'Set the time and date' | ||
+ | \\ | ||
+ | \\ | ||
+ | On the next page. | ||
+ | \\ | ||
+ | \\ | ||
+ | {{: | ||
+ | \\ | ||
+ | \\ | ||
+ | Select the ' | ||
+ | \\ | ||
+ | \\ | ||
+ | On the next page. | ||
+ | \\ | ||
+ | \\ | ||
+ | {{: | ||
+ | \\ | ||
+ | \\ | ||
+ | Select the Change Settings button. | ||
+ | \\ | ||
+ | \\ | ||
+ | On the next page we will see a box that contains <color # | ||
+ | \\ | ||
+ | \\ | ||
+ | {{: | ||
+ | \\ | ||
+ | \\ | ||
+ | Change the contents of this box to the IP Address of the Raspberry Pi running the NTP server. | ||
+ | \\ | ||
+ | \\ | ||
+ | Finally, Click the <color # | ||
+ | \\ | ||
+ | \\ | ||
+ | {{: | ||
+ | \\ | ||
+ | \\ | ||
+ | The time should now be updated, you will see confirmation in this page (I have to do this twice sometimes) | ||
+ | \\ | ||
+ | \\ | ||
+ | That's it. | ||
+ | \\ | ||
+ | \\ | ||
+ | ---- | ||
+ | ==== Clients over 1000 Seconds out of time ==== | ||
+ | \\ | ||
+ | “NTP won’t normally reset the clock if it’s off by more than 1000s. If you run: | ||
+ | < | ||
+ | ntpd -gq’ | ||
+ | </ | ||
+ | It ignores the clock being way adrift from ntp time and will force it to be correct then close. The old ntpdate program does the same thing.” | ||
+ | \\ | ||
+ | \\ | ||
+ | Credit: [[http:// | ||
+ | \\ | ||
+ | \\ | ||
+ | ---- | ||
+ | ==== Raspberry Pi Dropping of Wireless Network ==== | ||
+ | I found my raspberry Pi Zero, that is using the official Raspberry Pi Wireless Dongle drops off the wireless network after around a week. Only a reboot gets it back (as I have no keyb/mouse connected) so I figured just using Cron to reboot the thing every 24 hours will be a suitable work around. | ||
+ | \\ | ||
+ | \\ | ||
+ | To use cron (should already be installed): | ||
+ | \\ | ||
+ | \\ | ||
+ | sudo crontab -e (reboots require super user rights) | ||
+ | \\ | ||
+ | Insert the following line: | ||
+ | \\ | ||
+ | \\ | ||
+ | 0 0 | ||
+ | \\ | ||
+ | Explanation: | ||
+ | \\ | ||
+ | \\ | ||
+ | < | ||
+ | m h dom mon | ||
+ | minute hour dayOfMonth Month dayOfWeek commandToRun | ||
+ | so the line | ||
+ | 0 0 | ||
- | + | would reboot your system every day at 00:00. | |
- | + | </file> | |
- | + | \\ | |
- | + | Use Ctrl+X, Y, Enter. This will save and exit crontab (if using nano) | |
- | + | \\ | |
- | + | \\ | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | <sxh [txt][; options for SyntaxHighlighter]> | + | |
- | ============================================================================== | + | |
- | 129.250.35.250 | + | |
- | | + | |
- | | + | |
- | | + | |
- | pi@PiNTP:~ $ date +" | + | |
- | 2017-01-22T20: | + | |
- | pi@PiNTP:~ $ date | + | |
- | Sun 22 Jan 20:20:28 UTC 2017 | + | |
- | pi@PiNTP:~ $ ntpq -pn | + | |
- | | + | |
- | ============================================================================== | + | |
- | 129.250.35.250 | + | |
- | 109.74.206.120 | + | |
- | 46.101.52.119 | + | |
- | | + | |
- | pi@PiNTP:~ $ ntpq -pn | + | |
- | | + | |
- | ============================================================================== | + | |
- | *129.250.35.250 | + | |
- | -109.74.206.120 | + | |
- | +46.101.52.119 | + | |
- | +162.213.34.249 | + | |
- | </ | + | |
the_ntp_functions.txt · Last modified: 2023/03/09 22:35 by 127.0.0.1