ESP32 Wifi not working though Wifi Extender
Posted: Thu Mar 11, 2021 11:14 am
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.
The problem is when I connect the ESP32 to a WiFi extender. It fails to POST the data successfully to the server. I can connect through the extender with my phone (and POST via the pone) 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.
I have tried manually setting the Gateway to 192.168.10.1 with a subnet mask of 255.255.255.0 but this made no difference.
Code on the ESP BTW is written in C++ on PlaformIO using Arduino framework.
Any suggestions?
Thanks
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.
The problem is when I connect the ESP32 to a WiFi extender. It fails to POST the data successfully to the server. I can connect through the extender with my phone (and POST via the pone) 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.
- [D][WiFiGeneric.cpp:374] _eventCallback(): Event: 0 - WIFI_READY
- [D][WiFiGeneric.cpp:374] _eventCallback(): Event: 2 - STA_START
- Connecting to WiFi…
- [D][WiFiGeneric.cpp:374] _eventCallback(): Event: 7 - STA_GOT_IP
- [D][WiFiGeneric.cpp:419] _eventCallback(): STA IP: 192.168.10.100, MASK: 192.168.10.1, GW: 192.168.0.1
- [D][WiFiGeneric.cpp:374] _eventCallback(): Event: 7 - STA_GOT_IP
- [D][WiFiGeneric.cpp:419] _eventCallback(): STA IP: 192.168.10.100, MASK: 192.168.10.1, GW: 192.168.0.1
- Connected, IP address: 192.168.10.100
- POSTING to http://192.168.0.23:5555/api/record : “temperature” : 16.25, “humidity” : 52.04, “temperature2” : 16.70, “pressure” : 1009.39
- [V][HTTPClient.cpp:239] beginInternal(): url: http://192.168.0.23:5555/api/record
- [D][HTTPClient.cpp:287] beginInternal(): host: 192.168.0.23 port: 5555 url: /api/record
- POSTing…[D][HTTPClient.cpp:573] sendRequest(): request type: ‘POST’ redirCount: 0
- [E][WiFiClient.cpp:258] connect(): socket error on fd 54, errno: 113, “Software caused connection abort”
- [D][HTTPClient.cpp:1112] connect(): failed connect to 192.168.0.23:5555
- [W][HTTPClient.cpp:1411] returnError(): error(-1): connection refused
- POST FAILED to http://192.168.0.23:5555/api/record
- connection refused
- [D][HTTPClient.cpp:394] disconnect(): tcp is closed
Code on the ESP BTW is written in C++ on PlaformIO using Arduino framework.
Any suggestions?
Thanks