khoih-prog / ESP_WiFiManager_Lite

Light-Weight MultiWiFi/Credentials Manager for ESP32 (including ESP32-S2 and ESP32-C3) and ESP8266 boards boards. Powerful-yet-simple-to-use feature to enable adding dynamic custom parameters. paragraph=Library to configure MultiWiFi/Credentials at runtime for ESP32/ESP8266 boards. You can also specify DHCP HostName, static AP and STA IP. Use much less memory compared to full-fledge WiFiManager. Config Portal will be auto-adjusted to match the number of dynamic custom parameters. Optional default Credentials to be autoloaded into Config Portal to use or change instead of manually input. Credentials are saved in LittleFS, SPIFFS or EEPROM. New powerful-yet-simple-to-use feature to enable adding dynamic custom parameters from sketch and input using the same Config Portal. Double or MultiDetectDetector as well as Virtual Switches feature permits entering Config Portal as requested.
MIT License
49 stars 15 forks source link

Using the UM ProS3 I rarely can connect to WiFi config portal. #40

Closed pgeremia closed 1 year ago

pgeremia commented 1 year ago

Describe the bug

Using the UM ProS3 I rarely can connect to WiFi config portal.

Steps to Reproduce

  1. Use basic example code.
  2. Run
  3. You will sometime see SSID on wireless device. When you do if you try to connect it will say "Unable to join the network" most of the times. Every once in a while you can actually connect.

(Ran test client on iPhone, iMac and Windows 10 all produced the same results)

Expected behavior

Wifi config portal connection succeeds and allows you to bring up config web page.

Actual behavior

Either the SSID does not show up on device OR if it does and you try to connect you get a connection error. On rare occasion it does work.

Information

Platform IO: 6.1.6 OS: MacOs Ventura

Build Information that contains all version info:

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/um_pros3.html
PLATFORM: Espressif 32 (6.0.0) > Unexpected Maker PROS3
HARDWARE: ESP32S3 240MHz, 320KB RAM, 16MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.20006.221224 (2.0.6) 
 - tool-esptoolpy @ 1.40400.0 (4.4.0) 
 - tool-mkfatfs @ 2.0.1 
 - tool-mklittlefs @ 1.203.210628 (2.3) 
 - tool-mkspiffs @ 2.230.0 (2.30) 
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 36 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ESP_WiFiManager_Lite @ 1.10.3
|   |-- ESP_DoubleResetDetector @ 1.3.2
|   |   |-- SPIFFS @ 2.0.0
|   |   |   |-- FS @ 2.0.0
|   |   |-- EEPROM @ 2.0.0
|   |   |-- FS @ 2.0.0
|   |   |-- LittleFS @ 2.0.0
|   |   |   |-- FS @ 2.0.0
|   |-- ESP_MultiResetDetector @ 1.3.2
|   |   |-- SPIFFS @ 2.0.0
|   |   |   |-- FS @ 2.0.0
|   |   |-- EEPROM @ 2.0.0
|   |   |-- FS @ 2.0.0
|   |   |-- LittleFS @ 2.0.0
|   |   |   |-- FS @ 2.0.0
|   |-- FS @ 2.0.0
|   |-- DNSServer @ 2.0.0
|   |   |-- WiFi @ 2.0.0
|   |-- EEPROM @ 2.0.0
|   |-- LittleFS @ 2.0.0
|   |   |-- FS @ 2.0.0
|   |-- SPIFFS @ 2.0.0
|   |   |-- FS @ 2.0.0
|   |-- WebServer @ 2.0.0
|   |   |-- WiFi @ 2.0.0
|   |   |-- FS @ 2.0.0
|   |-- WiFi @ 2.0.0

Notes

I added WIFI events to see if I can gather more info and I noticed a few interesting events showing WPS is being used? Below is the full log. I do not normally run with Wifi event handler. This was to try to gather more info.

