-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sending UDP message stops working after > 2 minute of inactivity #1237
Comments
try to make
into setup() ... does this change anything? |
ah and of course remove |
No, that doesn't work. I don't get any message? Not even from the start? |
on further inspection I see that you create 2 UDP objects on the same port (9750). this does not make sense. get rid of the udpServer and just use the udpListener object to send your packet as well. |
Ok, I deleted the second one. I only have 1 now and it works UNTIL I wait some minutes and the sending fails. (The "OK" stops coming in Packet Sender). Global, .stop() or not, ... I tried everything. Nothing helps, it stops if I don't send anything for several minutes. Strangly, receiving keeps working (can been seen on Serial Monitor). |
Sounds like it could be a memory leak, and your debugMsg stuff seems like a source of leaks. Try this instead:
I'd also stick a serial.print in there when you have a successful sent packet just to make sure it isn't getting lost in the network. |
Hi all, After further research I also found some strange UDP issues that was solved by changing the board from SparkFun to something else. |
@korstiaanS My esp32 is very orientation sensitive, Try printing the RSSI value( At -85 dBm my communications are unreliable. Chuck. |
I know, I already tested. But still, the ESP32 Thing has better reception. |
On the DoIT on the company wifi I noticed also something; If I click a lot on the button in Packet Sender (sending a lot of data) suddenly the module stop responding with "OK" and I see at the same time that he does not respond to a ping anymore. Also, I still on the serial monitor that the udp string is still coming in? So, at the time the sending (and only the sending) stops the answer to a ping also stops. The receiving still works. That behaviour I didn't see at my home network. This is a problem of the company wifi network. |
Tried on a company Cisco network; After every reboot of the ESP the "pings" from a PC to the ESP works for 50 sec. After approx. 50 sec. the timeout on the pings start and does not come back until I reboot. I do nothing else. I already tried esp_wifi_set_ps(WIFI_PS_NONE) but no help. Is this a DTIM / beacon interval problem? |
Hi all, After further investigation we found the reason: By further investigations and packet captures we have encountered the root cause of the connectivity issue. In normal condition we see by packet capture that the ESP32 module is using the correct IP and correct MAC address of it’s default gateway. Every 60 seconds the ESP32 module receives an IGMP general membership query from the IGMP querier in it’s subnet. (in our case this IGMP querier is our Cisco core switch). In our specific setup we have disabled the IGMP querier functionality for the specific VLAN/IP subnet on the Cisco core switch to solve this encountered issue. Why the ESP32 have problems and the ESP8266 not is for me not clear. |
Have you found out any solution to this problem? I am having the same issue currently. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
Did you achieve any progress with the problem? I'm having same issue. |
I am having the same issue with the esp32 not receiving udp message after some time. If anybody has the solution please reply. |
Guys, I have the same issue, but I fix it by adding a delay(100); after the udp.endPacket(); |
----------------------------- Remove above -----------------------------
Hardware:
Board: ESP32 Thing Sparkfun
Core Installation/update date: 17/mar/2018
IDE name: Arduino IDE
Flash Frequency: 40Mhz
Upload Speed: 115200
Description:
Sending of UDP packages stops working after > 1 minute of inactivity
Sketch:
Debug Messages:
To test:
Fill in SSID and password.
After reboot send UDP packet to the correct IP of the ESP (can see this in Serial monitor) to port 9750.
Make sure that the UDP listener is active on the Packet Sender (port 9750).
Shortly after the reboot, the packet is received on the ESP and it sends an "OK" back to the Packet sender. This works every time. (Can be seen on Packet Sender)
Then wait 1 minute.
Try again, send a message to ESP.
Message is received on ESP.(check this via serial console).
NO MESSAGE arrives at Packet Sender. It only will work again after a reboot.
Conclusion?; UDP sending stops working after 1 minute (or more) of inactivity?
The text was updated successfully, but these errors were encountered: