esp8266 fix

This commit is contained in:
livello
2018-06-29 01:03:19 +03:00
parent 21da448e93
commit 483454d9f6
3 changed files with 9 additions and 13 deletions

View File

@@ -182,18 +182,14 @@ void mqttCallback(char *topic, byte *payload, unsigned int length) {
} }
#ifndef __ESP__
void printIPAddress(IPAddress ipAddress) { void printIPAddress(IPAddress ipAddress) {
for (byte thisByte = 0; thisByte < 4; thisByte++) { for (byte thisByte = 0; thisByte < 4; thisByte++) {
Serial.print(ipAddress[thisByte], DEC); Serial.print(ipAddress[thisByte], DEC);
if (thisByte < 3)
Serial.print(F(".")); Serial.print(F("."));
} }
Serial.println();
} }
#endif
void printMACAddress() { void printMACAddress() {
Serial.print(F("Configured MAC:")); Serial.print(F("Configured MAC:"));
for (byte thisByte = 0; thisByte < 6; thisByte++) { for (byte thisByte = 0; thisByte < 6; thisByte++) {
@@ -413,7 +409,7 @@ void onInitialStateInitLAN() {
Serial.println("WiFi connected"); Serial.println("WiFi connected");
Serial.println("IP address: "); Serial.println("IP address: ");
Serial.println(WiFi.localIP()); Serial.println(WiFi.localIP());
lanStatus=1; lanStatus=HAVE_IP_ADDRESS;//1;
} }
@@ -974,7 +970,7 @@ lan_status getConfig(int arg_cnt, char **args)
root = aJson.parse((char *) response.c_str()); root = aJson.parse((char *) response.c_str());
if (!root) { if (!root) {
Serial.println(F("Config parsing failed")); Serial.println(F("Config parsing failed"));
return -11; //Load from NVRAM return READ_RE_CONFIG;//-11; //Load from NVRAM
} else { } else {
Serial.println(F("Config OK, Applying")); Serial.println(F("Config OK, Applying"));
applyConfig(); applyConfig();
@@ -983,7 +979,7 @@ lan_status getConfig(int arg_cnt, char **args)
} else { } else {
Serial.printf("[HTTP] GET... failed, error: %s\n", httpClient.errorToString(httpResponseCode).c_str()); Serial.printf("[HTTP] GET... failed, error: %s\n", httpClient.errorToString(httpResponseCode).c_str());
httpClient.end(); httpClient.end();
return -11; //Load from NVRAM return READ_RE_CONFIG;//-11; //Load from NVRAM
} }
httpClient.end(); httpClient.end();
#endif #endif

View File

@@ -115,11 +115,11 @@ enum lan_status {
void mqttCallback(char *topic, byte *payload, unsigned int length); void mqttCallback(char *topic, byte *payload, unsigned int length);
#ifndef __ESP__ //#ifndef __ESP__
void printIPAddress(IPAddress ipAddress); void printIPAddress(IPAddress ipAddress);
#endif //#endif
void printMACAddress(); void printMACAddress();

View File

@@ -10,9 +10,9 @@
[platformio] [platformio]
src_dir = lighthub src_dir = lighthub
env_default = env_default =
megaatmega2560 ; megaatmega2560
; due ; due
; esp8266 esp8266
; megaatmega2560-5500 ; megaatmega2560-5500
; due-5500 ; due-5500
; controllino ; controllino