Просмотр исходного кода

Merge pull request #70 from jomjol/rolling

Update to v5.0.0
jomjol 5 лет назад
Родитель
Сommit
bcdd0c66c0
49 измененных файлов с 846 добавлено и 76 удалено
  1. 1 0
      .gitignore
  2. 7 0
      README.md
  3. 138 2
      code/components/connect_wlan/connect_wlan.cpp
  4. 5 0
      code/components/connect_wlan/connect_wlan.h
  5. 20 0
      code/components/jomjol_controlcamera/ClassControllCamera.cpp
  6. 1 0
      code/components/jomjol_controlcamera/ClassControllCamera.h
  7. 24 3
      code/components/jomjol_flowcontroll/ClassFlowControll.cpp
  8. 3 2
      code/components/jomjol_flowcontroll/ClassFlowControll.h
  9. 3 1
      code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp
  10. 13 0
      code/components/jomjol_tfliteclass/server_tflite.cpp
  11. 3 1
      code/components/jomjol_tfliteclass/server_tflite.h
  12. 4 37
      code/components/jomjol_time_sntp/time_sntp.cpp
  13. 0 4
      code/components/jomjol_time_sntp/time_sntp.h
  14. 1 1
      code/main/CMakeLists.txt
  15. 0 0
      code/main/favicon.ico
  16. 0 0
      code/main/gitversion.cmake
  17. 19 1
      code/main/main.cpp
  18. 10 1
      code/main/server_main.cpp
  19. 0 0
      code/main/server_main.h
  20. 4 0
      code/main/version.cpp
  21. 0 0
      code/main/version.h
  22. 5 1
      code/platformio.ini
  23. 6 6
      code/sdkconfig
  24. 4 4
      code/sdkconfig.old
  25. 0 4
      code/src/version.cpp
  26. 3 3
      code/version.cpp
  27. BIN
      firmware/bootloader.bin
  28. BIN
      firmware/firmware.bin
  29. BIN
      firmware/html.zip
  30. 1 0
      sd-card/config/config.ini
  31. BIN
      sd-card/html/cnn_images.jpg
  32. 1 0
      sd-card/html/debug.log
  33. 66 0
      sd-card/html/edit_explain_0.html
  34. 81 0
      sd-card/html/edit_explain_6.html
  35. 1 1
      sd-card/html/edit_reference.html
  36. 29 0
      sd-card/html/explain_0.html
  37. 33 0
      sd-card/html/explain_1.html
  38. 36 0
      sd-card/html/explain_2.html
  39. 37 0
      sd-card/html/explain_3.html
  40. 37 0
      sd-card/html/explain_4.html
  41. 35 0
      sd-card/html/explain_5.html
  42. 27 0
      sd-card/html/explain_6.html
  43. BIN
      sd-card/html/flow_overview.jpg
  44. 2 2
      sd-card/html/gethost.js
  45. 1 0
      sd-card/html/index.html
  46. 3 1
      sd-card/html/readconfigparam.js
  47. 40 0
      sd-card/html/setup - Kopie.html
  48. 141 0
      sd-card/html/setup.html
  49. 1 1
      sd-card/html/version.txt

+ 1 - 0
.gitignore

@@ -4,6 +4,7 @@
 .code-workspace
 .helper/
 /sd-card/htm./.vscode/
+/code/build
 
 CMakeLists.txt.user
 CMakeCache.txt

+ 7 - 0
README.md

@@ -25,6 +25,13 @@ A 3d-printable housing can be found here: https://www.thingiverse.com/thing:4571
 
 **General remark:** Beside the `firmware.bin`, typically also the content of `/html` needs to be updated!
 
+##### 5.0.0 Setup Modus - (2020-12-06)
+
+* Implementation of intial setup modus for fresh installation
+
+* Code restructuring (full compatibility between pure ESP-IDF and Platformio w/ espressif)
+  
+
 ##### 4.1.1 Configuration editor - (2020-12-02)
 
 * Bug fixing: internal improvement of file handling (reduce not responding)

+ 138 - 2
code/components/connect_wlan/connect_wlan.cpp

@@ -11,6 +11,10 @@
 #include <fstream>
 #include <string>
 #include <vector>
+#include <sstream>
+#include <iostream>
+
+#include <arpa/inet.h>
 
 #include "Helper.h"
 
@@ -23,6 +27,9 @@ std::string ssid;
 std::string passphrase;
 std::string hostname;
 std::string ipaddress;
+std::string gw;
+std::string netmask;
+std::string dns;
 
 std::string std_hostname = "watermeter";
 
