mirror of
https://github.com/anklimov/lighthub
synced 2025-12-06 19:59:50 +03:00
esp8266 fix
This commit is contained in:
@@ -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);
|
||||
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
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
[platformio]
|
||||
src_dir = lighthub
|
||||
env_default =
|
||||
megaatmega2560
|
||||
; megaatmega2560
|
||||
; due
|
||||
; esp8266
|
||||
esp8266
|
||||
; megaatmega2560-5500
|
||||
; due-5500
|
||||
; controllino
|
||||
|
||||
Reference in New Issue
Block a user