http server refuses connection
Posted: Wed Apr 26, 2023 8:48 pm
When I'm running my ESP32-S2 in Access Point (AP) mode with a fixed IP and the ESP IDF http server running, I am able to connect to the server (port 80). However, I made the application such that I can change to station mode (STA), stop the http server, restart the wifi and start the server again. After this, I'm unable to connect to the http server anymore.
When tracking the communication in Wireshark, I see that my PC is trying to establish the connection to ESP32, but it sends a RST, ACK flag in the TCP protocol, meaning the ESP32 is actively refusing the connection. When going back to AP mode (without resetting the device), it stays refusing the connection. After powering toggling or resetting the ESP32, I'm able to connect to ESP32 again in AP mode.
I checked my router to see if it blocks connections between devices, but running a local http server on my pc is accesible from my phone without problems, so this doesn't seem the issue. I think somewhere in the ESP32 software something is going wrong, but I cannot figure out what.
What am I doing wrong? Or what can I check?
When tracking the communication in Wireshark, I see that my PC is trying to establish the connection to ESP32, but it sends a RST, ACK flag in the TCP protocol, meaning the ESP32 is actively refusing the connection. When going back to AP mode (without resetting the device), it stays refusing the connection. After powering toggling or resetting the ESP32, I'm able to connect to ESP32 again in AP mode.
I checked my router to see if it blocks connections between devices, but running a local http server on my pc is accesible from my phone without problems, so this doesn't seem the issue. I think somewhere in the ESP32 software something is going wrong, but I cannot figure out what.
What am I doing wrong? Or what can I check?