made progress on iris-kit
This commit is contained in:
@@ -188,7 +188,7 @@ int AliyunIoTSDK::begin(Client &espClient,
|
|||||||
#if defined USE_STANDARD_THING_MODEL_TOPIC
|
#if defined USE_STANDARD_THING_MODEL_TOPIC
|
||||||
client->setCallback(callback);
|
client->setCallback(callback);
|
||||||
#endif
|
#endif
|
||||||
|
Serial.print("connection check in begin\n");
|
||||||
return mqttCheckConnect();
|
return mqttCheckConnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,6 +197,7 @@ int AliyunIoTSDK::loop() {
|
|||||||
client->loop();
|
client->loop();
|
||||||
if (millis() - lastMs >= CHECK_INTERVAL) {
|
if (millis() - lastMs >= CHECK_INTERVAL) {
|
||||||
lastMs = millis();
|
lastMs = millis();
|
||||||
|
Serial.print("connection check in loop\n");
|
||||||
mqttStatus = mqttCheckConnect();
|
mqttStatus = mqttCheckConnect();
|
||||||
}
|
}
|
||||||
Serial.print("MQTT connect return: ");
|
Serial.print("MQTT connect return: ");
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ platform = espressif8266
|
|||||||
framework = arduino
|
framework = arduino
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
upload_speed = 115200
|
upload_speed = 115200
|
||||||
upload_port = COM6
|
upload_port = COM5
|
||||||
monitor_port = COM6
|
monitor_port = COM5
|
||||||
board_build.flash_mode = dout
|
board_build.flash_mode = dout
|
||||||
build_flags =
|
build_flags =
|
||||||
-Wno-unused-function
|
-Wno-unused-function
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ event_handler_t event_handler_table[] = {
|
|||||||
handleHartBeat,
|
handleHartBeat,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__emmitCode",
|
"__emitCode",
|
||||||
handleEmit,
|
handleEmit,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -105,6 +105,8 @@ void setup() {
|
|||||||
iriskit_settings_loaded = true;
|
iriskit_settings_loaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INFOF("iriskit_settings_loaded ? %s\n", iriskit_settings_loaded ? "yes" : "no");
|
||||||
|
|
||||||
// custom parameter for iris credentials
|
// custom parameter for iris credentials
|
||||||
WiFiManagerParameter* server_address = NULL;
|
WiFiManagerParameter* server_address = NULL;
|
||||||
WiFiManagerParameter* credential_token = NULL;
|
WiFiManagerParameter* credential_token = NULL;
|
||||||
|
|||||||
@@ -81,22 +81,22 @@ http_error_t downLoadFile(String url, String file, String path) {
|
|||||||
download_flag = true;
|
download_flag = true;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
ERRORF("HTTP response ERROR : %d\n", response_code);
|
ERRORF("http response error : %d\n", response_code);
|
||||||
delay(HTTP_REQUEST_RETRY_INTERVAL);
|
delay(HTTP_REQUEST_RETRY_INTERVAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (download_flag) {
|
if (download_flag) {
|
||||||
http_client.writeToStream(&cache);
|
http_client.writeToStream(&cache);
|
||||||
ret = HTTP_ERROR_SUCCESS;
|
ret = HTTP_ERROR_SUCCESS;
|
||||||
DEBUGF("Download %s success\n", file.c_str());
|
DEBUGF("download %s successfully\n", file.c_str());
|
||||||
} else {
|
} else {
|
||||||
LittleFS.remove(save_path);
|
LittleFS.remove(save_path);
|
||||||
ret = HTTP_ERROR_GENERIC;
|
ret = HTTP_ERROR_GENERIC;
|
||||||
ERRORF("Download %s failed\n", file.c_str());
|
ERRORF("download %s failed\n", file.c_str());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ret = HTTP_ERROR_LOCAL_SPACE;
|
ret = HTTP_ERROR_LOCAL_SPACE;
|
||||||
ERRORLN("Don't have enough file zoom");
|
ERRORLN("there is not enough storage space for file");
|
||||||
}
|
}
|
||||||
cache.close();
|
cache.close();
|
||||||
http_client.end();
|
http_client.end();
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include "IRbabyIR.h"
|
#include "IRbabyIR.h"
|
||||||
|
|
||||||
#define SAVE_PATH "/bin/"
|
#define SAVE_PATH "/ir/"
|
||||||
|
|
||||||
decode_results results; // Somewhere to store the results
|
decode_results results; // Somewhere to store the results
|
||||||
const uint8_t kTimeout = 50;
|
const uint8_t kTimeout = 50;
|
||||||
|
|||||||
Reference in New Issue
Block a user