gmag11 / EnigmaIOT

Secure sensor and gateway platform based on ESP8266 and ESP32
https://gmag11.github.io/EnigmaIOT
MIT License
240 stars 46 forks source link

ESP32 WiFi won't connect #33

Closed GeoffreyMills closed 3 years ago

GeoffreyMills commented 3 years ago

ESP32 - Tried EnigmaIOT Gateway and EnigmaIOTMQTT. Keyed WiFI data into WiFiManager (192.168.4.1) OK but ESP32 (Sparkfun Thing, WeMos Lolin32) won't connect!. So I ran up the basic examples of ESPAsyncWiFiManager for both the alanswx and tzapu releases in Github and they both worked. The "alanswx" release was updated 2 days ago with WiFi disconnect changes.

ESPAsyncWiFiManager.cpp -> int AsyncWiFiManager::connectWifi(String ssid, String pass) L580, L595 Changed "WiFi.disconnect(false); -> "WiFi.enableSTA(false)" and it started working. Cannot find the source of "WiFi.enableSTA(false)" , was looking in WiFiManager issues for tzapu and alanswx. Tested instead with "WiFi.disconnect(true,true)" - working. Reference: https://github.com/tzapu/WiFiManager/issues/591 FYI Using latest ESPAyncWiFiManager v0.25, ESP 1.0.6

https://github.com/espressif/arduino-esp32/issues/4980 Of concern but could not see where global timeout is stored? https://github.com/espressif/arduino-esp32/issues/3522 disconnect(true) seems to permanently close WiFi #3522 (what I was seeing)

FWIW Found the HOWTO.md notes late in the day, specifically ..ESPAsyncWiFiManager -- https://github.com/gmag11/ESPAsyncWiFiManager forked... But the gmag11 version did not change the issue with not connecting, still needed changes above. Found the ESPAsyncWiFiManager confusing because "alanswx" source is very much ESP8266 only now

Also hit the Issue #18. looks like setting DEBUG to WARN and speed to 115200 has solved that. Got MQTT messages from the node showing in Mosquitto now :)

Geoffrey

GeoffreyMills commented 3 years ago

I downloaded this code on 9/7 and had WiFi issues as described above (plus ESP32 will not send error 12393 ) but you posted a fix for this in April (ESP-NOW) I just compared the src code on Github today versus what I have and my "espnow_hal.cpp" is old: I am not using the latest code. Well, I wanted to learn stuff and I did locate the source of the problem... Issue #33 fixed in April, not a bug