2018-03-25 11:26 PM
hi,
wifi module spwf04sx (FW1.1.0) in STA mode, connected to PC with NTP server (with wifi).
variable ip_ntp_startup set to '1'. variable ip_use_dhcpc set to '1'.
To receive message +WIND:84 i should set variable ip_ntp_server1 to @ip PC !
NTP server (PC) specifies a list of IP adresses indicating NTP server availible to the client. (option activated)
Q: SPWF04Sx (client) should get from the list provided by the server? i shouldn't set ip_ntp_server1 !
Thks
Yoann
2018-03-26 06:45 AM
Hello Yoann,
as far as I understood, a secondary NTP server connect to one or more upstream servers to synchronize its local clock and can provide synchronization to dependent clients.
If you set up such a server on your PC then you can set the variable ip_ntp_server1 to the IP of your PC.
Could you tell more detail about your NTP server on the PC? (e.g. server implementation, )
In the past I set up an limifly python implementation of NTP server on my PC (see details
https://github.com/limifly/ntpserver/blob/master/ntpserver.py
).On SPWF04:
AT+S.SCFG=ip_ntp_server1,192.168.1.112
AT+S.WCFG
AT+S.RESET
...
+WIND:24:WiFi Up:0:192.168.1.119
+WIND:84......
On PC:
sudo python ./ntpserver.py
local socket: ('0.0.0.0', 123)
Received 1 packets
Sended to 192.168.1.119:123
Best Regards,
Elio