Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wifi AP & password not being saved (must re-enter on restart) #3

Closed
numericOverflow opened this issue Jul 21, 2021 · 4 comments
Closed

Comments

@numericOverflow
Copy link
Contributor

I've compiled for my NodeMCU (ES8266) using PlatformIO and VSCode and after some brief testing, the API seems to be working great.

The only problem is that my wireless SSID and password configuration do not survive a reboot. At every power cycle of the NodeMCU, I have to reconnect to the internal "WateringSystemAP" to re-enter the desired SSID and credentials.

Any idea why this might be happening?

Here's the compile output, in case it's helpful...

> Executing task: C:\Users\myUsername\.platformio\penv\Scripts\platformio.exe run --environment nodemcuv2 <

Processing nodemcuv2 (platform: espressif8266; board: nodemcuv2; framework: arduino)
----------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 (3.1.0) > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:
 - framework-arduinoespressif8266 3.30001.210627 (3.0.1)
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.30000.201119 (3.0.0)
 - toolchain-xtensa 2.100300.0 (10.3.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 40 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESPAsyncWiFiManager> 0.25.0
|   |-- <DNSServer> 1.1.1
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ESP Async WebServer> 1.2.3
|   |   |-- <ESPAsyncTCP> 1.2.2
|   |   |-- <Hash> 1.0
|   |   |-- <ESP8266WiFi> 1.0
|   |   |-- <ArduinoJson> 6.18.2
|-- <ArduinoJson> 6.18.2
|-- <ESP Async WebServer> 1.2.3
|   |-- <ESPAsyncTCP> 1.2.2
|   |-- <Hash> 1.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ArduinoJson> 6.18.2
|-- <ESPAsyncTCP> 1.2.2
|-- <ESP8266HTTPClient> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <HunterRoam>
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
Building in release mode
Archiving .pio\build\nodemcuv2\lib8c0\libESP Async WebServer.a
Compiling .pio\build\nodemcuv2\lib487\ESPAsyncWiFiManager\ESPAsyncWiFiManager.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\abi.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\aes_unwrap.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\base64.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\cbuf.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\cont.S.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\cont_util.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_app_entry_noextra4k.cpp.o  
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_eboot_command.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_features.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_flash_quirks.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_flash_utils.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_i2s.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_main.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_non32xfer.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_noniso.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_phy.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_postmortem.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_si2c.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_sigma_delta.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_spi_utils.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_timer.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_vm.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_waveform_phase.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_waveform_pwm.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_wiring.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_wiring_analog.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_wiring_digital.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_wiring_pulse.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_wiring_pwm.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\core_esp8266_wiring_shift.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\crc32.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\debug.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\exc-c-wrapper-handler.S.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\exc-sethandler.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\flash_hal.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\gdb_hooks.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\heap.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\hwdt_app_entry.cpp.o
.pio\libdeps\nodemcuv2\ESPAsyncWiFiManager\ESPAsyncWiFiManager.cpp: In member function 'void AsyncWiFiManager::copySSIDInfo(wifi_ssid_count_t)':
.pio\libdeps\nodemcuv2\ESPAsyncWiFiManager\ESPAsyncWiFiManager.cpp:314:12: warning: unused variable 'res' [-Wunused-variable]
  314 |       bool res=WiFi.getNetworkInfo(i, wifiSSIDs[i].SSID, wifiSSIDs[i].encryptionType, wifiSSIDs[i].RSSI, wifiSSIDs[i].BSSID, wifiSSIDs[i].channel, wifiSSIDs[i].isHidden);
      |            ^~~
.pio\libdeps\nodemcuv2\ESPAsyncWiFiManager\ESPAsyncWiFiManager.cpp: In member function 'boolean AsyncWiFiManager::isIp(String)':
.pio\libdeps\nodemcuv2\ESPAsyncWiFiManager\ESPAsyncWiFiManager.cpp:1166:21: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
 1166 |   for (int i = 0; i < str.length(); i++) {
      |                   ~~^~~~~~~~~~~~~~
Compiling .pio\build\nodemcuv2\FrameworkArduino\libb64\cdecode.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\libb64\cencode.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\libc_replacements.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\mmu_iram.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\reboot_uart_dwnld.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\spiffs\spiffs_cache.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\spiffs\spiffs_check.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\spiffs\spiffs_gc.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\spiffs\spiffs_hydrogen.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\spiffs\spiffs_nucleus.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\spiffs_api.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\sqrt32.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\stdlib_noniso.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\time.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\uart.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\umm_malloc\umm_info.c.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\umm_malloc\umm_integrity.c.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\umm_malloc\umm_local.c.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\umm_malloc\umm_malloc.cpp.o
Compiling .pio\build\nodemcuv2\FrameworkArduino\umm_malloc\umm_poison.c.o
.pio\libdeps\nodemcuv2\ESPAsyncWiFiManager\ESPAsyncWiFiManager.cpp: At global scope:
.pio\libdeps\nodemcuv2\ESPAsyncWiFiManager\ESPAsyncWiFiManager.cpp:152:15: warning: 'String byteToHexString(uint8_t*, uint8_t, String)' defined but not used [-Wunused-function]  152 | static String byteToHexString(uint8_t* buf, uint8_t length, String strSeperator="-") {
      |               ^~~~~~~~~~~~~~~
Archiving .pio\build\nodemcuv2\libFrameworkArduino.a
Archiving .pio\build\nodemcuv2\lib487\libESPAsyncWiFiManager.a
Linking .pio\build\nodemcuv2\firmware.elf
Retrieving maximum program size .pio\build\nodemcuv2\firmware.elf
Checking size .pio\build\nodemcuv2\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=====     ]  52.3% (used 42820 bytes from 81920 bytes)
Flash: [=====     ]  51.5% (used 538045 bytes from 1044464 bytes)
Building .pio\build\nodemcuv2\firmware.bin
Creating BIN file ".pio\build\nodemcuv2\firmware.bin" using "C:\Users\myUsername\.platformio\packages\framework-arduinoespressif8266\bootloaders\eboot\eboot.elf" and ".pio\build\nodemcuv2\firmware.elf"
============================= [SUCCESS] Took 8.19 seconds =============================

Terminal will be reused by tasks, press any key to close it.
@numericOverflow
Copy link
Contributor Author

Looks like this is a known issue in ESPAsyncWiFiManager.

alanswx/ESPAsyncWiFiManager#83

I'll try to dig deeper and post a solution if I can find one.

numericOverflow added a commit to numericOverflow/hunter-wifi that referenced this issue Jul 29, 2021
Should fix issue where wifi credentials not persisting reboots when using ESPAsyncWiFiManager 3.x
ecodina#3
@numericOverflow
Copy link
Contributor Author

numericOverflow commented Aug 3, 2021

I tested a suggested code tweak last night, and with only a small amount of testing, it seems to fix the issue. Once set, WiFi settings now persist reboots!

I don't know how the change effects anyone using the previous ESPAsyncWiFiManager 2.x code though.

I'll work on uploading my update as a pull request, but would like someone with the old toolchain could verify.

alanswx/ESPAsyncWiFiManager#83 (comment)

@ecodina
Copy link
Owner

ecodina commented Aug 7, 2021

Hello. I no longer have the board available for development so I can't test it. I will leave the issue open for a while, just in case someone else can do it.

anubisg1 added a commit to anubisg1/hunter-wifi that referenced this issue Sep 19, 2021
@ecodina
Copy link
Owner

ecodina commented Sep 25, 2021

After a prudent amount of time, it seems that the fix is good. Closing this issue.

@ecodina ecodina closed this as completed Sep 25, 2021
ecodina pushed a commit that referenced this issue Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants