-->
Page 1 of 1

Platform.IO support for networking and ESP-01 broken?

PostPosted: Mon Mar 15, 2021 8:49 am
by markse
I’ve been working on a little project to monitor a switch and push out MQTT messages on state changes or a heartbeat when a timer expires. The code would work for anything from 30 seconds to 5 mins before dying. That aside, the 3-way TCP/IP handshake would work and packets get out.
Platform.IO updated itself. Now the code compiles okay, yet the ESP-01 can’t talk to anything. It connects to WiFi, gets an IP, but things fail as there’s a SYN, SYN-ACK from the server, but no ACK from the ESP. The code logs a fail, waits and tries again. Rinse and repeat. Anyone else using Platform.IO and seeing this?

Re: Platform.IO support for networking and ESP-01 broken?

PostPosted: Tue Mar 16, 2021 3:08 am
by markse
Developments....

I power cycled my WiFi access point and everything sprang into life. I could get four switch transition MQTT messages out or three heartbeat messages, then it would fail again. When it fails, tcpdump shows the SYN and SYN-ACK, the ACK to finish the 3-way handshake is again missing. If I reset the ESP-01 it would work again for the same short duration.

This morning I added 1 more debug line in the void loop() block, printing to the serial port:

Serial.print(client.connected());

This extra line has made a HUGE difference. The code now runs for ages. I’ve had it running for 15+ minutes, it sending the “HEARTBEAT” message if I don’t touch the switch, “LOW” or “HIGH” if I do.

Does adding the client.connected() make sense??