mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-02 10:53:01 +02:00
fix empty password not saved and generated error
Need for open network
This commit is contained in:
@@ -326,7 +326,7 @@ bool COMMANDS::execute_internal_command (int cmd, String cmd_params, level_authe
|
|||||||
}
|
}
|
||||||
Preferences prefs;
|
Preferences prefs;
|
||||||
prefs.begin(NAMESPACE, false);
|
prefs.begin(NAMESPACE, false);
|
||||||
if (prefs.putString(AP_PWD_ENTRY, parameter) == 0){
|
if (prefs.putString(AP_PWD_ENTRY, parameter) != parameter.length()){
|
||||||
response = false;
|
response = false;
|
||||||
if(espresponse)espresponse->println ("Error: Set failed!");
|
if(espresponse)espresponse->println ("Error: Set failed!");
|
||||||
} else if(espresponse)espresponse->println ("ok");
|
} else if(espresponse)espresponse->println ("ok");
|
||||||
@@ -1223,7 +1223,7 @@ bool COMMANDS::execute_internal_command (int cmd, String cmd_params, level_authe
|
|||||||
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) && !((spos==AP_PWD_ENTRY) || (spos==STA_PWD_ENTRY))){
|
||||||
response = false;
|
response = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1281,7 +1281,7 @@ bool COMMANDS::execute_internal_command (int cmd, String cmd_params, level_authe
|
|||||||
}
|
}
|
||||||
//String value
|
//String value
|
||||||
if (styp == "S") {
|
if (styp == "S") {
|
||||||
if (prefs.putString(spos.c_str(), sval) == 0) {
|
if (prefs.putString(spos.c_str(), sval) != sval.length()) {
|
||||||
response = false;
|
response = false;
|
||||||
} else {
|
} else {
|
||||||
#if defined (ENABLE_WIFI)
|
#if defined (ENABLE_WIFI)
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
// Grbl versioning system
|
// Grbl versioning system
|
||||||
#define GRBL_VERSION "1.1f"
|
#define GRBL_VERSION "1.1f"
|
||||||
#define GRBL_VERSION_BUILD "20190518"
|
#define GRBL_VERSION_BUILD "20190622"
|
||||||
|
|
||||||
//#include <sdkconfig.h>
|
//#include <sdkconfig.h>
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
@@ -475,7 +475,7 @@ void WiFiConfig::reset_settings(){
|
|||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
sval = DEFAULT_STA_PWD;
|
sval = DEFAULT_STA_PWD;
|
||||||
if (prefs.putString(STA_PWD_ENTRY, sval) == 0){
|
if (prefs.putString(STA_PWD_ENTRY, sval) != sval.length()){
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
sval = DEFAULT_AP_SSID;
|
sval = DEFAULT_AP_SSID;
|
||||||
@@ -483,7 +483,7 @@ void WiFiConfig::reset_settings(){
|
|||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
sval = DEFAULT_AP_PWD;
|
sval = DEFAULT_AP_PWD;
|
||||||
if (prefs.putString(AP_PWD_ENTRY, sval) == 0){
|
if (prefs.putString(AP_PWD_ENTRY, sval) != sval.length()){
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user