cvanbrederode wrote on Thursday, July 11, 2019:
So I have a controller board up and running with FreeRTOS v10.0.1 and +TCP v2.0.1, and everything is working gangbusters (I have simple Telnet, TFTP, and ModBusTCP/UDP running).
Just today, I went to implement outgoing pings, as a testing feature during development. I have a setup similar to the example on the website, where the task sending the pings waits on a queue, that is notified by the ping reply callback.
Works great, except for one minor issue. The first ping never gets sent, and is reported as a timeout (after 500ms). As far as I can tell, the first call to FreeRTOS_SendPingRequest doesn’t actually send a ping (it never shows up in Wireshark), but it also does not return pdFAIL either.
Watching wireshark, the first time I run the ping command, which sends four pings, I only see three Echo request/repy pairs. The second (and further) times I run the command, I see four pairs. What I do see before the first echo request is an ARP packet “Who has?”, which gets a ARP response.
Although, if I call ping on an IP that is not present on the network, the echo requests are not sent. I also don’t see any ARP “Who has?”, but there’s a little part of me that thinks that may be how I’m running wireshark.
EDIT: I just did another test, where I have the PC connect over ModBusTCP before attempting the ping, so that the computer’s IP is in the ARP cache, and the first ping is sent normally then.
Is this normal behavior and I’m just missing something?