diff --git a/README.md b/README.md index 94cdc706..e30b2bb6 100644 --- a/README.md +++ b/README.md @@ -29,11 +29,18 @@ A 3d-printable housing can be found here: https://www.thingiverse.com/thing:4571 -##### Rolling - (2020-09-10) +##### Rolling - (2020-09-11) + +* Support of spaces in WLan SSID or password + +2020-09-10 * Optimization of "DELETE ALL" - Autoreload of directory after delete, protection of wlan.ini + * Internal Optimization (removal of unnessary error messages, restructure CTfLiteClass) + * additional parameter in `wasserzahler.html?noerror=true` to suppress an potential error message in case of consitency check (is equal to `ErrorMessage` = False in `config.ini`) + * update ROI-configurator, in case of no ROIs defined 2020-09-09 diff --git a/code/lib/connect_wlan/connect_wlan.cpp b/code/lib/connect_wlan/connect_wlan.cpp index 376c3eee..19f72f5e 100644 --- a/code/lib/connect_wlan/connect_wlan.cpp +++ b/code/lib/connect_wlan/connect_wlan.cpp @@ -28,10 +28,13 @@ static EventGroupHandle_t wifi_event_group; #define BLINK_GPIO GPIO_NUM_33 -std::vector ZerlegeZeile(std::string input) +std::vector ZerlegeZeile(std::string input, std::string _delimiter = "") { std::vector Output; std::string delimiter = " =,"; + if (_delimiter.length() > 0){ + delimiter = _delimiter; + } input = trim(input, delimiter); size_t pos = findDelimiterPos(input, delimiter); @@ -140,11 +143,21 @@ void LoadWlanFromFile(std::string fn, std::string &_ssid, std::string &_passphra while ((line.size() > 0) || !(feof(pFile))) { // printf("%s", line.c_str()); - zerlegt = ZerlegeZeile(line); - if ((zerlegt.size() > 1) && (toUpper(zerlegt[0]) == "SSID")) + zerlegt = ZerlegeZeile(line, "="); + zerlegt[0] = trim(zerlegt[0], " "); + zerlegt[1] = trim(zerlegt[1], " "); + if ((zerlegt.size() > 1) && (toUpper(zerlegt[0]) == "SSID")){ _ssid = zerlegt[1]; - if ((zerlegt.size() > 1) && (toUpper(zerlegt[0]) == "PASSWORD")) + if ((_ssid[0] == '"') && (_ssid[_ssid.length()-1] == '"')){ + _ssid = _ssid.substr(1, _ssid.length()-2); + } + } + if ((zerlegt.size() > 1) && (toUpper(zerlegt[0]) == "PASSWORD")){ _passphrase = zerlegt[1]; + if ((_passphrase[0] == '"') && (_passphrase[_passphrase.length()-1] == '"')){ + _passphrase = _passphrase.substr(1, _passphrase.length()-2); + } + } if (fgets(zw, 1024, pFile) == NULL) { diff --git a/firmware/firmware.bin b/firmware/firmware.bin index 1cd41e70..8bd8328d 100644 Binary files a/firmware/firmware.bin and b/firmware/firmware.bin differ diff --git a/sd-card/wlan.ini b/sd-card/wlan.ini index c2f077d4..f979b345 100644 --- a/sd-card/wlan.ini +++ b/sd-card/wlan.ini @@ -1,2 +1,2 @@ -ssid = SSID -password = PASSWORD \ No newline at end of file +ssid = "SSID" +password = "PASSWORD" \ No newline at end of file