Fix open network connection (no password)

This commit is contained in:
Luc 2019-06-21 18:43:49 +02:00
parent 1d7b3ff83f
commit 4d6bac193a
4 changed files with 15 additions and 4 deletions

View File

@ -1357,7 +1357,7 @@ bool COMMAND::execute_command (int cmd, String cmd_params, tpipe output, level_a
if (! (styp == "B" || styp == "S" || styp == "A" || styp == "I" || styp == "F") ) {
response = false;
}
if (sval.length() == 0) {
if ((sval.length() == 0) && !((pos==EP_AP_PASSWORD) || (pos==EP_STA_PASSWORD))){
response = false;
}

View File

@ -692,10 +692,17 @@ bool CONFIG::write_string (int pos, const char * byte_buffer)
maxsize = EEPROM_SIZE;
break;
}
if ( (size_buffer == 0 ) || pos + size_buffer + 1 > EEPROM_SIZE || size_buffer > maxsize || byte_buffer == NULL) {
if ( pos + size_buffer + 1 > EEPROM_SIZE || size_buffer > maxsize ) {
LOG ("Error write string\r\n")
return false;
}
if (!((pos == EP_STA_PASSWORD) || (pos == EP_AP_PASSWORD))) {
if((size_buffer == 0 ) || (byte_buffer == NULL )){
LOG ("Error write string\r\n")
return false;
}
}
//copy the value(s)
EEPROM.begin (EEPROM_SIZE);
for (int i = 0; i < size_buffer; i++) {

View File

@ -19,7 +19,7 @@
*/
//version and sources location
#define FW_VERSION "2.1.0.b28"
#define FW_VERSION "2.1.0.b29"
#define REPOSITORY "https://github.com/luc-github/ESP3D"
//Customize ESP3D ////////////////////////////////////////////////////////////////////////

View File

@ -467,7 +467,11 @@ bool WIFI_CONFIG::Setup (bool force_ap)
#else
esp_wifi_set_protocol (ESP_IF_WIFI_STA, bflag);
#endif
WiFi.begin (sbuf, pwd);
if (strlen(pwd) > 0){
WiFi.begin (sbuf, pwd);
} else {
WiFi.begin (sbuf);
}
delay (100);
#ifdef ARDUINO_ARCH_ESP8266
WiFi.setSleepMode ( (WiFiSleepType_t) sleep_mode);