Got an odd issue I hope someone has some advice on.
I have a server in the house running a Flask WebAPI which can accept POST’ed data. I also have a DFRobot FireBeetle ESP32 which deep sleeps, wakes, takes readings, connects to WIFI, POSTs the data to the server and goes back to sleep again. Fairly simple stuff.
When I connect the ESP32 into the same network as the server, everything works fine. The POSTs take milliseconds. However that WIFI network is not available where I want the sensor. I I have one of those external WIFI extenders which reaches where I want the sensor.
I can connect through the extender with my phone and that works fine, but the ESP32 will connect successfully to the WIFI network (and get a valid IP address on that network) but POSTs to the server fail. Sometimes with “read timed out” sometimes with “software caused connection to abort”. I tried manually setting the ip/gateway/default route etc but it made no difference. I tired changing the timeouts but it just takes longer to report the error.
Code on the ESP BTW is written in C++ on PlaformIO using Arduino style libs.
Indeed weird – I’d also expect the mask to be more 255.255.255.0 and also the gateway to be on the same subnet as the the IP that the station (STA) has gotten, but it’s on 192.168.0.x instead of 192.168.10.x… Maybe this is right though for that special WiFi extender case. Looking at GitHub - martin-ger/esp_wifi_repeater: A full functional WiFi Repeater (correctly: a WiFi NAT Router) though this seems to be very similiar in mask and gateway.
You can also cross-check what IP, subnet and GW you have when connecting via the phone (at least in Android I can see that very easily in the WiFi settings).
Still if your phone can do it and the ESP32 can not then there’s maybe a misconfiguration in the lower-level WiFi / TCP stacks of the framework that don’t allow for this WiFi extender scenario. You shuld ask directly at Issues · espressif/arduino-esp32 · GitHub for that.