jomjol 5 лет назад
Родитель
Сommit
13b5d93190

+ 5 - 3
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
+* spontaneous reboot, especially in case of intensive web server access
+* stuck in reboot loop
+* stopping automated tflite flow

+ 3 - 0
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"

+ 5 - 0
code/lib/jomjol_flowcontroll/ClassFlowControll.cpp

@@ -1,5 +1,6 @@
 #include "ClassFlowControll.h"
 
+#include "ClassLogFile.h"
 #include "Helper.h"
 
 std::vector<HTMLInfo*> 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;
 }
 

+ 4 - 0
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 <math.h>
@@ -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);

+ 7 - 7
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);    
 }
 
-ClassLogFile::ClassLogFile(std::string _logfile)
+void ClassLogFile::WriteToFile(std::string info, bool _time)
 {
-    logfile = _logfile;
+    WriteToDedicatedFile(logfile, info, _time);
 }
 
-ClassLogFile::~ClassLogFile()
+ClassLogFile::ClassLogFile(std::string _logfile)
 {
-}
+    logfile = _logfile;
+}

+ 1 - 2
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;

+ 10 - 6
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");
 }

BIN
firmware/bootloader.bin


BIN
firmware/firmware.bin