diff --git a/esp3d/command.cpp b/esp3d/command.cpp index c90ea6fc..afc25707 100644 --- a/esp3d/command.cpp +++ b/esp3d/command.cpp @@ -1132,6 +1132,7 @@ bool COMMAND::execute_command(int cmd,String cmd_params, tpipe output, level_aut if (!plain)BRIDGE::print(F("\"}"), output); } if (!plain)BRIDGE::print(F("]}"), output); + else BRIDGE::print(F("\n"), output); WiFi.scanDelete(); } break; @@ -1506,8 +1507,8 @@ if (CONFIG::GetFirmwareTarget() == SMOOTHIEWARE) { void COMMAND::read_buffer_serial(uint8_t *b, size_t len) { for (long i = 0; i< len; i++) { - read_buffer_serial(*b); - *b++; + read_buffer_serial(b[i]); + //*b++; } } diff --git a/esp3d/config.cpp b/esp3d/config.cpp index a7733620..1f9e804e 100644 --- a/esp3d/config.cpp +++ b/esp3d/config.cpp @@ -43,7 +43,7 @@ HardwareSerial Serial2(2); uint8_t CONFIG::FirmwareTarget = UNKNOWN_FW; bool CONFIG::SetFirmwareTarget(uint8_t fw){ - if ( fw >= 0 && fw <= MAX_FW_ID) { + if ( fw <= MAX_FW_ID) { FirmwareTarget = fw; return true; } else return false; @@ -748,7 +748,7 @@ bool CONFIG::isHostnameValid(const char * hostname) bool CONFIG::isSSIDValid(const char * ssid) { //limited size - char c; + //char c; if (strlen(ssid)>MAX_SSID_LENGTH || strlen(ssid)MAX_PASSWORD_LENGTH)|| (strlen(password)MAX_PASSWORD_LENGTH) { return false; } + #if MIN_PASSWORD_LENGTH > 0 + if (strlen(password) -1 || current_line.indexOf("T:") > -1 || current_line.indexOf("B:") > -1) { temp_counter++; } else { - } if (temp_counter > 5) { break; @@ -1456,9 +1458,9 @@ void CONFIG::print_config(tpipe output, bool plaintext) #endif if (!plaintext)BRIDGE::print(F("\"phy_mode\":\""), output); else BRIDGE::print(F("Phy Mode: "), output); - if (PhyMode == WIFI_PHY_MODE_11G )BRIDGE::print(F("11g"), output); - else if (PhyMode == WIFI_PHY_MODE_11B )BRIDGE::print(F("11b"), output); - else if (PhyMode == WIFI_PHY_MODE_11N )BRIDGE::print(F("11n"), output); + if (PhyMode == (WIFI_PHY_MODE_11G))BRIDGE::print(F("11g"), output); + else if (PhyMode == (WIFI_PHY_MODE_11B))BRIDGE::print(F("11b"), output); + else if (PhyMode == (WIFI_PHY_MODE_11N))BRIDGE::print(F("11n"), output); else BRIDGE::print(F("???"), output); if (!plaintext)BRIDGE::print(F("\","), output); else BRIDGE::print(F("\n"), output); diff --git a/esp3d/config.h b/esp3d/config.h index b3213407..99b82a4a 100644 --- a/esp3d/config.h +++ b/esp3d/config.h @@ -299,7 +299,7 @@ const char DEFAULT_USER_LOGIN [] PROGMEM = "user"; const char DEFAULT_TIME_SERVER1 [] PROGMEM = "time.nist.gov"; const char DEFAULT_TIME_SERVER2 [] PROGMEM = "0.pool.ntp.org"; const char DEFAULT_TIME_SERVER3 [] PROGMEM = "1.pool.ntp.org"; -#define DEFAULT_TIME_ZONE 1 +#define DEFAULT_TIME_ZONE 0 #define DEFAULT_TIME_DST 0 #define DEFAULT_PRIMARY_SD 1 #define DEFAULT_SECONDARY_SD 2 @@ -425,7 +425,6 @@ public: static char * mac2str(uint8_t mac [WL_MAC_ADDR_LENGTH]); static byte split_ip (const char * ptr,byte * part); static void esp_restart(); - static void flashfromSD(const char * Filename, int flashtype); private: static uint8_t FirmwareTarget; }; diff --git a/esp3d/webinterface.cpp b/esp3d/webinterface.cpp index 4359e062..3e8c0e15 100644 --- a/esp3d/webinterface.cpp +++ b/esp3d/webinterface.cpp @@ -93,7 +93,7 @@ void handle_web_interface_status() // static const char NO_TEMP_LINE[] PROGMEM = "\"temperature\":\"0\",\"target\":\"0\",\"active\":\"0\""; //we do not care if need authentication - just reset counter web_interface->is_authenticated(); - int tagpos,tagpos2; + //int tagpos,tagpos2; String buffer2send; String value; //start JSON answer @@ -1307,7 +1307,7 @@ void handle_web_command() count = 0; String current_buffer; String current_line; - int pos; + //int pos; int temp_counter = 0; String tmp; bool datasent = false; @@ -1327,7 +1327,7 @@ void handle_web_command() while (current_buffer.indexOf("\n") !=-1) { //remove the possible "\r" current_buffer.replace("\r",""); - pos = current_buffer.indexOf("\n"); + //pos = current_buffer.indexOf("\n"); //get line current_line = current_buffer.substring(0,current_buffer.indexOf("\n")); //if line is command ack - just exit so save the time out period @@ -1430,7 +1430,7 @@ void handle_web_command_silent() } #endif String cmd = ""; - int count ; + //int count ; if (web_interface->web_server.hasArg("plain") || web_interface->web_server.hasArg("commandText")) { if (web_interface->web_server.hasArg("plain")) { cmd = web_interface->web_server.arg("plain"); diff --git a/esp3d/wificonf.cpp b/esp3d/wificonf.cpp index 94d20797..de45a921 100644 --- a/esp3d/wificonf.cpp +++ b/esp3d/wificonf.cpp @@ -229,7 +229,7 @@ bool WIFI_CONFIG::Setup(bool force_ap) LOG("Disable STA\r\n") WiFi.enableSTA(false); delay(100); -LOG("Set phy mode\r\n") + LOG("Set phy mode\r\n") //setup PHY_MODE if (!CONFIG::read_byte(EP_AP_PHY_MODE, &bflag )) { return false; @@ -350,11 +350,10 @@ LOG("Set phy mode\r\n") //setup station mode WiFi.mode(WIFI_STA); delay(100); - WiFi.begin(sbuf, pwd); - delay(100); #ifdef ARDUINO_ARCH_ESP8266 WiFi.setPhyMode((WiFiPhyMode_t)bflag); #endif + WiFi.begin(sbuf, pwd); delay(100); byte i=0; //try to connect