-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Added multi WiFi saving feature #3703
Conversation
Thank you. |
By adding a random string to the path of the js file every time, we make sure to never hit the browser cache.
By setting the response header "Cache-Control" to "no-store" and setting "Expires" to 0, we make sure the browsers and place calling this never store it in cache.
This reverts commit 51dfa9a.
* purge old (not yet processes) NTP responses * validate server responses before updating WLED time * purge receive buffer when package is rejected (avoids mem leak on esp32)
when NTP got enabled via UI, WLED would wait up to 12 hours before issuing the first NTP request.
Fix for UCS8904 hasWhite().
I've found a code spellchecker, so this is what can be corrected easily. Changes are only affecting comments, readme and a few user-visible strings. So no functional impact expected.
if you can spell Fahrenheit, you can't spell Celsius. And vice versa :-)
obuf is reset to nullptr in some cases
PHST abbreviation added for clarity.
According to the technical manual, GPIO 16 + 17 are used for onboard flash, so cannot be used by WLED. example buildenv: [env:esp32_pico] extends = env:esp32dev_qio80 board = pico32
if case of invalid or impossible sunset/sunrise results, retry with the previous day. max 3 days back, to prevent infinite loops and far-away results.
sunset = 0 is a valid result, as the function result is in UTC and not local time . Example: local time is UTC-8, local sunrise = 08:00am => getSunriseUTC() = 0. So we cannot use "0" for "invalid". Using UINT16_MAX resolves the problem, and even allows to simplify calculateSunriseAndSunset() a bit.
Fixed typo
Pointed link to current directions for compiling WLED
…Go T7_s3 ESP32-S3-WROOM-1-N16R8
make WS2814 explicit in LED driver drop-down menu
…-dev#3672) when only two bytes were received in a packet, the "for" condition `packetsize -3` would underflow, leading to an infinite loop.
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.15 to 1.26.18. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](urllib3/urllib3@1.26.15...1.26.18) --- updated-dependencies: - dependency-name: urllib3 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Up to 5 for ESP32 and Up to 3 for ESP8266 based devices Fixed typo in cfg.cpp Fixed minor bug in Settings_Wifi.html Minor Bug: If setting a SSID empty, then any followed network will be ignored
Something went wrong as there are 88 files changed. I cannot review that. |
Hi, yes! The rebase went extremely wrong, so I had to clone the 0_15 branch and patch all the files by hand. Right now I'm half way. I'll open a new PR, so for now I'll close this one as it got corrupted. Sorry for that |
Thank you! |
TL;DR:
This PR adds the Multi-Wifi saving feature, which was requested and discussed in #2845, #2974, #852, #1228, and other issues that I may not found.
How it works:
User's side
For the user I tried to make it as simple as possible: Now the WiFi setting page will have three "new" sections:
In back-end
Nowadays WLED saves the WiFi setting in two global vars: clientSSID and clientPass. Both are strings (well... Char array). Now, I removed these vars and created three new ones: clientNetsSSID, clientNetsPass and clientSavedNets. The first two are almost the same as the old vars, but now they're Strings Array (or Char Matrix, or Char Array Array, or whatever you want to call it), which can save up to 5 Networks in ESP32, or 3 in ESP8266 (those limits were selected arbitrarily). While clientSavedNets is a Byte that stores how many networks are saved and loaded into memory.
When WLED wants to connect to a network, it first scan for every nearby networks and start looking for the nearest saved network. Then, tries to connect to it, and if it can't, then try with the next near one. Each attempt has like 5 seconds before failing. This amount of time was selected because "Last reconnect too old" message was being fired immediately with anything greater than 5 seconds and with just one network.
Backward compatibility
Now WLED will check if the config file has a network saved with the last scheme, and if there's, then it will add it as the first network and then it'll save the config file with the new scheme
Drawbacks
Because I'm not familiar with Improv and EEPROM saving in WLED, and because of backward compatibility concerns, in both cases it'll set/load the first network. For example:
This shouldn't be a big issue for most users, except for those who uses Improv/EEPROM and wanted to save multiple WiFi networks.
Also, as mentioned before, now the IP Settings will affect to every network, even if the subnets differs com each others.
Files Changed:
ssid%d
andpsk%d
, where%d
goes from 0 to 4, instead ofssid
andpsk
respectivelyWLED_MAX_SAVED_NETWORKS
,SUBPAGE_MAIN_SETTINGS
, andSUBPAGE_WIFI_NETWORKS
constantloadJS()
function to letting load more than one JS.input[type="password"]
to the sameinput[type="text"]
style.getSettingsJS
tovoid getSettingsJS(byte subPage, char* dest, byte subSettings);
, so it can load sub-settings from the same page.clientSSID
andclientPass
global vars withclientNetsSSID
andclientNetsPass
respectively.clientSavedNets
global var.WLED_WIFI_CONFIGURED
will be true if the first network is configured, or ifclientSavedNets
is greater than zero.serveSettingsJS
will accept thes
argument for loading sub-settings from the same page.s
is zero (default behavior). It'll return theGetV
JS function. Otherwise, it'll return theGetW
one.SUBPAGE_WIFI_NETWORKS
sub-setting inSUBPAGE_WIFI
page. In this case, it'll return a tuple of three where the first item is the amount of saved networks, while the second item is the maximum amount of networks that can be saved, and the last item is an array of every saved network.