From 49844e1d0cc3f9d1608a62cf53f4da493c5850dc Mon Sep 17 00:00:00 2001 From: strawmanbobi Date: Mon, 27 Jun 2022 14:18:39 +0800 Subject: [PATCH] made progress on iris-kit --- lib/AliyunIoTSDK/src/AliyunIoTSDK.cpp | 3 ++- platformio.ini | 4 ++-- src/IRBabyIRIS.cpp | 2 +- src/IRbaby.cpp | 2 ++ src/IRbabyHttp.cpp | 8 ++++---- src/IRbabyIR.cpp | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/AliyunIoTSDK/src/AliyunIoTSDK.cpp b/lib/AliyunIoTSDK/src/AliyunIoTSDK.cpp index dd04fdd..1db91d7 100644 --- a/lib/AliyunIoTSDK/src/AliyunIoTSDK.cpp +++ b/lib/AliyunIoTSDK/src/AliyunIoTSDK.cpp @@ -188,7 +188,7 @@ int AliyunIoTSDK::begin(Client &espClient, #if defined USE_STANDARD_THING_MODEL_TOPIC client->setCallback(callback); #endif - + Serial.print("connection check in begin\n"); return mqttCheckConnect(); } @@ -197,6 +197,7 @@ int AliyunIoTSDK::loop() { client->loop(); if (millis() - lastMs >= CHECK_INTERVAL) { lastMs = millis(); + Serial.print("connection check in loop\n"); mqttStatus = mqttCheckConnect(); } Serial.print("MQTT connect return: "); diff --git a/platformio.ini b/platformio.ini index 37e482e..36618b9 100644 --- a/platformio.ini +++ b/platformio.ini @@ -18,8 +18,8 @@ platform = espressif8266 framework = arduino monitor_speed = 115200 upload_speed = 115200 -upload_port = COM6 -monitor_port = COM6 +upload_port = COM5 +monitor_port = COM5 board_build.flash_mode = dout build_flags = -Wno-unused-function diff --git a/src/IRBabyIRIS.cpp b/src/IRBabyIRIS.cpp index 47e3490..b6008fd 100644 --- a/src/IRBabyIRIS.cpp +++ b/src/IRBabyIRIS.cpp @@ -65,7 +65,7 @@ event_handler_t event_handler_table[] = { handleHartBeat, }, { - "__emmitCode", + "__emitCode", handleEmit, } }; diff --git a/src/IRbaby.cpp b/src/IRbaby.cpp index 366612f..01b8f79 100644 --- a/src/IRbaby.cpp +++ b/src/IRbaby.cpp @@ -105,6 +105,8 @@ void setup() { iriskit_settings_loaded = true; } + INFOF("iriskit_settings_loaded ? %s\n", iriskit_settings_loaded ? "yes" : "no"); + // custom parameter for iris credentials WiFiManagerParameter* server_address = NULL; WiFiManagerParameter* credential_token = NULL; diff --git a/src/IRbabyHttp.cpp b/src/IRbabyHttp.cpp index f4e7a9f..33dfbf2 100644 --- a/src/IRbabyHttp.cpp +++ b/src/IRbabyHttp.cpp @@ -81,22 +81,22 @@ http_error_t downLoadFile(String url, String file, String path) { download_flag = true; break; } else { - ERRORF("HTTP response ERROR : %d\n", response_code); + ERRORF("http response error : %d\n", response_code); delay(HTTP_REQUEST_RETRY_INTERVAL); } } if (download_flag) { http_client.writeToStream(&cache); ret = HTTP_ERROR_SUCCESS; - DEBUGF("Download %s success\n", file.c_str()); + DEBUGF("download %s successfully\n", file.c_str()); } else { LittleFS.remove(save_path); ret = HTTP_ERROR_GENERIC; - ERRORF("Download %s failed\n", file.c_str()); + ERRORF("download %s failed\n", file.c_str()); } } else { ret = HTTP_ERROR_LOCAL_SPACE; - ERRORLN("Don't have enough file zoom"); + ERRORLN("there is not enough storage space for file"); } cache.close(); http_client.end(); diff --git a/src/IRbabyIR.cpp b/src/IRbabyIR.cpp index 61cfda0..ec68beb 100644 --- a/src/IRbabyIR.cpp +++ b/src/IRbabyIR.cpp @@ -33,7 +33,7 @@ #include "IRbabyIR.h" -#define SAVE_PATH "/bin/" +#define SAVE_PATH "/ir/" decode_results results; // Somewhere to store the results const uint8_t kTimeout = 50;