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) {
for (byte thisByte = 0; thisByte < 4; thisByte++) {
Serial.print(ipAddress[thisByte], DEC);
Serial.print(F("."));
if (thisByte < 3)
Serial.print(F("."));
}
Serial.println();
}
#endif
void printMACAddress() {
Serial.print(F("Configured MAC:"));
for (byte thisByte = 0; thisByte < 6; thisByte++) {
@@ -413,7 +409,7 @@ void onInitialStateInitLAN() {
Serial.println("WiFi connected");
Serial.println("IP address: ");
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());
if (!root) {
Serial.println(F("Config parsing failed"));
return -11; //Load from NVRAM
return READ_RE_CONFIG;//-11; //Load from NVRAM
} else {
Serial.println(F("Config OK, Applying"));
applyConfig();
@@ -983,7 +979,7 @@ lan_status getConfig(int arg_cnt, char **args)
} else {
Serial.printf("[HTTP] GET... failed, error: %s\n", httpClient.errorToString(httpResponseCode).c_str());
httpClient.end();
return -11; //Load from NVRAM
return READ_RE_CONFIG;//-11; //Load from NVRAM
}
httpClient.end();
#endif

View File

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

View File

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