Starting ESP_WiFi using LittleFS on Unexpected Maker PROS3
ESP_WiFiManager_Lite v1.10.3
ESP_MultiResetDetector v1.3.2
LittleFS Flag read = 0xFFFD0002
multiResetDetectorFlag = 0xFFFD0002
lowerBytes = 0x0002, upperBytes = 0x0002
No multiResetDetected, number of times = 2
LittleFS Flag read = 0xFFFD0002
Saving config file...
Saving config file OK
[WiFi-event] event: 0
WiFi interface ready
[WiFi-event] event: 2
WiFi client started
[  1811][E][vfs_api.cpp:105] open(): /littlefs/wm_config.dat does not exist, no permits for creation
[  1814][E][vfs_api.cpp:105] open(): /littlefs/wm_config.bak does not exist, no permits for creation
[WiFi-event] event: 1
Completed scan for access points
[WML] WiFi networks found:
[WML] 1: STEVE-JOBS-IOT, -59dB
[WML] 3: SQUIRREL, -61dB
[WML] 7: WallyWiFi, -71dB
[WML] 8: JCR, -72dB
[WML] 9: ZyXEL_EE91, -74dB
[WML] 10: 24B MV, -75dB
[WML] 11: HotspotWjN2, -75dB
[WML] 12: FiWi, -75dB
[WML] 13: NETGEAR66, -79dB
[WiFi-event] event: 3
WiFi clients stopped
[WiFi-event] event: 10
WiFi Protected Setup (WPS): succeeded in enrollee mode
[WML] 
stConf:SSID=WIFIMANAGERLITE,PW=******
[WML] IP=192.168.4.1[WiFi-event] event: 11
WiFi Protected Setup (WPS): failed in enrollee mode
,ch=8
[WiFi-event] event: 10
WiFi Protected Setup (WPS): succeeded in enrollee mode
C
Your stored Credentials :
Blynk Server1 = account.duckdns.org
Token1 = token1
Blynk Server2 = account.ddns.net
Token2 = token2
Port = 8080
MQTT Server = mqtt.duckdns.org
Stop multiResetDetecting
Saving config file...
Saving config file OK
CCCCCCCCC CCCC---

With some runs I see this:

Saving config file OK
CC[WiFi-event] event: 12
WiFi Protected Setup (WPS): timeout in enrollee mode
C[WiFi-event] event: 13
WiFi Protected Setup (WPS): pin code in enrollee mode
[WiFi-event] event: 12
WiFi Protected Setup (WPS): timeout in enrollee mode
[WiFi-event] event: 13
WiFi Protected Setup (WPS): pin code in enrollee mode

Not sure this has anything to do with anything, but it is interesting.


I will continue to debug to see if I can figure out a solution to this.


platformio.ini

[env:um_pros3]
platform = espressif32
board = um_pros3
framework = arduino
monitor_speed = 115200
lib_deps = 
    khoih-prog/ESP_WiFiManager_Lite

build_flags = 
    -D ARDUINO_USB_MODE=1
    -DARDUINO_ESP32S3_DEV

board_build.mcu = esp32s3
board_build.partitions = huge_app.csv
board_build.variant = esp32s3
board_build.f_cpu = 240000000L
board_build.f_flash = 80000000L
board_build.flash_mode = qio
board_build.arduino.ldscript = esp32s3_out.ld
build_unflags =
        -DARDUINO_ESP32_DEV
        -DARDUINO_VARIANT="esp32"
khoih-prog commented 1 year ago

Hi @pgeremia

I'm testing with ESP32S3_DEV here and everything is OK.

Either your board is bad, not compatible, or network is bad, etc. Try using Arduino IDE first to know if OK, then move to PIO then.

Debug Terminal

Starting ESP_WiFi using LittleFS on ESP32S3_DEV
ESP_WiFiManager_Lite v1.10.5
ESP_MultiResetDetector v1.3.2
multiResetDetectorFlag = 0xC474BB24
lowerBytes = 0xBB24, upperBytes = 0x3B8B
lowerBytes = 0xBB24, upperBytes = 0x3B8B
detectRecentlyResetFlag: Data corrupted. Reset to 0
No multiResetDetected, number of times = 0
Saving config file...
Saving config file OK
[WML] WiFi networks found:
[WML] 1: HueNetNew, -20dB
[WML] 2: HueNet, -25dB
[WML] 3: HueNetTek, -33dB
[WML] 4: HueNet2, -53dB
[WML] 5: SmartRG-02a2, -67dB
[WML] 6: Linksys00043, -76dB
[WML] 7: Elkhoury, -77dB
[WML] 8: Access, -78dB
[WML] 9: Rogers5651, -79dB
[WML] 10: house, -81dB
[WML] 11: LashQueenEzzy, -83dB
[WML] 12: FishTank, -83dB
[WML] 13: DIRECT-03-HP M132 LaserJet, -84dB
[WML] 14: ESP151CD5, -86dB
[WML] 15: elfa911, -88dB
[WML] 16: Fresh5690, -89dB
[WML] 17: Access 2.0, -90dB
[WML] 18: BELL986, -90dB
[WML] 19: Living Room Speaker 2.o, -91dB
[WML] 20: Jasmine, -92dB
[WML] 21: superstar1, -94dB
[WML] 
stConf:SSID=your_customized_ssid,PW=your_customized_pwd
[WML] IP=192.168.4.1,ch=11
C
Your stored Credentials :
Blynk Server1 = account.duckdns.org
Token1 = token1
Blynk Server2 = account.ddns.net
Token2 = token2
Port = 8080
MQTT Server = mqtt.duckdns.org
Stop multiResetDetecting
Saving config file...
Saving config file OK
CC[WML] h:Updating LittleFS:/wm_config.dat
[WML] h:Rst
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0xa (SPI_FAST_FLASH_BOOT)
Saved PC:0x42082912
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbec
load:0x403cc700,len:0x2920
entry 0x403c98d8

