mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-11 23:49:02 +08:00
Fix open network connection (no password)
This commit is contained in:
parent
1d7b3ff83f
commit
4d6bac193a
@ -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") ) {
|
if (! (styp == "B" || styp == "S" || styp == "A" || styp == "I" || styp == "F") ) {
|
||||||
response = false;
|
response = false;
|
||||||
}
|
}
|
||||||
if (sval.length() == 0) {
|
if ((sval.length() == 0) && !((pos==EP_AP_PASSWORD) || (pos==EP_STA_PASSWORD))){
|
||||||
response = false;
|
response = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -692,10 +692,17 @@ bool CONFIG::write_string (int pos, const char * byte_buffer)
|
|||||||
maxsize = EEPROM_SIZE;
|
maxsize = EEPROM_SIZE;
|
||||||
break;
|
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")
|
LOG ("Error write string\r\n")
|
||||||
return false;
|
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)
|
//copy the value(s)
|
||||||
EEPROM.begin (EEPROM_SIZE);
|
EEPROM.begin (EEPROM_SIZE);
|
||||||
for (int i = 0; i < size_buffer; i++) {
|
for (int i = 0; i < size_buffer; i++) {
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//version and sources location
|
//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"
|
#define REPOSITORY "https://github.com/luc-github/ESP3D"
|
||||||
|
|
||||||
//Customize ESP3D ////////////////////////////////////////////////////////////////////////
|
//Customize ESP3D ////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -467,7 +467,11 @@ bool WIFI_CONFIG::Setup (bool force_ap)
|
|||||||
#else
|
#else
|
||||||
esp_wifi_set_protocol (ESP_IF_WIFI_STA, bflag);
|
esp_wifi_set_protocol (ESP_IF_WIFI_STA, bflag);
|
||||||
#endif
|
#endif
|
||||||
WiFi.begin (sbuf, pwd);
|
if (strlen(pwd) > 0){
|
||||||
|
WiFi.begin (sbuf, pwd);
|
||||||
|
} else {
|
||||||
|
WiFi.begin (sbuf);
|
||||||
|
}
|
||||||
delay (100);
|
delay (100);
|
||||||
#ifdef ARDUINO_ARCH_ESP8266
|
#ifdef ARDUINO_ARCH_ESP8266
|
||||||
WiFi.setSleepMode ( (WiFiSleepType_t) sleep_mode);
|
WiFi.setSleepMode ( (WiFiSleepType_t) sleep_mode);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user