Min

UPDATED ON

Step-by-Step Guide to Configure and Troubleshoot NTP on Linux-based Seismic Data Loggers by QuakeLogic


1. SSH into Your OpenWrt Device

Open a terminal and SSH into your OpenWrt device:

ssh root@<your_openwrt_device_ip>

2. Verify NTP Configuration

Check the current NTP configuration:

uci show | grep ntp

3. Add NTP Servers to UCI Configuration

Add the NTP servers to the UCI system configuration:

uci add_list system.ntp.server='0.lede.pool.ntp.org'
uci add_list system.ntp.server='1.lede.pool.ntp.org'
uci add_list system.ntp.server='2.lede.pool.ntp.org'
uci add_list system.ntp.server='3.lede.pool.ntp.org'

4. Commit the Changes

Apply the changes to the configuration:

uci commit system

5. Restart the NTP Service

Restart the NTP service to apply the new configuration:

/etc/init.d/sysntpd restart

6. Verify Time Synchronization

Check the current date and time settings to ensure synchronization is working:

date

7. Ensure NTP Service Starts on Boot

Enable the NTP service to start on boot:

/etc/init.d/sysntpd enable

By following these steps, your OpenWrt device will be configured to use the specified NTP servers, and the system time will be synchronized correctly.


Manually Sync Time with an NTP Server

1. SSH into Your OpenWrt Device

Open a terminal and SSH into your OpenWrt device:

ssh root@<your_openwrt_device_ip>

2. Stop the NTP Service

Stop the NTP service to avoid conflicts:

/etc/init.d/sysntpd stop

3. Manually Sync Time with an NTP Server

Use the ntpd command to manually sync the time with an NTP server:

ntpd -q -p 0.lede.pool.ntp.org

The -q option tells ntpd to set the time and quit, and the -p option specifies the NTP server.

4. Start the NTP Service Again

Start the NTP service to resume automatic synchronization:

/etc/init.d/sysntpd start

5. Verify Time Synchronization

Check the current date and time to ensure it has been updated correctly:

date

By following these steps, you can manually sync the time on your OpenWrt device with a specific NTP server.


Troubleshooting “ntpd: bad address ‘0.lede.pool.ntp.org'”

1. Check DNS Configuration

Ensure your OpenWrt device can resolve domain names correctly:

ping google.com

If this fails, you might need to configure your DNS settings manually in the /etc/config/network file:

uci set network.wan.dns='8.8.8.8 8.8.4.4'
uci commit network
/etc/init.d/network restart

2. Verify NTP Package Installation

Ensure that the ntpd package is installed:

opkg update
opkg install ntpd

3. Manually Sync Time Using ntpd with IP Address

If DNS issues persist, use the IP address of the NTP server instead of the hostname:

ntpd -q -p 162.159.200.123

4. Ensure NTP Servers Are Correctly Configured in UCI

Check and reconfigure the NTP servers if necessary:

uci show system.ntp
uci delete system.ntp.server
uci add_list system.ntp.server='0.lede.pool.ntp.org'
uci add_list system.ntp.server='1.lede.pool.ntp.org'
uci add_list system.ntp.server='2.lede.pool.ntp.org'
uci add_list system.ntp.server='3.lede.pool.ntp.org'
uci commit system

5. Restart the NTP Service

Restart the NTP service to apply the changes:

/etc/init.d/sysntpd restart

By following these steps, you should be able to resolve the “ntpd: bad address ‘0.lede.pool.ntp.org'” error and ensure your OpenWrt device can correctly sync time with the NTP servers.


By following these organized steps, you should be able to configure, manually sync, and troubleshoot NTP settings on your OpenWrt device effectively.

For questions, reach us at support@quakelogic.net. Our working hours are 8 AM to 5 PM Pacific Time (M-F).


Discover more from QuakeLogic

Subscribe to get the latest posts sent to your email.

Author

Discover more from QuakeLogic

Subscribe now to keep reading and get access to the full archive.

Continue reading