@@ -86,7 +93,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event)
 {
     switch(event->event_id) {
     case SYSTEM_EVENT_STA_START:
-        blinkstatus(200, 5);
+        blinkstatus(200, 1);
         wifi_connect();
         break;
     case SYSTEM_EVENT_STA_GOT_IP:
@@ -125,10 +132,97 @@ void initialise_wifi(std::string _ssid, std::string _passphrase, std::string _ho
     tcpip_adapter_ip_info_t ip_info;
     ESP_ERROR_CHECK(tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ip_info));
     ipaddress = std::string(ip4addr_ntoa(&ip_info.ip));
+    netmask = std::string(ip4addr_ntoa(&ip_info.netmask));
+    gw = std::string(ip4addr_ntoa(&ip_info.gw));
     printf("IPv4 :  %s\n", ip4addr_ntoa(&ip_info.ip));
     printf("HostName :  %s\n", hostname.c_str());
 }
 
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+void strinttoip4(std::string ip, int &a, int &b, int &c, int &d) {
+    std::stringstream s(ip);
+    char ch; //to temporarily store the '.'
+    s >> a >> ch >> b >> ch >> c >> ch >> d;
+}
+
+void initialise_wifi_fixed_ip(std::string _ip, std::string _gw, std::string _netmask, std::string _ssid, std::string _passphrase, std::string _hostname, std::string _dns)
+{
+
+    ssid = _ssid;
+    passphrase = _passphrase;
+    hostname = _hostname;
+    dns = _dns;
+
+    wifi_event_group = xEventGroupCreate();
+
+    ESP_ERROR_CHECK(esp_netif_init());
+    ESP_ERROR_CHECK(esp_event_loop_create_default());
+
+    esp_netif_t *my_sta = esp_netif_create_default_wifi_sta();
+
+    esp_netif_dhcpc_stop(my_sta);
+
+    esp_netif_ip_info_t ip_info;
+
+    int a, b, c, d;
+
+    strinttoip4(_ip, a, b, c, d);
+    IP4_ADDR(&ip_info.ip, a, b, c, d);
+
+    strinttoip4(_gw, a, b, c, d);
+   	IP4_ADDR(&ip_info.gw, a, b, c, d);
+
+    strinttoip4(_netmask, a, b, c, d);
+   	IP4_ADDR(&ip_info.netmask, a, b, c, d);
+
+    esp_netif_set_ip_info(my_sta, &ip_info);
+
+    wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
+    ESP_ERROR_CHECK(esp_wifi_init(&cfg));
+
+    if (dns.length() > 0) {
+        esp_netif_dns_info_t dns_info;
+        ip4_addr_t ip;
+        ip.addr = esp_ip4addr_aton(dns.c_str());
+        ip_addr_set_ip4_u32(&dns_info.ip, ip.addr);
+        ESP_ERROR_CHECK(esp_netif_set_dns_info(my_sta, ESP_NETIF_DNS_MAIN, &dns_info));
+    }
+
+    ESP_ERROR_CHECK(esp_event_loop_init(event_handler, NULL) );
+
+    wifi_config_t wifi_config = { };
+    strcpy((char*)wifi_config.sta.ssid, (const char*)ssid.c_str());
+    strcpy((char*)wifi_config.sta.password, (const char*)passphrase.c_str());
+
+    ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) );
+    ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) );
+    ESP_ERROR_CHECK(esp_wifi_start() );
+
+    ESP_LOGI(MAIN_TAG, "wifi_init_sta finished.");
+
+    EventBits_t bits = xEventGroupWaitBits(wifi_event_group,CONNECTED_BIT,true,true,portMAX_DELAY);
+
+    if (bits & CONNECTED_BIT) {
+        ESP_LOGI(MAIN_TAG, "connected to ap SSID:%s password:%s",
+                 ssid.c_str(), passphrase.c_str());
+    } else  {
+        ESP_LOGI(MAIN_TAG, "Failed to connect to SSID:%s, password:%s",
+                 ssid.c_str(), passphrase.c_str());
+    }
+    tcpip_adapter_ip_info_t ip_info2;
+    ESP_ERROR_CHECK(tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ip_info2));
+    ipaddress = std::string(ip4addr_ntoa(&ip_info2.ip));
+    netmask = std::string(ip4addr_ntoa(&ip_info2.netmask));
+    gw = std::string(ip4addr_ntoa(&ip_info2.gw));
+
+    vEventGroupDelete(wifi_event_group);
+}
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+//void LoadWlanFromFile(std::string fn, std::string &_ssid, std::string &_passphrase, std::string &_hostname, std::string &_ip, std::string &_gw, std::string &_netmask, std::string &_dns)
 
 void LoadWlanFromFile(std::string fn, std::string &_ssid, std::string &_passphrase, std::string &_hostname)
 {
@@ -140,6 +234,8 @@ void LoadWlanFromFile(std::string fn, std::string &_ssid, std::string &_passphra
     fn = FormatFileName(fn);
     pFile = fopen(fn.c_str(), "r");
 
+    printf("file loaded\n");
+
     if (pFile == NULL)
         return;
 
@@ -149,7 +245,7 @@ void LoadWlanFromFile(std::string fn, std::string &_ssid, std::string &_passphra
 
     while ((line.size() > 0) || !(feof(pFile)))
     {
-//        printf("%s", line.c_str());
+        printf("%s", line.c_str());
         zerlegt = ZerlegeZeile(line, "=");
         zerlegt[0] = trim(zerlegt[0], " ");
 
@@ -174,6 +270,37 @@ void LoadWlanFromFile(std::string fn, std::string &_ssid, std::string &_passphra
             }
         }
 
+/*
+        if ((zerlegt.size() > 1) && (toUpper(zerlegt[0]) == "IP")){
+            _ip = zerlegt[1];
+            if ((_ip[0] == '"') && (_ip[_ip.length()-1] == '"')){
+                _ip = _ip.substr(1, _ip.length()-2);
+            }
+        }
+
+        if ((zerlegt.size() > 1) && (toUpper(zerlegt[0]) == "GATEWAY")){
+            _gw = zerlegt[1];
+            if ((_gw[0] == '"') && (_gw[_gw.length()-1] == '"')){
+                _gw = _gw.substr(1, _gw.length()-2);
+            }
+        }
+
+        if ((zerlegt.size() > 1) && (toUpper(zerlegt[0]) == "NETMASK")){
+            _netmask = zerlegt[1];
+            if ((_netmask[0] == '"') && (_netmask[_netmask.length()-1] == '"')){
+                _netmask = _netmask.substr(1, _netmask.length()-2);
+            }
+        }
+
+        if ((zerlegt.size() > 1) && (toUpper(zerlegt[0]) == "DNS")){
+            _dns = zerlegt[1];
+            if ((_dns[0] == '"') && (_dns[_dns.length()-1] == '"')){
+                _dns = _dns.substr(1, _dns.length()-2);
+            }
+        }
+*/
+
+
         if (fgets(zw, 1024, pFile) == NULL)
         {
             line = "";
@@ -204,3 +331,12 @@ std::string getIPAddress(){
 std::string getSSID(){
     return ssid;
 }
+
+std::string getNetMask(){
+    return netmask;
+}
+
+std::string getGW(){
+    return gw;
+}
+

+ 5 - 0
code/components/connect_wlan/connect_wlan.h

@@ -7,11 +7,16 @@
 const int CONNECTED_BIT = BIT0;
 
 void initialise_wifi(std::string _ssid, std::string _passphrase, std::string _hostname);
+void initialise_wifi_fixed_ip(std::string _ip, std::string _gw, std::string _netmask, std::string _ssid, std::string _passphrase, std::string _hostname, std::string _dns = "");
+
 
 void LoadWlanFromFile(std::string fn, std::string &_ssid, std::string &_passphrase, std::string &_hostname);
+void LoadNetConfigFromFile(std::string &_ip, std::string &_gw, std::string &_netmask, std::string &_dns);
 
 std::string getHostname();
 std::string getIPAddress();
 std::string getSSID();
+std::string getNetMask();
+std::string getGW();
 
 #endif

+ 20 - 0
code/components/jomjol_controlcamera/ClassControllCamera.cpp

@@ -137,6 +137,7 @@ CCamera Camera;
 
 
 #define FLASH_GPIO GPIO_NUM_4
+#define BLINK_GPIO GPIO_NUM_33
 
 typedef struct {
         httpd_req_t *req;
@@ -207,6 +208,8 @@ esp_err_t CCamera::CaptureToFile(std::string nm, int delay)
 //    nm =  "/sdcard/josef_zw.bmp";
     string ftype;
 
+    LEDOnOff(true);
+
     if (delay > 0) 
     {
         LightOnOff(true);
@@ -217,8 +220,11 @@ esp_err_t CCamera::CaptureToFile(std::string nm, int delay)
     camera_fb_t * fb = esp_camera_fb_get();
     if (!fb) {
         ESP_LOGE(TAGCAMERACLASS, "Camera Capture Failed");
+        LEDOnOff(false);
         return ESP_FAIL;
     }
+    LEDOnOff(false);    
+    
     printf("w %d, h %d, size %d\n", fb->width, fb->height, fb->len);
 
     nm = FormatFileName(nm);
@@ -322,6 +328,20 @@ void CCamera::LightOnOff(bool status)
         gpio_set_level(FLASH_GPIO, 0);      
 }
 
+void CCamera::LEDOnOff(bool status)
+{
+	// Init the GPIO
+    gpio_pad_select_gpio(BLINK_GPIO);
+    /* Set the GPIO as a push/pull output */
+    gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT);  
+
+    if (!status)  
+        gpio_set_level(BLINK_GPIO, 1);
+    else
+        gpio_set_level(BLINK_GPIO, 0);      
+}
+
+
 void CCamera::GetCameraParameter(httpd_req_t *req, int &qual, framesize_t &resol)
 {
     char _query[100];

+ 1 - 0
code/components/jomjol_controlcamera/ClassControllCamera.h

@@ -28,6 +28,7 @@ class CCamera {
         esp_err_t InitCam();
 
         void LightOnOff(bool status);
+        void LEDOnOff(bool status);
         esp_err_t CaptureToHTTP(httpd_req_t *req, int delay = 0);
         void SetQualitySize(int qual, framesize_t resol);
         void GetCameraParameter(httpd_req_t *req, int &qual, framesize_t &resol);

+ 24 - 3
code/components/jomjol_flowcontroll/ClassFlowControll.cpp

@@ -66,6 +66,7 @@ std::vector<HTMLInfo*> ClassFlowControll::GetAllAnalog()
 void ClassFlowControll::SetInitialParameter(void)
 {
     AutoStart = false;
+    SetupModeActive = false;
     AutoIntervall = 10;
 }
 
@@ -156,6 +157,22 @@ std::string ClassFlowControll::getActStatus(){
     return aktstatus;
 }
 
+void ClassFlowControll::doFlowMakeImageOnly(string time){
+    bool result = true;
+    std::string zw_time;
+    int repeat = 0;
+
+    for (int i = 0; i < FlowControll.size(); ++i)
+    {
+        if (FlowControll[i]->name() == "ClassFlowMakeImage") {
+            zw_time = gettimestring("%Y%m%d-%H%M%S");
+            aktstatus = zw_time + ": " + FlowControll[i]->name();
+            string zw = "FlowControll.doFlowMakeImageOnly - " + FlowControll[i]->name();
+            FlowControll[i]->doFlow(time);
+        }
+    }
+}
+
 bool ClassFlowControll::doFlow(string time)
 {
 //    CleanTempFolder();            // dazu muss man noch eine Rolling einführen
@@ -303,12 +320,16 @@ bool ClassFlowControll::ReadParameter(FILE* pfile, string& aktparamgraph)
             setTimeZone(zerlegt[1]);
         }      
 
-        if ((toUpper(zerlegt[0]) == "TIMEUPDATEINTERVALL") && (zerlegt.size() > 1))
+        if ((toUpper(zerlegt[0]) == "SETUPMODE") && (zerlegt.size() > 1))
         {
-            TimeUpdateIntervall = stof(zerlegt[1]);
-            xTaskCreate(&task_doTimeSync, "update_time", configMINIMAL_STACK_SIZE * 16, &TimeUpdateIntervall, tskIDLE_PRIORITY, NULL);
+            if (toUpper(zerlegt[1]) == "TRUE")
+            {
+                SetupModeActive = true;
+            }        
         }      
 
+
+
     }
     return true;
 }

+ 3 - 2
code/components/jomjol_flowcontroll/ClassFlowControll.h

@@ -21,14 +21,15 @@ protected:
 
 	bool AutoStart;
 	float AutoIntervall;
+	bool SetupModeActive;
 	void SetInitialParameter(void);	
 	std::string aktstatus;
-	int TimeUpdateIntervall;
-
 
 public:
 	void InitFlow(std::string config);
 	bool doFlow(string time);
+	void doFlowMakeImageOnly(string time);
+	bool getStatusSetupModus(){return SetupModeActive;};
 	string getReadout(bool _rawvalue, bool _noerror);
 	string UpdatePrevalue(std::string _newvalue);
 	string GetPrevalue();	

+ 3 - 1
code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp

@@ -313,7 +313,6 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
 
     ReturnRawValue = ShiftDecimal(ReturnRawValue, DecimalShift);   
 
-
     if (!PreValueUse || !PreValueOkay)
     {
         ReturnValue = ReturnRawValue;
@@ -391,6 +390,9 @@ string ClassFlowPostProcessing::getReadoutParam(bool _rawValue, bool _noerror)
 
 string ClassFlowPostProcessing::RundeOutput(float _in, int _anzNachkomma){
     std::stringstream stream;
+    if (_anzNachkomma < 0) {
+        _anzNachkomma = 0;
+    }
     stream << std::fixed << std::setprecision(_anzNachkomma) << _in;
     return stream.str();  
 }

+ 13 - 0
code/components/jomjol_tfliteclass/server_tflite.cpp

@@ -29,6 +29,12 @@ bool flowisrunning = false;
 long auto_intervall = 0;
 bool auto_isrunning = false;
 
+bool isSetupModusActive() {
+    return tfliteflow.getStatusSetupModus();
+    return false;
+}
+
+
 void KillTFliteTasks()
 {
     printf("Handle: xHandleblink_task_doFlow: %ld\n", (long) xHandleblink_task_doFlow);    
@@ -419,6 +425,13 @@ void task_autodoFlow(void *pvParameter)
     
     auto_isrunning = tfliteflow.isAutoStart(auto_intervall);
 
+    if (isSetupModusActive()) {
+        auto_isrunning = false;
+        std::string zw_time = gettimestring(LOGFILE_TIME_FORMAT);
+        tfliteflow.doFlowMakeImageOnly(zw_time);
+
+    }
+
     while (auto_isrunning)
     {
         LogFile.WriteToFile("task_autodoFlow - next round"); 

+ 3 - 1
code/components/jomjol_tfliteclass/server_tflite.h

@@ -10,4 +10,6 @@ void register_server_tflite_uri(httpd_handle_t server);
 
 void KillTFliteTasks();
 
-void TFliteDoAutoStart();
+void TFliteDoAutoStart();
+
+bool isSetupModusActive();

+ 4 - 37
code/components/jomjol_time_sntp/time_sntp.cpp

@@ -29,17 +29,13 @@ RTC_DATA_ATTR int boot_count = 0;
 
 bool setTimeAlwaysOnReboot = true;
 
-/* Variable holding number of times ESP32 restarted since first boot.
- * It is placed into RTC memory using RTC_DATA_ATTR and
- * maintains its value when ESP32 wakes from deep sleep.
- */
-
 static void obtain_time(void);
 static void initialize_sntp(void);
 
 
 void time_sync_notification_cb(struct timeval *tv)
 {
+//    LogFile.WriteToFile("Notification of a time synchronization event");
     ESP_LOGI(TAG, "Notification of a time synchronization event");
 }
 
@@ -115,11 +111,11 @@ static void obtain_time(void)
         vTaskDelay(2000 / portTICK_PERIOD_MS);
     }
     if (retry == retry_count) {
-        LogFile.WriteToFile("Time Synchzronisation nicht erfolgreich ...");
+//        LogFile.WriteToFile("Time Synchzronisation nicht erfolgreich ...");
     }
     else
     {
-        LogFile.WriteToFile("Time erfolgreich ...");
+//        LogFile.WriteToFile("Time erfolgreich ...");
     }
     
     time(&now);
@@ -131,35 +127,6 @@ static void initialize_sntp(void)
     ESP_LOGI(TAG, "Initializing SNTP");
     sntp_setoperatingmode(SNTP_OPMODE_POLL);
     sntp_setservername(0, "pool.ntp.org");
-    sntp_set_time_sync_notification_cb(time_sync_notification_cb);
+//    sntp_set_time_sync_notification_cb(time_sync_notification_cb);
     sntp_init();
-}
-
-
-void task_doTimeSync(void *pvParameter)
-{
-    time_t now;
-    struct tm timeinfo;
-    char strftime_buf[64];    
-    int *zw_int = (int*) pvParameter;
-
-    printf("Start Autoupdate Time every: %d Stunden\n", *zw_int );
-    TickType_t xDelay = ((*zw_int) * 60 * 60 * 1000)  / portTICK_PERIOD_MS;
-
-    while (1)
-    {
-        obtain_time();
-        localtime_r(&now, &timeinfo);
-        strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo);
-        ESP_LOGI(TAG, "The current date/time in Berlin is: %s", strftime_buf);
-
-        strftime(strftime_buf, sizeof(strftime_buf), "%Y-%m-%d_%H:%M", &timeinfo);
-        ESP_LOGI(TAG, "The current date/time in Berlin is: %s", strftime_buf);
-
-        std::string zw = gettimestring("%Y%m%d-%H%M%S");
-        printf("time %s\n", zw.c_str());        
-
-        vTaskDelay( xDelay );  
-    }
-    vTaskDelete(NULL); //Delete this task if it exits from the loop above
 }

+ 0 - 4
code/components/jomjol_time_sntp/time_sntp.h

@@ -12,11 +12,7 @@
 // #include "nvs_flash.h"
 #include "esp_sntp.h"
 
-
-extern int boot_count;
-
 void setup_time(void);
 
 std::string gettimestring(const char * frm);
-void task_doTimeSync(void *pvParameter);
 void setTimeZone(std::string _tzstring);

+ 1 - 1
code/src/CMakeLists.txt → code/main/CMakeLists.txt

@@ -53,7 +53,7 @@ endif()
 #######################################################################
 
 
-FILE(GLOB_RECURSE app_sources ${CMAKE_SOURCE_DIR}/src/*.*)
+FILE(GLOB_RECURSE app_sources ${CMAKE_SOURCE_DIR}/main/*.*)
 
 # idf_component_register(SRCS ${app_sources})
 

+ 0 - 0
code/src/favicon.ico → code/main/favicon.ico


+ 0 - 0
code/src/gitversion.cmake → code/main/gitversion.cmake


+ 19 - 1
code/src/main.cpp → code/main/main.cpp

@@ -81,13 +81,31 @@ extern "C" void app_main(void)
     std::string ssid = "";
     std::string password = "";
     std::string hostname = "";
+    std::string ip = "";
+    std::string gw = "";
+    std::string netmask = "";
+    std::string dns = "";
 
+//    LoadWlanFromFile("/sdcard/wlan.ini", ssid, password, hostname, ip, gw, netmask, dns); 
     LoadWlanFromFile("/sdcard/wlan.ini", ssid, password, hostname); 
+
 //    LogFile.WriteToFile("Startsequence 04");    
     printf("To use WLan: %s, %s\n", ssid.c_str(), password.c_str());
     printf("To set Hostename: %s\n", hostname.c_str());
+    printf("Fixed IP: %s, Gateway %s, Netmask %s\n", ip.c_str(), gw.c_str(), netmask.c_str());
    
-    initialise_wifi(ssid, password, hostname);
+    if (ip.length() == 0 || gw.length() == 0 || netmask.length() == 0)
+    {
+        initialise_wifi(ssid, password, hostname);    
+    }
+    else
+    {
+        initialise_wifi_fixed_ip(ip, gw, netmask, ssid, password, hostname, dns);
+    }
+
+    printf("Netparameter: IP: %s - GW: %s - NetMask %s\n", getIPAddress().c_str(), getGW().c_str(), getNetMask().c_str());
+    
+
 //    LogFile.WriteToFile("Startsequence 05");  
 
     TickType_t xDelay;

+ 10 - 1
code/src/server_main.cpp → code/main/server_main.cpp

@@ -13,6 +13,8 @@
 
 #include "esp_wifi.h"
 
+#include "server_tflite.h"
+
 
 httpd_handle_t server = NULL;   
 
@@ -152,7 +154,9 @@ esp_err_t hello_main_handler(httpd_req_t *req)
 
     if ((strcmp(req->uri, "/") == 0))
     {
-        filetosend = filetosend + "/html/index.html";
+        {
+            filetosend = filetosend + "/html/index.html";
+        }
     }
     else
     {
@@ -163,6 +167,11 @@ esp_err_t hello_main_handler(httpd_req_t *req)
         }
     }
 
+    if (filetosend == "/sdcard/html/index.html" && isSetupModusActive()) {
+        printf("System ist im Setupmodus --> index.html --> setup.html");
+        filetosend = "/sdcard/html/setup.html";
+    }
+
     printf("Filename: %s\n", filename);
     
     printf("File requested: %s\n", filetosend.c_str());    

+ 0 - 0
code/src/server_main.h → code/main/server_main.h


+ 4 - 0
code/main/version.cpp

@@ -0,0 +1,4 @@
+const char* GIT_REV="f616643";
+const char* GIT_TAG="";
+const char* GIT_BRANCH="rolling";
+const char* BUILD_TIME="2020-12-06 19:22";

+ 0 - 0
code/src/version.h → code/main/version.h


+ 5 - 1
code/platformio.ini

@@ -9,6 +9,8 @@
 ; https://docs.platformio.org/page/projectconf.html
 
 
+[platformio]
+src_dir = main
 
 
 [env:esp32cam]
@@ -17,12 +19,14 @@ board = esp32cam
 framework = espidf
 
 board_build.embed_files  =
-  src/favicon.ico
+  main/favicon.ico
 
 
 ;board_build.partitions = partitions_singleapp.csv
 board_build.partitions = partitions.csv
 
+
+
 lib_deps = 
   jomjol_helper 
   connect_wlan  

+ 6 - 6
code/sdkconfig

@@ -83,11 +83,11 @@ CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
 # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set
 CONFIG_ESPTOOLPY_FLASHFREQ="40m"
 # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
-CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y
-# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set
+# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
+CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
 # CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
 # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
-CONFIG_ESPTOOLPY_FLASHSIZE="2MB"
+CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
 CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
 CONFIG_ESPTOOLPY_BEFORE_RESET=y
 # CONFIG_ESPTOOLPY_BEFORE_NORESET is not set
@@ -109,11 +109,11 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200
 #
 # Partition Table
 #
-CONFIG_PARTITION_TABLE_SINGLE_APP=y
+# CONFIG_PARTITION_TABLE_SINGLE_APP is not set
 # CONFIG_PARTITION_TABLE_TWO_OTA is not set
-# CONFIG_PARTITION_TABLE_CUSTOM is not set
+CONFIG_PARTITION_TABLE_CUSTOM=y
 CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
-CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv"
+CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
 CONFIG_PARTITION_TABLE_OFFSET=0x8000
 CONFIG_PARTITION_TABLE_MD5=y
 # end of Partition Table

+ 4 - 4
code/sdkconfig.old

@@ -109,11 +109,11 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200
 #
 # Partition Table
 #
-CONFIG_PARTITION_TABLE_SINGLE_APP=y
+# CONFIG_PARTITION_TABLE_SINGLE_APP is not set
 # CONFIG_PARTITION_TABLE_TWO_OTA is not set
-# CONFIG_PARTITION_TABLE_CUSTOM is not set
+CONFIG_PARTITION_TABLE_CUSTOM=y
 CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
-CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv"
+CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
 CONFIG_PARTITION_TABLE_OFFSET=0x8000
 CONFIG_PARTITION_TABLE_MD5=y
 # end of Partition Table
@@ -537,7 +537,7 @@ CONFIG_FATFS_MAX_LFN=255
 CONFIG_FATFS_API_ENCODING_ANSI_OEM=y
 # CONFIG_FATFS_API_ENCODING_UTF_16 is not set
 # CONFIG_FATFS_API_ENCODING_UTF_8 is not set
-CONFIG_FATFS_FS_LOCK=2
+CONFIG_FATFS_FS_LOCK=5
 CONFIG_FATFS_TIMEOUT_MS=10000
 CONFIG_FATFS_PER_FILE_CACHE=y
 CONFIG_FATFS_ALLOC_PREFER_EXTRAM=y

+ 0 - 4
code/src/version.cpp

@@ -1,4 +0,0 @@
-const char* GIT_REV="ffc15aa";
-const char* GIT_TAG="";
-const char* GIT_BRANCH="master";
-const char* BUILD_TIME="2020-12-02 21:56";

+ 3 - 3
code/version.cpp

@@ -1,4 +1,4 @@
-const char* GIT_REV="ffc15aa";
+const char* GIT_REV="f616643";
 const char* GIT_TAG="";
-const char* GIT_BRANCH="master";
-const char* BUILD_TIME="2020-12-02 21:55";
+const char* GIT_BRANCH="rolling";
+const char* BUILD_TIME="2020-12-06 19:22";

BIN
firmware/bootloader.bin


BIN
firmware/firmware.bin


BIN
firmware/html.zip


+ 1 - 0
sd-card/config/config.ini

@@ -59,5 +59,6 @@ LogfileRetentionInDays = 3
 
 [System]
 TimeZone = CET-1CEST,M3.5.0,M10.5.0/3
+SetupMode = true
 
 [Ende]

BIN
sd-card/html/cnn_images.jpg


+ 1 - 0
sd-card/html/debug.log

@@ -0,0 +1 @@
+[1204/185120.033:ERROR:directory_reader_win.cc(43)] FindFirstFile: Das System kann den angegebenen Pfad nicht finden. (0x3)

+ 66 - 0
sd-card/html/edit_explain_0.html

@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html style="width: fit-content">
+<head>
+<title>jomjol - AI on the edge</title>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<style>
+.h_iframe iframe {width:995px;height:605px;}
+.h_iframe {width:995px;height:605px;}
+
+h1 {font-size: 2em; margin-block-end: 0.3em;}
+h2 {font-size: 1.5em;margin-block-start: 0.3em;}
+h3 {font-size: 1.2em;}
+p {font-size: 1em;}
+
+
+
+</style>
+</head>
+
+<body style="font-family: arial">
+
+    <h2>Welcome to the Setup of the Digitizer</h2>
+
+
+    <p>
+        <img src="flow_overview.jpg" alt=""><img src="cnn_images.jpg" alt="">
+    </p>
+
+    <p>
+        This is the first time you the digitizer. You have been automatically routed to the <b>initial setup procedure</b>. 
+        This procedure should adjust the setting to your local counter. Basically you can customize your settings in five steps.
+        <br>
+        In the final step the inital setup will be disabled and it will restart to the normal mode.  
+        <br>
+        <br>
+        Just use the buttons "Next" and "Previous" to nagivate through the process. 
+        <br>
+    </p>
+    <p>
+        Follow the instructions:
+    </p>    
+
+    <p>
+    <ol>
+    <li>Create reference image <br>
+        Basis for the position references and the marking of the digits and counters.</li>
+    <li>Define two unique references <br>
+        Used to align the individual camera shot and identify the absolut positions</li>
+    <li>Define the digits <br>
+        Digital digits to be recognized</li>
+    <li>Define the analog counters <br>
+        Analog counters to be identified</li>
+    <li>General settings <br>
+        Most can stay to the default value - also MQTT connection can be specified here</li>
+    </ol>
+    <p>
+
+After step 5 you switch of the setup mode, reboot and start in normal mode!
+
+<h4>Have fun with the digitizer!</h4>
+
+
+</body>
+</html>

+ 81 - 0
sd-card/html/edit_explain_6.html

@@ -0,0 +1,81 @@
+<!DOCTYPE html>
+<html style="width: fit-content">
+<head>
+<title>jomjol - AI on the edge</title>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<style>
+.h_iframe iframe {width:995px;height:605px;}
+.h_iframe {width:995px;height:605px;}
+
+h1 {font-size: 2em; margin-block-end: 0.3em;}
+h2 {font-size: 1.5em;margin-block-start: 0.3em;}
+h3 {font-size: 1.2em;}
+p {font-size: 1em;}
+
+
+.button {
+	padding: 5px 20px;
+    width: 211px;
+	font-size: 16px;	
+}
+
+
+</style>
+</head>
+
+<body style="font-family: arial">
+
+    <h4>Finished!</h4>
+
+    <p>
+        Now you are finished with the setup and ready to reboot to the normal mode.
+        <br>
+        Once you have pushed below button, the setup modus will be left and the digitizer start to normal operation mode.
+        <br>
+        After a view seconds you can reload this page again and will go to normal operation mode. 
+        <br>
+        All settings can be changed later on as well in the configuration menue.
+    </p>
+
+    <p>
+        <button class="button" onclick="reboot()">Leave Setup Modus and Reboot to Normal</button>
+    </p>
+
+    <script type="text/javascript" src="./gethost.js"></script> 
+    <script type="text/javascript" src="./readconfigparam.js"></script> 
+
+    <script type="text/javascript">
+        var canvas = document.getElementById('canvas'),
+            basepath = "http://192.168.178.22"; 
+            aktstatu = 0;
+    
+    function reboot() {
+        if (confirm("Do you want to leave the configuration mode and restart the ESP32?\n\nPlease reload the page in about 30s.")) {
+            basepath = getbasepath(); 
+            if (!loadConfig(basepath)) {
+                alert("Setup Modus could not be deactivated!\Please retry.");
+                return;
+            } 
+            ParseConfig();	
+            param = getConfigParameters();
+            param["System"]["SetupMode"]["enabled"] = false;
+            param["System"]["SetupMode"]["value1"] = "false";
+            setConfigParameters(param);
+            var textToSave = setConfigParameters(param);
+		    FileDeleteOnServer("/config/config.ini", basepath);
+		    FileSendContent(textToSave, "/config/config.ini", basepath);
+
+            var stringota = "/reboot";
+            window.location = stringota;
+            window.location.href = stringota;
+            window.location.assign(stringota);
+            window.location.replace(stringota);
+        }
+    }
+
+    </script>
+
+</body>
+</html>

+ 1 - 1
sd-card/html/edit_reference.html

@@ -39,7 +39,7 @@ table {
 	  <tr>
 		<td><input class="button" type="button" value="Show Actual Reference" onclick="showReference()"></td>	  
 		<td><input class="button" type="button" value="Create New Reference" onclick="loadRawImage()"></td>
-		<td><input class="button" type="submit" id="take" onclick="doTake()" value="New Raw Image (raw.jpg)"></td>
+		<td><input class="button" type="submit" id="take" onclick="doTake()" value="Take Image"></td>
 	  </tr> 
 	  <tr>
 		<td style="padding-top: 10px"><label for="mirror">Mirror Image:</label></td>

+ 29 - 0
sd-card/html/explain_0.html

@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html style="width: fit-content">
+<head>
+<title>jomjol - AI on the edge</title>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<style>
+.h_iframe iframe {width:995px;height:605px;}
+.h_iframe {width:995px;height:605px;}
+
+h1 {font-size: 2em; margin-block-end: 0.3em;}
+h2 {font-size: 1.5em;margin-block-start: 0.3em;}
+h3 {font-size: 1.2em;}
+p {font-size: 1em;}
+
+
+
+</style>
+</head>
+
+<body style="font-family: arial">
+
+<h4>Introduction</h4>
+<p>
+Read below!
+
+</body>
+</html>

+ 33 - 0
sd-card/html/explain_1.html

@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html style="width: fit-content">
+<head>
+<title>jomjol - AI on the edge</title>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<style>
+.h_iframe iframe {width:995px;height:605px;}
+.h_iframe {width:995px;height:605px;}
+
+h1 {font-size: 2em; margin-block-end: 0.3em;}
+h2 {font-size: 1.5em;margin-block-start: 0.3em;}
+h3 {font-size: 1.2em;}
+p {font-size: 1em;}
+
+
+
+</style>
+</head>
+
+<body style="font-family: arial">
+
+<h4>Reference Image</h4>
+The reference image is needed to define the digits, counters and references for alignment.
+<p>
+    The last taken raw image from the camera is taken. Use the Button "Create New Reference" to make your own reference.<br>
+    Most important feature is a straight alignment of the image. Use the Pre roate Angle and the fine alignment to fine tune the rotation of the image<br>
+    Finish the step by pushing <b>"Update Reference Image"</b>.
+</p>
+
+</body>
+</html>

+ 36 - 0
sd-card/html/explain_2.html

@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html style="width: fit-content">
+<head>
+<title>jomjol - AI on the edge</title>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<style>
+.h_iframe iframe {width:995px;height:605px;}
+.h_iframe {width:995px;height:605px;}
+
+h1 {font-size: 2em; margin-block-end: 0.3em;}
+h2 {font-size: 1.5em;margin-block-start: 0.3em;}
+h3 {font-size: 1.2em;}
+p {font-size: 1em;}
+
+
+
+</style>
+</head>
+
+<body style="font-family: arial">
+
+<h4>Alignment References</h4>
+Two opposite alignment references are needed to identify unique fix points on the image.
+<p>
+    Mark the reference by drag and dop with the mouse or with the coordinates and push <b>"Update Reference"</b>.
+    <br> 
+    You can switch between the two reference with <b>"Select Reference"</b>.
+</p>
+<p>
+    Don't forget to save your changes with <b>"Save to Config.ini"</b>!.
+</p>
+
+</body>
+</html>

+ 37 - 0
sd-card/html/explain_3.html

@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html style="width: fit-content">
+<head>
+<title>jomjol - AI on the edge</title>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<style>
+.h_iframe iframe {width:995px;height:605px;}
+.h_iframe {width:995px;height:605px;}
+
+h1 {font-size: 2em; margin-block-end: 0.3em;}
+h2 {font-size: 1.5em;margin-block-start: 0.3em;}
+h3 {font-size: 1.2em;}
+p {font-size: 1em;}
+
+
+
+</style>
+</head>
+
+<body style="font-family: arial">
+
+<h4>Define Digits</h4>
+Here you define your digits you want to read.
+<p>
+    With the drop down menue <b>"ROI x"</b> you can change between the different digits. Mark them with the mouse or the coordinates.
+    <br>
+    To create new ROIs use <b>"New ROIs"</b>. The order of the ROIs defines the positon within the reading. <br>
+    You can change it with <b>"move Next" / "move Previous"</b>.
+</p>
+<p>
+    Don't forget to save your changes with <b>"Save all to Config.ini"</b>!.
+</p>
+
+</body>
+</html>

+ 37 - 0
sd-card/html/explain_4.html

@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html style="width: fit-content">
+<head>
+<title>jomjol - AI on the edge</title>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<style>
+.h_iframe iframe {width:995px;height:605px;}
+.h_iframe {width:995px;height:605px;}
+
+h1 {font-size: 2em; margin-block-end: 0.3em;}
+h2 {font-size: 1.5em;margin-block-start: 0.3em;}
+h3 {font-size: 1.2em;}
+p {font-size: 1em;}
+
+
+
+</style>
+</head>
+
+<body style="font-family: arial">
+
+<h4>Define Digits</h4>
+Here you define your analog counters you want to read. If you do not have analog counters delete all ROIs.
+<p>
+    With the drop down menue <b>"ROI x"</b> you can change between the different counters. Mark them with the mouse or the coordinates.
+    <br>
+    To create new ROIs use <b>"New ROIs"</b>. The order of the ROIs defines the positon within the reading. <br>
+    You can change it with <b>"move Next" / "move Previous"</b>.
+</p>
+<p>
+    Don't forget to save your changes with <b>"Save all to Config.ini"</b>!.
+</p>
+
+</body>
+</html>

+ 35 - 0
sd-card/html/explain_5.html

@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html style="width: fit-content">
+<head>
+<title>jomjol - AI on the edge</title>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<style>
+.h_iframe iframe {width:995px;height:605px;}
+.h_iframe {width:995px;height:605px;}
+
+h1 {font-size: 2em; margin-block-end: 0.3em;}
+h2 {font-size: 1.5em;margin-block-start: 0.3em;}
+h3 {font-size: 1.2em;}
+p {font-size: 1em;}
+
+
+
+</style>
+</head>
+
+<body style="font-family: arial">
+
+<h4>General configuration parameters</h4>
+Here you define additional setting. The settings should fit for a normal setup. </p>
+<p>
+    Only if you want to connect to a MQTT-broker you need to adjust the corresponding parameters.
+</p>
+<p>
+    Don't forget to save your changes with <b>"Update Config.ini"</b>!.
+    <br>You should not reboot here, but leave the setup modus on the next page.
+</p>
+
+</body>
+</html>

+ 27 - 0
sd-card/html/explain_6.html

@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html style="width: fit-content">
+<head>
+<title>jomjol - AI on the edge</title>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<style>
+.h_iframe iframe {width:995px;height:605px;}
+.h_iframe {width:995px;height:605px;}
+
+h1 {font-size: 2em; margin-block-end: 0.3em;}
+h2 {font-size: 1.5em;margin-block-start: 0.3em;}
+h3 {font-size: 1.2em;}
+p {font-size: 1em;}
+
+
+
+</style>
+</head>
+
+<body style="font-family: arial">
+
+<h4>Finished!</h4>
+Read below!
+</body>
+</html>

BIN
sd-card/html/flow_overview.jpg


+ 2 - 2
sd-card/html/gethost.js

@@ -7,8 +7,8 @@ function getbasepath(){
     var host = window.location.hostname;
     if ((host == "127.0.0.1") || (host == "localhost"))
     {
-//        host = "http://192.168.178.26";          // jomjol interner test
-        host = "http://192.168.178.22";          // jomjol interner Real
+        host = "http://192.168.178.26";          // jomjol interner test
+//        host = "http://192.168.178.22";          // jomjol interner Real
 //        host = ".";                           // jomjol interner localhost   
     }
     else

+ 1 - 0
sd-card/html/index.html

@@ -97,6 +97,7 @@ li.dropdown {
     </div> 
 </ul>
 <p>
+
 <div class="h_iframe">
 	 <iframe name="maincontent" id ="maincontent" src="/wasserzaehler_roi.html" title="fileserver" allowfullscreen></iframe> 
 </div>

+ 3 - 1
sd-card/html/readconfigparam.js

@@ -73,7 +73,8 @@ function ParseConfig() {
      param[catname] = new Object();
      ParamAddValue(param, catname, "TimeZone");
      ParamAddValue(param, catname, "AutoAdjustSummertime");
-     ParamAddValue(param, catname, "TimeUpdateIntervall");     
+     ParamAddValue(param, catname, "TimeUpdateIntervall");   
+     ParamAddValue(param, catname, "SetupMode");         
 
      while (aktline < config_split.length){
           if (config_split[aktline].trim().toUpperCase() == "[MAKEIMAGE]") {
@@ -150,6 +151,7 @@ function ParseConfigParamSystem(_aktline){
           ParamExtractValue(param, linesplit, catname, "TimeZone", _aktline, isCom);
           ParamExtractValue(param, linesplit, catname, "AutoAdjustSummertime", _aktline, isCom);
           ParamExtractValue(param, linesplit, catname, "TimeUpdateIntervall", _aktline, isCom);
+          ParamExtractValue(param, linesplit, catname, "SetupMode", _aktline, isCom);
 
           ++_aktline;
      }    

+ 40 - 0
sd-card/html/setup - Kopie.html

@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html style="width: fit-content">
+<head>
+<title>jomjol - AI on the edge</title>
+
+<style>
+
+div {
+   text-align:center;
+   width:995px;
+   height: 600px;
+}
+.iframe_work {
+   display:inline-block;
+   margin: 0px auto;
+   width:70%;
+   height: 100%;   
+}
+
+.iframe_info {
+   display:inline-block;
+   margin: 0px auto;
+   width:20%;   
+   height: 100%;     
+}
+
+</style>
+
+</head>
+
+<body style="font-family: arial">
+
+<div>
+<iframe class="iframe_work" name="iframe_work" id="iframe_work" src="/wasserzaehler_roi.html" allowfullscreen></iframe>
+<iframe class="iframe_info" name="iframe_info" id="iframe_info" src="/wasserzaehler_roi.html" allowfullscreen></iframe>
+</div>
+
+
+</body>
+</html>

+ 141 - 0
sd-card/html/setup.html

@@ -0,0 +1,141 @@
+<!DOCTYPE html>
+<html style="width: fit-content">
+<head>
+<title>jomjol - AI on the edge</title>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<style>
+.h_iframe iframe {width:995px;height:760px;}
+.h_iframe {width:995px;height:605px;}
+
+.h_iframe_explain iframe {width:995px;height:200px;}
+.h_iframe_explain {width:995px;height:200px;}
+
+h1 {font-size: 2em; margin-block-end: 0.3em;}
+h2 {font-size: 1.5em;margin-block-start: 0.3em;}
+h3 {font-size: 1.2em;}
+p {font-size: 1em;}
+
+.button {
+	padding: 5px 20px;
+    width: 211px;
+	font-size: 16px;	
+}
+</style>
+</head>
+
+<body style="font-family: arial">
+
+<h1>Digitizer - Initial Setup</h1>
+<table>
+   <tr>
+      <td>
+         <button class="button" id="previous" name="previous" onclick="clickPrevious()">Previous</button>
+         <button class="button" id="next" name="next" onclick="clickNext()">Next</button>
+      </td>
+   </tr>
+</table>
+
+
+<div class="h_iframe_explain" id="h_iframe_explain">
+   <iframe name="explaincontent" id ="explaincontent" src="" allowfullscreen></iframe> 
+</div>
+
+<div class="h_iframe">
+	 <iframe name="maincontent" id ="maincontent" src="" allowfullscreen></iframe> 
+</div>
+
+
+
+ 
+
+<script type="text/javascript">
+	var canvas = document.getElementById('canvas'),
+		basepath = "http://192.168.178.22"; 
+		aktstatu = 0;
+
+function clickNext() {
+   aktstatu++;
+   if (aktstatu > 6) {
+      aktstatu = 6;
+   }
+   LoadStep();
+}
+
+function clickPrevious() {
+   aktstatu--;
+   if (aktstatu < 0) {
+      aktstatu = 0;
+   }
+   LoadStep();
+}
+
+function LoadStep(){
+   switch (aktstatu) {
+      case 0:
+         document.getElementById('maincontent').src = '/edit_explain_0.html';
+         document.getElementById('h_iframe_explain').style.display = "none";  
+         document.getElementById("previous").disabled = true;
+         document.getElementById("next").disabled = false;
+         break;
+      case 1:
+         document.getElementById('maincontent').src = '/edit_reference.html';
+         document.getElementById('explaincontent').src = '/explain_1.html';
+         document.getElementById('h_iframe_explain').style.display = "";  
+         document.getElementById("previous").disabled = false;
+         document.getElementById("next").disabled = false;
+         break;
+      case 2:
+         document.getElementById('maincontent').src = '/edit_alignment.html';
+         document.getElementById('explaincontent').src = '/explain_2.html';
+         document.getElementById('h_iframe_explain').style.display = "";           
+         document.getElementById("previous").disabled = false;
+         document.getElementById("next").disabled = false;
+
+         break;
+      case 3:
+         document.getElementById('maincontent').src = '/edit_digits.html';
+         document.getElementById('explaincontent').src = '/explain_3.html';         
+         document.getElementById('h_iframe_explain').style.display = "";           
+         document.getElementById("previous").disabled = false;
+         document.getElementById("next").disabled = false;
+
+         break;
+      case 4:
+         document.getElementById('maincontent').src = '/edit_analog.html';
+         document.getElementById('explaincontent').src = '/explain_4.html';   
+         document.getElementById('h_iframe_explain').style.display = "";           
+         document.getElementById("previous").disabled = false;
+         document.getElementById("next").disabled = false;
+
+         break;
+      case 5:
+         document.getElementById('maincontent').src = '/edit_config_param.html';
+         document.getElementById('explaincontent').src = '/explain_5.html';            
+         document.getElementById('h_iframe_explain').style.display = "";           
+         document.getElementById("previous").disabled = false;
+         document.getElementById("next").disabled = false;
+
+         break; 
+      case 6:
+         document.getElementById('maincontent').src = '/edit_explain_6.html';
+         document.getElementById('explaincontent').src = '/explain_6.html';            
+         document.getElementById('h_iframe_explain').style.display = "none";  
+         document.getElementById("previous").disabled = false;
+         document.getElementById("next").disabled = true;
+
+         break;   
+      }
+
+
+}
+
+LoadStep();
+
+
+</script>
+ 
+
+</body>
+</html>

+ 1 - 1
sd-card/html/version.txt

@@ -1 +1 @@
-2.1.0
+3.0.0