I'm trying to set a slave pi to let get time from master pi using ntp service. The master pi has been set to be a hotspot (which is not connected to the internet) and the slave pi connect to it via wifi. The master pi has its own time and it is an ntp server. Now I can use windows to synchronize the time from the master pi, but when it comes to the slave pi, it doesn't work as I expect, the ntp.conf
must have something wrong. So how could I configure the ntp.conf
file to let the slave pi get the time from the master pi?
Updated:
I added a line "server 192.168.42.1 prefer" (which is the master pi's IP address) in the ntp.conf
, and add # to the line "server 0 debian.pool.ntp.org ibrust" in the slave pi. Then every time slave pi is rebooted, it synchronized, with the master pi's. But if I set another time (like sudo date -s 2016/2/2) in the slave pi after it is rebooted, the time of the slave pi will not synchronize with the master one, and it will keep the time I set. What should I configure to make sure that the slave pi will synchronize with the master pi once in a while, and correct its time? Thanks!