Skip to main content
yoann LBY
Senior
March 26, 2018
Question

NTP question on SPWF04Sx

  • March 26, 2018
  • 1 reply
  • 696 views
Posted on March 26, 2018 at 08:26

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

    This topic has been closed for replies.

    1 reply

    Elio Cometti
    Visitor II
    March 26, 2018
    Posted on March 26, 2018 at 15:45

    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