Closed jf-navica closed 1 week ago
I have Ubiguiti's Unifi network and everything works with the same SSID on 2.4GHz and 5GHz. I would suspect something wrong on your particular WiFi settings.
WLED uses stock Arduino/IDF WiFi stack so issue should be reported (and debugged) there.
Can't open a bug there, ESPHOME also uses stock Arduino/IDF and it works. So what's different between WLED and ESPHOME?
WLED (in 0.15) does:
...
WiFi.persistent(false);
WiFi.onEvent(WiFiEvent);
#if defined(ARDUINO_ARCH_ESP32) && ESP_IDF_VERSION_MAJOR==4
WiFi.useStaticBuffers(true); // use preallocated buffers (for speed)
#endif
#ifdef ESP8266
WiFi.setPhyMode(force802_3g ? WIFI_PHY_MODE_11G : WIFI_PHY_MODE_11N);
#endif
if (isWiFiConfigured()) {
showWelcomePage = false;
WiFi.setAutoReconnect(true); // use automatic reconnect functionality
WiFi.mode(WIFI_MODE_STA); // enable scanning
findWiFi(true); // start scanning for available WiFi-s
} else {
showWelcomePage = true;
WiFi.mode(WIFI_MODE_AP); // WiFi is not configured so we'll most likely open an AP
}
...
if (isWiFiConfigured()) {
WiFi.mode(WIFI_MODE_STA); // engage explicit STA mode
// determine if using DHCP or static IP address, will also engage STA mode if not already
if (multiWiFi[selectedWiFi].staticIP != 0U && multiWiFi[selectedWiFi].staticGW != 0U) {
WiFi.config(multiWiFi[selectedWiFi].staticIP, multiWiFi[selectedWiFi].staticGW, multiWiFi[selectedWiFi].staticSN, dnsAddress);
} else {
WiFi.config(IPAddress((uint32_t)0), IPAddress((uint32_t)0), IPAddress((uint32_t)0));
}
// convert the "serverDescription" into a valid DNS hostname (alphanumeric)
char hostname[25];
prepareHostname(hostname);
#ifdef ARDUINO_ARCH_ESP32
WiFi.setTxPower(wifi_power_t(txPower));
WiFi.setSleep(!noWifiSleep);
WiFi.setHostname(hostname);
#else
wifi_set_sleep_type((noWifiSleep) ? NONE_SLEEP_T : MODEM_SLEEP_T);
WiFi.hostname(hostname);
#endif
WiFi.begin(multiWiFi[selectedWiFi].clientSSID, multiWiFi[selectedWiFi].clientPass); // no harm if called multiple times
// once WiFi is configured and begin() called, ESP will keep connecting to the specified SSID in the background
// until connection is established or new configuration is submitted or disconnect() is called
}
...
WiFi
being instance of generic Arduino WiFi
class.
So what's different between WLED and ESPHOME?
@jf-navica there are lots of differences - most importantly the core libraries used. I'm not sure what ESPHome uses, however i'm relatively sure its esp-idf 4.4.x and arduino-esp32 2.0.y.
For various reasons (especially flash usage), WLED for esp32 is still on esp-idf 3.5.x and arduino-esp32 1.0.6. Before you ask - no we cannot "simply upgrade" these core versions, unless you (as a user) are OK with getting a firmware that only runs on 8MB flash boards.
We actually have a "V4" build that uses the new espressif core, but its still experimental because we cannot (yet) fit all WLED features into this build. Good news is, this build can be uploaded to 4MB devices.
You can go to https://wled-install.github.io/ (alternative web installer) and flash your board with a "V4" firmware. This should help to find out if the newer wifi core makes a difference. Please make a backup of your config & presets because the installer will erase the flash memory.
won't connect to WiFi when SSID is the same on both 2.4 and 5 Ghz. If the SSID is only on 2.4 Ghz, it connects.
In fact esp32 only has 2.4Ghz radio, so it does nor even know the 5Ghz network exists.
Your router might have features enabled (fast roaming, 2.4ghz -> 5ghz handover, or whatever) that causes the behaviour you describe. But we can't control that from WLED side. Again, your esp32 does not even "see" the 5Ghz frequencies.
won't connect to WiFi when SSID is the same on both 2.4 and 5 Ghz. If the SSID is only on 2.4 Ghz, it connects.
In fact esp32 only has 2.4Ghz radio, so it does nor even know the 5Ghz network exists.
Your router might have features enabled (fast roaming, 2.4ghz -> 5ghz handover, or whatever) that causes the behaviour you describe. But we can't control that from WLED side. Again, your esp32 does not even "see" the 5Ghz frequencies.
That I figured out! I'm just puzzled as to why one works but not the other. I'll try the V4 firmware and let you know
I have setup a router(apple time capsule) in response to the OP issue in discord yesterday with SSID the same on both 2.4 and 5 Ghz and i did not face an issue as the wifi scan page will still pick up the SSID for 2.4
I have setup a router(apple time capsule) in response to the OP issue in discord yesterday with SSID the same on both 2.4 and 5 Ghz and i did not face an issue as the wifi scan page will still pick up the SSID for 2.4
Same here, they all show up in scan page. But connection won't work
@jf-navica While it is not a real solution and could be not suited for you , it might be best to get 2nd router ( i have two TP-Link WR840N ) just for the IoT devices and connect that to your main router as that really a solution to a lot of issues but otherwise you might have to dig in your main router setting which is not easy due to disruption . Please get one in all cases
So what's different between WLED and ESPHOME?
@jf-navica there are lots of differences - most importantly the core libraries used. I'm not sure what ESPHome uses, however i'm relatively sure its esp-idf 4.4.x and arduino-esp32 2.0.y.
For various reasons (especially flash usage), WLED for esp32 is still on esp-idf 3.5.x and arduino-esp32 1.0.6. Before you ask - no we cannot "simply upgrade" these core versions, unless you (as a user) are OK with getting a firmware that only runs on 8MB flash boards.
We actually have a "V4" build that uses the new espressif core, but its still experimental because we cannot (yet) fit all WLED features into this build. Good news is, this build can be uploaded to 4MB devices.
You can go to https://wled-install.github.io/ (alternative web installer) and flash your board with a "V4" firmware. This should help to find out if the newer wifi core makes a difference. Please make a backup of your config & presets because the installer will erase the flash memory.
ESPHOME uses esp-idf 4.4.6
Tested a few V4 firmwares and at one point I saw it connect but was never able to reproduce it. At least we have an explanation for the problem. It would be nice if it could be included in the install doc that this issue might arise with certain WiFi routers.
In my case, I'll simply disable 5Ghz on the IOT SSID
Correction: connexion to WiFI was successful with 0.14.4 V4 ESP-IDF 4.4.3. Not sure when it connected but my Home-Assistant detected it.
@softhack007 Can you confirm that this is the proper CLI procedure? I think my issue might lie somewhere else...
https://github.com/Aircoookie/WLED/releases/download/v0.13.1/esp32_bootloader_v4.bin https://wled-install.github.io/bin_dir/1_Standard_version/0.14.4_V4_(ESP-IDF_4.4.3_based,%20EXPERIMENTAL,%20should%20solve%20reboot%20issue)/WLED_0.14.4_ESP32_audioreactive_V4.bin
esptool.py erase_flash esptool.py write_flash 0x0 ./esp32_bootloader_v4.bin esptool.py write_flash 0x10000 ./WLED_0.14.4_ESP32_audioreactive_V4.bin NOT OK
Install via Chromium: https://wled-install.github.io/bin_dir/1_Standard_version/Nightly_build_next_major/WLED_0.15.0-b5_ESP32.bin NOT OK
Install Chromium: https://wled-install.github.io/bin_dir/1_Standard_version/0.14.4_V4_(ESP-IDF_4.4.3_based,%20EXPERIMENTAL,%20should%20solve%20reboot%20issue)/WLED_0.14.4_ESP32_audioreactive_V4.bin OK
Install via Chromium: https://wled-install.github.io/bin_dir/1_Standard_version/Nightly_build/WLED_0.14.4_ESP32.bin OK
Install via Chromium: https://wled-install.github.io/bin_dir/1_Standard_version/Nightly_build_next_major/WLED_0.15.0-b5_ESP32.bin OK
So it seems a Chromium install of V4 fixes something on my ESP32 that allows other versions to work.
esptool.py erase_flash esptool.py write_flash 0x0 ./esp32_bootloader_v4.bin esptool.py write_flash 0x10000 ./WLED_0.14.4_ESP32_audioreactive_V4.bin NOT OK
Sorry this won't work. You can't install a "V4" firmware the same way as a normal "V3" one. A number of files are needed, which are produced when building and installing from VSCode:
I can't tell you atm where to flash all these parts. In fact I only work from the VSCode+platformIO environment, which has a nice button for "build & upload" that takes care of flashing the right parts to the right addresses.
@softhack007 thanks for the pointer. I think the problem is linked to the bootloader https://github.com/Aircoookie/WLED/releases/download/v0.13.1/esp32_bootloader_v4.bin (as specified on the install page)
I did the following (used esphome to make sure I was on a clean slate)
Sequence 1: Install esphome Install with esptool (erase flash, esp32_bootloader_v4.bin, WLED_0.15.0-b5_ESP32.bin) not OK Install WLED 0.15.0-b5/2409100 with Chromium (install.wled.me) not OK
Sequence 2: Install esphome Install with esptool (erase flash, esp32_bootloader_v4.bin, WLED_0.15.0-b5_ESP32.bin) not OK Install esphome Install WLED 0.15.0-b5/2409100 with Chromium (install.wled.me) OK
I think the problem is linked to the bootloader https://github.com/Aircoookie/WLED/releases/download/v0.13.1/esp32_bootloader_v4.bin (as specified on the install page)
exactly what I wanted to say. The bootloader from the old WLED release pages is outdated. Don't use it.
The files used when you open install.wled.me are here: https://github.com/Aircoookie/WLED-WebInstaller/tree/master/bin/beta_0_15_0-b5 currently we don't have "V4" binaries for esp32, so you'll still find the old bootloader in that directory.
The complete flash procedure for esp32 is:
$ esptool version esptool.py v4.8.1 4.8.1
or later
As you're basically asking how to flash your board without using VSCode (the development environment for building WLED), maybe @wled-install or @lost-hope or @dosipod might be able to help you further. This is not my area any more.
And I'd suggest to move this discussion to . This issue tracker is meant for bugs in the WLED source code...
Thanks for the update. I'll close this issue but one last question: how to get the bootloader issue fixed on the web site?
allow me to repeat myself: This is not my area any more.
The standard webinstaller has its own repo here https://github.com/Aircoookie/WLED-WebInstaller
The alternative one lives here: https://github.com/wled-install/wled-install.github.io
What happened?
ESP-WROOM-32 won't connect to WiFi when SSID is the same on both 2.4 and 5 Ghz. If the SSID is only on 2.4 Ghz, it connects. It appears to be related to the way Synology handles band steering. BUT... Bug is not present on ESP8266 and using ESPHOME on same ESP-WROOM-32 works fine both using Arduino and ESP-IDF frameworks.
To Reproduce Bug
erase flash write_flash 0x0 ./esp32_bootloader_v4.bin write_flash 0x10000 ./WLED_0.15.0-b5_esp32_debug.bin (or any other versions down to 13.3) Connect to AP, configure WiFi
Expected Behavior
It should connect to WiFi
Install Method
Self-Compiled
What version of WLED?
0.15.0-b5
Which microcontroller/board are you seeing the problem on?
ESP32
Relevant log/trace output
Anything else?
Not self-compiled. Used debug binaries provided by: https://github.com/srg74/WLED-wemos-shield/tree/master/resources/Firmware/%40Aircoookie/Dev/0.15.0-b5/Debug_builds
Code of Conduct