The prominence and accessibility (to laymen) of wifi does not help the situation either... I mean what else CAN they do except try stuff out, how are they going to determine that it worked and why it did?...
OP, yes, poorly implemented power saving has in my experience often been a culprit behind network reliability issues. That said, please consider adding a disclaimer that just disabling power saving in client devices without pinpointing the root cause of the instability or at least reporting it is exactly why we are in a situation where it is still buggy.
Next time that doesn’t work (the e-stop button is still pressed in) but someone tries switching the system into test mode and back twice, slamming the control cabinet door, pressing and releasing the e-stop button three times, then pressing the e-stop reset button three times. They report their findings on the new standard procedure…
And so on.
It's worse. People don't even need to have personal experience to spread misinformation. They just read it online and then spread it like gospel.
Misinformation in the likes of "Wood glue it stronger than wood", "Burning Diesel/Kerosine can't reach temperatures required to melt steel".
YMMV but adding a loop of wire in parallel with the oscillator improved wifi performance on mine.
(I first tried moving the ceramic antenna a millimeter outward, but that made no difference.)
Came across even more 'work arounds'; No spaces in the SSID, disable IPv6 for the whole network even if the ESP ignores it. Thing is all of these settings would reboot the router and reconnect everything, so it would seemingly work until the next dropout.
I found limiting them to 802.11g instead of connecting with 'n' stopped the dropouts for good. Even now I wouldn't say that is a cure-all and that any of these other recommendations don't work, I'd guess that each AP's firmware might have different conflicts with different devices.
In Wi-Fi it's always the client's choice on where to connect to at the end of the day and any hacks the APs try to do to steer clients are "suggestions" at best and "signal ruiners for everyone" at worst.
You may be better off specifying which specific AP you want to connect to by specifying the BSSID argument in the WiFi.begin() call on the ESP32 side https://github.com/espressif/arduino-esp32/blob/master/libra...
Alternatively, if you REALLY want to force it, the sanest way is to use a uniquely named IoT SSID on each AP so there would be no other option for those clients to choose to latch on to (and you can leave the other SSIDs shared for normal clients). E.g. "IoT-1", "IoT-2", "IoT-3" on 3 separate APs. It may clutter up device screens more when you list available networks but it's just visual because, as far as airtime, they all beacon just as often if the names are the same or not anyways.
> From what people and the internet tell me you should set the band width on the 2.4 Ghz network that your boards use to 20 Mhz, not 40, not 60, and definitely not automatic.
This is spot on in that 20 MHz is the ideal channel width on 2.4, doubly so for just an ESP32. Some things to add are I'd say it should apply to any of your 2.4 GHz networks unless you live out the sticks and really want to race a few extra mbps out at the fringe of your AP coverage (and even then the wider channel width is probably going to make your SNR worse even in the sticks). Also, I don't believe the ESP32 supports 60 MHz in the 2.4 GHz space at all (it's certainly not an option in the Wi-Fi standard).
I'll also tack on that the ESP32-C6 can be worth springing for if these kinds of thing are a particular concern as it support Wi-Fi 6, which has a few enhancements for connecting lots of IoT devices without so much noise.
For home it has its ups and downs depending how much the user cares about understanding Wi-Fi as part of their project vs just doing the minimum to make their project work. If you've already got a Wi-Fi scanner app you're well acquainted with reading (or are willing to spend a short bit of time reading about how to use one to troubleshoot an issue or select the best covering AP at a location) on one of your devices then you're probably the right crowd to hide the SSID at home as well.
If your router and device support 802.11 k/v/r it can help, most likely the AP does unless it's particularly ancient and Android has supported all of these since 8.0. Ironically, lowering the AP's power can help too (it'll cause the client to see the farther AP as weaker sooner) but obviously that lowers overall coverage at the same time... so it's a tradeoff unless you're willing to deploy more APs to make up for the lower power. Make sure you're restricting advertised rates from your AP to not include the slowest/oldest standards as well. That'll make the client less able to hold on as the connection gets weaker and weaker. Like the power recommendation, this means at the fringes of your coverage you'll get "no connection" rather than "a bad connection" but it'll make the overall airspace healthier.
If nothing else works and you can't fix the client because you lack full control (or a reasonable way to update it) then you can still try falling back to steering clients via hints from the AP (if it supports it) just keep in mind it also may not work and also may cause problems with other devices which were working fine. Or you may get lucky, worth a shot if you've tried everything else first.
As a note: My experience comes from designing and fixing enterprise wireless deployments so if there are any tricks specific to low AP count environments I would be somewhat ignorant of them. The same could be said if there are more easily accessible wireless controls in Android than I am familiar with as, if there are, I still couldn't use them as different guests walk in each day and they all need to work.
The only solution I've found is enabling the minimum RSSI feature on my APs, this forcefully disconnects any clients with a low signal.
Devices usually take 5-10 seconds to reconnect to the new AP after this happens, but will also sometimes will fail outright for a minute or more while Android insists on trying to connect to the old AP with a worse signal and keeps getting kicked off, before it finally gives up and connects to the stronger signal.
Raising the minimum data rate can also help, as long as none of your devices are really old and need them.
Apart from that, OpenWrt now allows you to install and use usteer which offers a plethora of (802.11 standards-based) tools to manage client roaming from the AP side, including the APs exchanging information between themselves.
But Arduino ecosystem is full of superstition and bizarre hacks. It's cargo cult electronics. They will do anything to avoid reading documentation or writing robust code.
Even the power saving recommendation here reeks of it. There is no effort to understand it. Someone on an Arduino forum recommends it, others start to echo it to try to appear like they know what they're talking about, it becomes lore in the Arduino world and you out yourself as a clueless newbie if you don't know to do esp_wifi_set_ps(WIFI_PS_NONE) without questioning anything because that's just the way it's done. It disables the radio in between AP beacons, so unless there's a bug in the implementation it should have no noticeable impact to a quiet WiFi station other than saving a lot of power.
It's the same thing that happened with computers. Billions of people use them, but most just want to access Facebook or use MS Word, not learn OS internals. It's a different world from where we used to be 30-40 years ago, and that's fine. We design simpler, more intuitive products for them.
If a product meant for that group can't be used effectively by the target audience, I think the fault is with the designer, not with the user.
Seems safe, but it probably depends on the clock being accurate, so it can wake up on time for the next beacon, and the clock frequency is likely sensitive to temperature and therefore power usage.
If you're plugged into a wall wart, chances are the power savings aren't going to be too much; if it helps reliability (which should be easy to confirm), then it's likely worth paying a cent or two more a month. It's different if you're running from battery, though.
If I can disable PM and then my ESP stops disconnecting from WiFi, I'm happy. There's not much more I can do without re-implementing what 'WiFi.begin()' does myself, and I usually have better things to do with my time.
A) this increases ripple voltage which eventually impacts RX noise floor. As long as you have enough headroom at the input to your regulator power saving is great, but eventually having a more consistent load becomes the limiting factor for many devices.
B) drastically increases typical latency - not an issue for all applications, but the ESP-IDF network stack has a Nagler that can't always cleanly be disabled and tends to write each little bit of the next layer to the TCP socket.
No! You as programmer control that. You can configure to connect to any AP you want.
My code does a scan and save the closest AP. If it can’t connect it does another scan and saves a new AP
How would it know to reconnect to stronger AP?
You can order it to do a background scan and reconnect to stronger AP if you want, but you have to figure out how often to do this and how to interleave other data during the scan.
File download time decreased by about 40% on Android but not at all on iOS - turned out at the time they only supported 40MHz+ on 5.8GHz.
Also, I do not believe iOS ever added support for 40MHz channels on 2.4GHz. That feature never should have been added to WiFi. It causes headaches practically everywhere it is used.
This is not a characteristic of "ESP32", this is how the software running on the ESP32 is programmed to work, whatever specific program that is. And it is not my experience at all with "ESP32s". In my ESP-IDF based program, the ESP32 device connects to access points exactly how I tell it to connect with the software I wrote that deals with wifi connections. YMMV.
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/...
> It is a possible situation that there are multiple APs that match the target AP info, e.g., two APs with the SSID of "ap" are scanned. In this case, if the scan is WIFI_FAST_SCAN, then only the first scanned "ap" will be found.
The default if esp_wifi_set_config() is not called or, as I see in almost all the sample code that comes up with a quick web search, it is left untouched in the wifi_config_t struct, appears to be WIFI_FAST_SCAN. When you're looking directly at the relevant manual section during a HN discussion of ESP WiFI behavior, it may be obvious, but for a developer focused on the main product functionality who just copies and pastes an example and moves on when it appears to work, I'm not surprised if this always-incorrect-by-default behavior makes it into the vast majority of shipped ESP-based products.
And there's also
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/...
I could have sworn there used to be a "sort by SSID" default, as in it would do the full scan and then connect to the AP with the alphabetically earlier hardware address. In any case, the symptom I was plagued with was that this particular device would consistently connect to the furthest-away access point rather than the one in the same room, resulting in unusable dropouts.
Combine that with very few “knobs” to turn on the esp32 framework, a router/wifi AP that is likely hostile to its owners, and well, superstition is pretty much all that is left.
It’s a demon haunted world.
Take note, those who dream of llms operating everything include each other: “prompt engineering” is just a fancy euphemism for grimoire, and when it’s all massive, inscrutable matrices deciding everything, well, you too might just feel it’s not a bad idea to build a shrine.
This is not a superstition for 2.4GHz. Other devices sharing 2.4ghz tend to malfunction when 40MHz channels are in use. This is a well known phenomenon. I have been able to reproduce it in my household by enabling 40MHz channel support for 2.4GHz on my ruckus APs while listening to audio from a Bluetooth speaker. The Bluetooth speaker will start having discontinuities in the audio stream that disappear when 40MHz support in the APs is disabled.
I've always turned off power saving and given them hard coded IP settings (no DHCP). The only time I saw anything wonky is a short-lived experiment with the 32's deep sleep not reliably connecting on wakeup.
Mostly ESPHome now, two of the basic Uniquiti pucks from a few years back, for reference.
Solved it by creating a dedicated IoT SSID advertising just WPA2 w/ AES and only on 2.4GHz w/ 20MHz (you shouldn't use 40MHz on 2.4GHz anyway for god's sake).
Here're some useful tips to tune WiFi for IoT https://www.wiisfi.com/#iotconnect
Here's the board, it's a bit of a generic light/motion/presence sensor with an IR LED:
I wonder if there's some special high security setting or OpenWRT router or something that they don't like?
Whenever tech people say something is unreliable, I sometimes wonder if they're using it in a non-stock way, and if that is part of what causes the issues.
> seriously, open up a device and changes are relatively large that you’ll find one
s/changes/chances
Maybe there was a way to turn off the Wi-Fi stack. But I suppose the general point still stands — that there are plenty of other small devices without Wi-Fi if that is not a requirement.
https://www.tarlogic.com/news/backdoor-esp32-chip-infect-ot-...