Hello, I have a problem with a LILYGO TTGO LoRa V2.1 board with the latest firmware (v1.5.0). The installation goes without problems and after completing the initial configuration (wifi and mqtt settings) everything works perfectly. The problem start when a reboot occurs, the board can no longer connect to the wifi network and so it switch to AP mode.
Logs of first boot and parameter setting, everything seems ok.
************* WELCOME TO OpenMQTTGateway **************
N: SSD1306 config initialised
[ 138][E][Preferences.cpp:483] getString(): nvs_get_str len fail: SSD1306Config NOT_FOUND
N: No SSD1306 config to load
N: Setup SSD1306 Display end
N: OpenMQTTGateway Version: v1.5.0
*wm:[2] Added Parameter: server
*wm:[2] Added Parameter: port
*wm:[2] Added Parameter: user
*wm:[2] Added Parameter: pass
*wm:[2] Added Parameter: secure
*wm:[2] Added Parameter: cert
*wm:[2] Added Parameter: name
*wm:[2] Added Parameter: topic
*wm:[2] Added Parameter: ota
N: Attempting Wifi connection with saved AP: 0
[ 1348][E][WiFiSTA.cpp:317] begin(): connect failed! 0x300a
N: Attempting Wifi connection with saved AP: 1
[ 2356][E][WiFiSTA.cpp:317] begin(): connect failed! 0x300a
N: Attempting Wifi connection with saved AP: 2
[ 3363][E][WiFiSTA.cpp:317] begin(): connect failed! 0x300a
N: Attempting Wifi connection with saved AP: 3
[ 4369][E][WiFiSTA.cpp:317] begin(): connect failed! 0x300a
N: Attempting Wifi connection with saved AP: 4
[ 5376][E][WiFiSTA.cpp:317] begin(): connect failed! 0x300a
N: Connect your phone to WIFI AP: OpenMQTTGateway_lilygo_rtl_433_ESP with PWD: your_password
*wm:[1] AutoConnect
*wm:[2] ESP32 event handler enabled
*wm:[2] Connecting as wifi client...
*wm:[2] setSTAConfig static ip not set, skipping
*wm:[1] No wifi saved, skipping
*wm:[2] Connection result: WL_NO_SSID_AVAIL
*wm:[1] AutoConnect: FAILED
*wm:[2] Starting Config Portal
*wm:[2] AccessPoint set password is VALID
*wm:[2] Disabling STA
*wm:[2] Enabling AP
*wm:[1] StartAP with SSID: OpenMQTTGateway_lilygo_rtl_433_ESP
*wm:[1] AP IP address: 192.168.4.1
*wm:[1] Starting Web Portal
*wm:[2] HTTP server started
*wm:[2] WiFi Scan ASYNC started
*wm:[2] Config Portal Running, blocking, waiting for clients...
*wm:[2] Portal Timeout In 120 seconds
*wm:[2] WiFi Scan ASYNC completed in 7249 ms
*wm:[2] WiFi Scan ASYNC found: 28
*wm:[2] Portal Timeout In 98 seconds
[ 31189][E][WebServer.cpp:649] _handleRequest(): request handler not found
*wm:[2] <- Request redirected to captive portal
*wm:[2] <- HTTP Root
*wm:[2] Scan is cached 14443 ms ago
[ 31701][E][WebServer.cpp:649] _handleRequest(): request handler not found
*wm:[2] <- Request redirected to captive portal
*wm:[2] <- HTTP Root
*wm:[2] Scan is cached 14952 ms ago
[ 31760][E][WebServer.cpp:649] _handleRequest(): request handler not found
*wm:[2] <- Request redirected to captive portal
*wm:[2] <- HTTP Root
*wm:[2] Scan is cached 15010 ms ago
*wm:[2] <- HTTP Wifi
*wm:[2] Scan is cached 17940 ms ago
*wm:[1] 28 networks found
*wm:[2] DUP AP: ****SSID****
*wm:[2] DUP AP: ****SSID****
*wm:[2] AP: -25 ****MY-SSID****
.
.
.
[ 34871][E][WebServer.cpp:649] _handleRequest(): request handler not found
*wm:[2] <- Request redirected to captive portal
*wm:[2] <- HTTP Root
*wm:[2] Scan is cached 18152 ms ago
*wm:[2] Portal Timeout In 94 seconds
*wm:[2] <- HTTP WiFi save
*wm:[2] Parameters
*wm:[2] --------------------
*wm:[2] server: 192.168.1.10
*wm:[2] port: 1883
*wm:[2] user: ********
*wm:[2] pass: ********
*wm:[2] secure:
*wm:[2] cert:
*wm:[2] name: Gateway_433
*wm:[2] topic: OpenMQTT/
*wm:[2] ota: OTAPASSWORD
*wm:[2] --------------------
*wm:[2] processing save
*wm:[2] Connecting as wifi client...
*wm:[2] setSTAConfig static ip not set, skipping
*wm:[1] Connecting to NEW AP: ****MY-SSID****
*wm:[1] connectTimeout not set, ESP waitForConnectResult...
*wm:[2] Connection result: WL_CONNECTED
*wm:[1] Connect to new AP [SUCCESS]
*wm:[1] Got IP Address:
*wm:[1] 192.168.1.100
*wm:[2] [CB] _savewificallback calling
*wm:[2] shutdownConfigPortal
[ 77845][E][WebServer.cpp:649] _handleRequest(): request handler not found
*wm:[2] <- Request redirected to captive portal
*wm:[2] restoring usermode STA
*wm:[2] wifi status: WL_CONNECTED
*wm:[2] wifi mode: STA
*wm:[2] configportal closed
*wm:[1] config portal exiting
{
"mqtt_server": "192.168.1.10",
"mqtt_port": "1883",
"mqtt_user": "********",
"mqtt_pass": "********",
"mqtt_topic": "OpenMQTT/",
"gateway_name": "Gateway_433",
"mqtt_broker_secure": false,
"mqtt_broker_cert": "",
"mqtt_ss_index": 0,
"ota_server_cert": "",
"ota_pass": "OTAPASSWORD"
}
N: ZgatewayRTL_433 setup done
N: Switching to RTL_433 Receiver: 433.92Mhz
N: OpenMQTTGateway modules: ["LilyGo_SSD1306","rtl_433"]
N: ************** Setup OpenMQTTGateway end **************
W: MQTT connection...
W: failure_number_mqtt: 1
W: failed, rc=-2
W: MQTT connection...
N: Connected to broker
Logs after reboot, the board is unable to connect with stored credentials and switch to AP mode.
************* WELCOME TO OpenMQTTGateway **************
N: SSD1306 config initialised
[ 138][E][Preferences.cpp:483] getString(): nvs_get_str len fail: SSD1306Config NOT_FOUND
N: No SSD1306 config to load
N: Setup SSD1306 Display end
N: OpenMQTTGateway Version: v1.5.0
{
"mqtt_server": "192.168.1.10",
"mqtt_port": "1883",
"mqtt_user": "********",
"mqtt_pass": "********",
"mqtt_topic": "OpenMQTT/",
"gateway_name": "Gateway_433",
"mqtt_broker_secure": false,
"mqtt_broker_cert": "",
"mqtt_ss_index": 0,
"ota_server_cert": "",
"ota_pass": "OTAPASSWORD"
}
*wm:[2] Added Parameter: server
*wm:[2] Added Parameter: port
*wm:[2] Added Parameter: user
*wm:[2] Added Parameter: pass
*wm:[2] Added Parameter: secure
*wm:[2] Added Parameter: cert
*wm:[2] Added Parameter: name
*wm:[2] Added Parameter: topic
*wm:[2] Added Parameter: ota
N: Attempting Wifi connection with saved AP: 0
N: Attempting Wifi connection with saved AP: 1
N: Attempting Wifi connection with saved AP: 2
E (7155) wifi:sta is connecting, return error
[ 3398][E][WiFiSTA.cpp:317] begin(): connect failed! 0x3007
N: Attempting Wifi connection with saved AP: 3
E (8166) wifi:sta is connecting, return error
[ 4409][E][WiFiSTA.cpp:317] begin(): connect failed! 0x3007
N: Attempting Wifi connection with saved AP: 4
N: Connect your phone to WIFI AP: OpenMQTTGateway_lilygo_rtl_433_ESP with PWD: your_password
*wm:[1] AutoConnect
*wm:[2] ESP32 event handler enabled
*wm:[2] Connecting as wifi client...
*wm:[2] setSTAConfig static ip not set, skipping
*wm:[1] Connecting to SAVED AP: ****MY-SSID****
*wm:[0] [ERROR] wifi begin failed
*wm:[2] 5000 ms timeout, waiting for connect...
*wm:[2] .
.
.
.
*wm:[2] .
*wm:[2] Connection result: WL_IDLE_STATUS
*wm:[1] AutoConnect: FAILED
*wm:[2] Starting Config Portal
*wm:[2] AccessPoint set password is VALID
*wm:[2] Disabling STA
*wm:[2] Enabling AP
*wm:[1] StartAP with SSID: OpenMQTTGateway_lilygo_rtl_433_ESP
*wm:[2] [EVENT] WIFI_REASON: 8
*wm:[1] AP IP address: 192.168.4.1
*wm:[1] Starting Web Portal
*wm:[2] HTTP server started
*wm:[2] WiFi Scan ASYNC started
*wm:[2] Config Portal Running, blocking, waiting for clients...
*wm:[2] Portal Timeout In 120 seconds
I tried erase the flash memory with both https://espressif.github.io/esptool-js/ and ESPTool.py but it didn’t solve.
Hope someone can give me some suggestions.
Thank you