cancel
Showing results for 
Search instead for 
Did you mean: 

NTP request problem on SPWF04

DUrbano
Associate III
Posted on January 24, 2018 at 14:43

Hi,

I'm working on SPWF04 linked by UART with a NUCLEO F411RE board; I'm facing with a strange problem: I'm trying to connect with an NTP server to synchronize the NUCLEO RTC, so after create a wifi connection, I open the socket, send the data, but the server not answer even if the request going well. This is what I send and what I receive:

TX:  AT+S.SOCKON=193.204.114.105,123,,u

RX: AT-S.On:193.204.114.105:0

RX: AT-S.OK

TX: AT+S.SOCKW=0,48<CR><ESC><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL><NUL>

RX: AT-S.OK

but after if I try to check any answer, I read:

TX: AT+S.SOCKQ=0

RX: AT-S.Query:0

RX: AT-S.OK

Please, could anyone tell me what's wrong ? Where's the problem ?

Regards

Davide Urbano

#spwf04 #ntp
22 REPLIES 22
Posted on January 24, 2018 at 15:44

Build you own port 123 listener on the network and confirm you can receive packets.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
DUrbano
Associate III
Posted on January 24, 2018 at 15:46

Please, could you tell me how ?

DUrbano
Associate III
Posted on January 24, 2018 at 16:02

NTP server is a public server (ntp.inrim.it) but I can see the ping to this server going well...is really really strange...I tested the server from my PC and is up and working well.

Posted on January 24, 2018 at 16:27

Can you see the NTP packets (UDP 123) from the board. I guess you can sniff them in the middle.

We need to know if the NTP packets from the boards are seen in the network.

DUrbano
Associate III
Posted on January 24, 2018 at 16:44

Ping to the NTP server going well...now install Wireshark and check the packets...

Posted on January 24, 2018 at 15:55

Is the NTP server connected through the LAN port to the network  - try to sniff the traffic (if linux - try tcp dump ) to see if the NTP request reaches the server.

The WiFi side: can you ping the NTP server  - just to check the routing.

Can other device (real host connect to this time server) - just to verify that the NTP service is up and working.

Sniffing is the best way to follow OR look at the NTP Server logs to see if the NTP Client was able to reach the Server.

Posted on January 24, 2018 at 15:59

Wireshark is recommended if you do not use tcpdump.

Sorry I wasn't not able to edit the post.

Posted on January 24, 2018 at 16:31

Is the ping going well from the SPWF04 too?

I have just done the following:

AT+S.PING=,,193.204.114.105

AT-S.Start:193.204.114.105

AT-S.Reply:56:52

AT-S.Stop:0:52

AT-S.OK

AT+S.SOCKON=193.204.114.105,123,,u

AT-S.On:193.204.114.105:0

AT-S.OK

AT+S.SOCKW=0,48<CR><ESC><NULL>.......

AT-S.OK

+WIND:55:Pending Data::0:48:48

Posted on January 24, 2018 at 16:34

Great idea to verify ping to check the routing. Also we want to see if the NTP packets are leaving the box since we have no response (it does not have to be the server if the packets do not leave the box)