diff --git a/README.md b/README.md index 81fcd949..ec8640e6 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,12 @@ Details can be found on the Wiki pages. ##### 0.1.0 (2020-08-07) -* Inital Version +* Initial Version -## Know-Bugs +## Known Issues -* spontaneous reboot, especially in case of intensive web server access \ No newline at end of file +* spontaneous reboot, especially in case of intensive web server access +* stuck in reboot loop +* stopping automated tflite flow \ No newline at end of file diff --git a/code/.helper/copy.bat b/code/.helper/copy.bat new file mode 100644 index 00000000..fdd8c7dd --- /dev/null +++ b/code/.helper/copy.bat @@ -0,0 +1,3 @@ +copy "C:\Users\Muell\Documents\Programmieren\GitHub\AI-on-the-edge-device\code\.pio\build\esp32cam\firmware.bin" "C:\Users\Muell\Documents\Programmieren\GitHub\AI-on-the-edge-device\firmware\firmware.bin" +copy "C:\Users\Muell\Documents\Programmieren\GitHub\AI-on-the-edge-device\code\.pio\build\esp32cam\bootloader.bin" "C:\Users\Muell\Documents\Programmieren\GitHub\AI-on-the-edge-device\firmware\bootloader.bin" +copy "C:\Users\Muell\Documents\Programmieren\GitHub\AI-on-the-edge-device\code\.pio\build\esp32cam\partitions.bin" "C:\Users\Muell\Documents\Programmieren\GitHub\AI-on-the-edge-device\firmware\partitions.bin" \ No newline at end of file diff --git a/code/lib/jomjol_flowcontroll/ClassFlowControll.cpp b/code/lib/jomjol_flowcontroll/ClassFlowControll.cpp index b62d84af..7bfdf9c2 100644 --- a/code/lib/jomjol_flowcontroll/ClassFlowControll.cpp +++ b/code/lib/jomjol_flowcontroll/ClassFlowControll.cpp @@ -1,5 +1,6 @@ #include "ClassFlowControll.h" +#include "ClassLogFile.h" #include "Helper.h" std::vector ClassFlowControll::GetAllDigital() @@ -112,7 +113,11 @@ bool ClassFlowControll::doFlow(string time) { bool result = true; for (int i = 0; i < FlowControll.size(); ++i) + { + string zw = "FlowControll.doFlow - " + FlowControll[i]->name(); + LogFile.WriteToFile(zw); result = result && FlowControll[i]->doFlow(time); + } return result; } diff --git a/code/lib/jomjol_image_proc/CFindTemplate.cpp b/code/lib/jomjol_image_proc/CFindTemplate.cpp index eed08d30..5d410ebb 100644 --- a/code/lib/jomjol_image_proc/CFindTemplate.cpp +++ b/code/lib/jomjol_image_proc/CFindTemplate.cpp @@ -1,5 +1,6 @@ #include "CFindTemplate.h" #include "Helper.h" +#include "ClassLogFile.h" #define _USE_MATH_DEFINES #include @@ -453,6 +454,9 @@ void CAlignAndCutImage::Align(std::string _template0, int ref0_x, int ref0_y, st delete imgzw; } + string zw = "dx: " + to_string(dx) + "dy: " + to_string(dy) + "d_winkel: " + to_string(d_winkel); + LogFile.WriteToDedicatedFile("/sdcard/alignment.txt", zw); + CRotate rt(this->rgb_image, this->channels, this->width, this->height, this->bpp); rt.Translate(dx, dy); rt.Rotate(d_winkel, ref0_x, ref0_y); diff --git a/code/lib/jomjol_logfile/ClassLogFile.cpp b/code/lib/jomjol_logfile/ClassLogFile.cpp index 1d88a23e..d0e5942a 100644 --- a/code/lib/jomjol_logfile/ClassLogFile.cpp +++ b/code/lib/jomjol_logfile/ClassLogFile.cpp @@ -3,13 +3,12 @@ ClassLogFile LogFile("/sdcard/log.txt"); -void ClassLogFile::WriteToFile(std::string info, bool _time) +void ClassLogFile::WriteToDedicatedFile(std::string _fn, std::string info, bool _time) { FILE* pFile; std::string zwtime; - - pFile = fopen(logfile.c_str(), "a+"); + pFile = fopen(_fn.c_str(), "a+"); if (_time) { @@ -31,11 +30,12 @@ void ClassLogFile::WriteToFile(std::string info, bool _time) fclose(pFile); } +void ClassLogFile::WriteToFile(std::string info, bool _time) +{ + WriteToDedicatedFile(logfile, info, _time); +} + ClassLogFile::ClassLogFile(std::string _logfile) { logfile = _logfile; -} - -ClassLogFile::~ClassLogFile() -{ -} +} \ No newline at end of file diff --git a/code/lib/jomjol_logfile/ClassLogFile.h b/code/lib/jomjol_logfile/ClassLogFile.h index ec0e1dd9..7b6e769e 100644 --- a/code/lib/jomjol_logfile/ClassLogFile.h +++ b/code/lib/jomjol_logfile/ClassLogFile.h @@ -5,13 +5,12 @@ class ClassLogFile { private: - /* data */ std::string logfile; public: ClassLogFile(std::string _logfile); - ~ClassLogFile(); void WriteToFile(std::string info, bool _time = true); + void WriteToDedicatedFile(std::string _fn, std::string info, bool _time = true); }; extern ClassLogFile LogFile; \ No newline at end of file diff --git a/code/src/main.cpp b/code/src/main.cpp index 031a1dec..09687d4d 100644 --- a/code/src/main.cpp +++ b/code/src/main.cpp @@ -115,6 +115,11 @@ extern "C" void app_main() initialise_wifi(ssid, password); + TickType_t xDelay; + xDelay = 2000 / portTICK_PERIOD_MS; + printf("Autoflow: sleep for : %ldms\n", (long) xDelay); + vTaskDelay( xDelay ); + setup_time(); LogFile.WriteToFile("===== Main Started ====="); @@ -122,7 +127,11 @@ extern "C" void app_main() printf("time %s\n", zw.c_str()); Camera.InitCam(); - Camera.LightOnOff(false); + Camera.LightOnOff(false); + xDelay = 2000 / portTICK_PERIOD_MS; + printf("Autoflow: sleep for : %ldms\n", (long) xDelay); + vTaskDelay( xDelay ); + server = start_webserver(); register_server_camera_uri(server); register_server_tflite_uri(server); @@ -131,9 +140,4 @@ extern "C" void app_main() register_server_main_uri(server, "/sdcard"); TFliteDoAutoStart(); - - zw = gettimestring("%Y%m%d-%H%M%S"); - printf("time %s\n", zw.c_str()); - - printf("Test für OTA-Update v3\n"); } diff --git a/firmware/bootloader.bin b/firmware/bootloader.bin index c4a46c65..83f718db 100644 Binary files a/firmware/bootloader.bin and b/firmware/bootloader.bin differ diff --git a/firmware/firmware.bin b/firmware/firmware.bin index 372ccbcf..8b170b45 100644 Binary files a/firmware/firmware.bin and b/firmware/firmware.bin differ