Starting ESP_WiFi using LittleFS on ESP32S3_DEV
ESP_WiFiManager_Lite v1.10.5
ESP_MultiResetDetector v1.3.2
LittleFS Flag read = 0xFFFE0001
multiResetDetectorFlag = 0xFFFE0001
lowerBytes = 0x0001, upperBytes = 0x0001
No multiResetDetected, number of times = 1
LittleFS Flag read = 0xFFFE0001
Saving config file...
Saving config file OK
[WML] Hdr=ESP_WM_LITE,SSID=HueNet,PW=12345678
[WML] SSID1=HueNetNew,PW1=12345678
[WML] BName=ESP32_S3_DEV
[WML] Hdr=ESP_WM_LITE,SSID=HueNet,PW=12345678
[WML] SSID1=HueNetNew,PW1=12345678
[WML] BName=ESP32_S3_DEV
[WML] WiFi connected after time: 0
[WML] SSID=HueNetNew,RSSI=-14
[WML] Channel=11,IP=192.168.2.152
Stop multiResetDetecting
Saving config file...
Saving config file OK
H
Your stored Credentials :
Blynk Server1 = account.duckdns.org
Token1 = token1
Blynk Server2 = account.ddns.net
Token2 = token2
Port = 8080
MQTT Server = mqtt.duckdns.org

Good Luck,

pgeremia commented 1 year ago

I tried the Arduino IDE. I used your example code the only modifications being SSID and password. I loaded into Arduino IDE.

I had to load dev lib in order to get my board: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

So I guess maybe the board has an issue? https://esp32s3.com/pros3.html I did buy TWO of these boards and both act the same.

Can you recommend a esp32-s3 board with this form factor with this many usable GPIO pins that will work with WifiManager Lite that is available for purchase?

From your documentation you say that this board is supported:

"ESP32-S3 (ESP32S3_DEV, ESP32_S3_BOX, UM TINYS3, UM PROS3, UM FEATHERS3, etc.) using EEPROM, SPIFFS or LittleFS."

That is actually why I purchased it because it says it is supported. I did not want to take any chances.

Any help would be appreciated.

khoih-prog commented 1 year ago

Can you recommend a esp32-s3 board with this form factor with this many usable GPIO pins that will work with WifiManager Lite that is available for purchase?

Sorry I can't do that. Post on Arduino Forum, etc. for help.

You have to know what wrong either with the board, incompatibility with core, etc. by using the simplest tests of WiFi library of the ESP32 core in WiFi examples.

If not OK, post the issue on ESP32 core and/or UM manufacturer support site.

khoih-prog commented 1 year ago

I'm testing with this and OK, many pins to use

ESP32S3_DEV

pgeremia commented 1 year ago

Since that works I will see if I can buy it somewhere. Thanks for the info.

khoih-prog commented 1 year ago

You can get it from

https://www.digikey.com/en/products/detail/espressif-systems/ESP32-S3-DEVKITC-1-N8/15199021

pgeremia commented 1 year ago

I tried this example program and it worked a lot better. So maybe this board has some differences that is causing WifiManger to have issues. This is the example that I used: https://github.com/espressif/arduino-esp32/tree/master/libraries/WiFi/examples/WiFiAccessPoint. I have an extra UM ProS3. Would you like me to ship it to you for your test environments? You can have it free of charge considering all of the work you do creating this awesome free software!!!

khoih-prog commented 1 year ago

Thanks for your nice offer, but I can't guarantee anything yet, just for researching what's wrong (code or hardware / core, etc) If still OK, please send PM to me at my email address in library.properties, then I'll reply with my address.

BR,