Just Call Me Koko пре 5 година
родитељ
комит
bace9ecf06

Разлика између датотеке није приказан због своје велике величине
+ 4 - 0
esp32_marauder/Assets.h


+ 1 - 1
esp32_marauder/Display.h

@@ -54,7 +54,7 @@ class Display
     TFT_eSPI tft = TFT_eSPI();
     TFT_eSPI tft = TFT_eSPI();
     TFT_eSprite img = TFT_eSprite(&tft);
     TFT_eSprite img = TFT_eSprite(&tft);
     TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
     TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
-    String version_number = "v0.4.4";
+    String version_number = "v0.4.5";
 
 
     bool printing = false;
     bool printing = false;
     bool loading = false;
     bool loading = false;

+ 0 - 0
esp32_marauder/esp32_marauder_v0_4_0_20200130.bin → esp32_marauder/PreviousVersions/esp32_marauder_v0_4_0_20200130.bin


+ 11 - 1
esp32_marauder/Web.cpp

@@ -30,6 +30,14 @@ void Web::main()
   delay(1);
   delay(1);
 }
 }
 
 
+// Callback for the embedded jquery.min.js page
+void Web::onJavaScript(void) {
+    Serial.println("onJavaScript(void)");
+    server.setContentLength(jquery_min_js_v3_2_1_gz_len);
+    server.sendHeader(F("Content-Encoding"), F("gzip"));
+    server.send_P(200, "text/javascript", jquery_min_js_v3_2_1_gz, jquery_min_js_v3_2_1_gz_len);
+}
+
 void Web::setupOTAupdate()
 void Web::setupOTAupdate()
 {
 {
   display_obj.tft.setTextWrap(false);
   display_obj.tft.setTextWrap(false);
@@ -65,7 +73,9 @@ void Web::setupOTAupdate()
   }
   }
   Serial.println("mDNS responder started");
   Serial.println("mDNS responder started");
   */
   */
-  
+
+  // return javascript jquery
+  server.on("/jquery.min.js", HTTP_GET, onJavaScript);
   /*return index page which is stored in serverIndex */
   /*return index page which is stored in serverIndex */
   server.on("/", HTTP_GET, [this]() {
   server.on("/", HTTP_GET, [this]() {
     server.sendHeader("Connection", "close");
     server.sendHeader("Connection", "close");

+ 10 - 1
esp32_marauder/Web.h

@@ -11,6 +11,7 @@ Code taken from espressif ESP32 OTA Update example
 #include <ESPmDNS.h>
 #include <ESPmDNS.h>
 #include <Update.h>
 #include <Update.h>
 
 
+#include "Assets.h"
 #include "Display.h"
 #include "Display.h"
 
 
 extern Display display_obj;
 extern Display display_obj;
@@ -72,7 +73,14 @@ class Web
      */
      */
      
      
     const char* serverIndex = 
     const char* serverIndex = 
-    "<script src='https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script>"
+    "<script src='/jquery.min.js'></script>"
+    "Because the lack of an asynchronous webserver in this Arduino sketch like 'ESPAsyncWebServer', <br/>"
+    "both file 'serverIndex' and 'jquery.min.js' can't be read from the webserver at the same time. <br/><br/>"
+    "Your web browser probably requests those two files simultaneously and therefore <br/>"
+    "the javascript file failed to load. By a refresh of this page, the browser cash has already <br/>"
+    "load 'serverIndex' file, the web browser will do a second attempt to only read the javascript file. <br/>"
+    "This second attempt, with an idle webserver, will be processed.<br/><br/>"
+    "Long story short, press F5 (refresh web browser) before uploading your firmware. <br/><br/>"
     "<form method='POST' action='#' enctype='multipart/form-data' id='upload_form'>"
     "<form method='POST' action='#' enctype='multipart/form-data' id='upload_form'>"
        "<input type='file' name='update'>"
        "<input type='file' name='update'>"
             "<input type='submit' value='Update'>"
             "<input type='submit' value='Update'>"
@@ -113,6 +121,7 @@ class Web
     Web();
     Web();
 
 
     void main();
     void main();
+    static void onJavaScript();
     void setupOTAupdate();
     void setupOTAupdate();
 };
 };
 
 

BIN
esp32_marauder/esp32_marauder_v0_4_5_20200222.bin


Неке датотеке нису приказане због велике количине промена