Outils pour utilisateurs

Outils du site


projets:esp32-cam_timelaps_code

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
projets:esp32-cam_timelaps_code [2020/06/03 14:49] gepetoprojets:esp32-cam_timelaps_code [2024/02/09 16:56] (Version actuelle) – modification externe 127.0.0.1
Ligne 1: Ligne 1:
 +<code>
 /* /*
   ESP32-CAM l'oeil clignotemps   ESP32-CAM l'oeil clignotemps
Ligne 34: Ligne 35:
    "quality":10,    "quality":10,
    "capture_interval":10000,    "capture_interval":10000,
-   "total_frames":180,+   "length":1800,
    "ssid":"wifissid",    "ssid":"wifissid",
    "pass":"trucpass",    "pass":"trucpass",
Ligne 48: Ligne 49:
 //  edit these parameters for your needs //  edit these parameters for your needs
  
-static const char vernum[] = "v9cGepeto"; // modif AccesPoint and http filesystem+static const char vernum[] = "v10Gepeto"; // modif AccesPoint and http filesystem
 // plage horaire // plage horaire
 #include <dummy.h> #include <dummy.h>
Ligne 74: Ligne 75:
 // startup defaults for first recordin // startup defaults for first recordin
 // here are the recording options from the "retart web page" // here are the recording options from the "retart web page"
 +// framesize=UXGA&length=1800&interval=10000&quality=10&repeat=100&speed=1&gray=0
 // VGA 10 fps for 30 min, repeat, realtime                   http://192.168.0.117/start?framesize=VGA&length=1800&interval=100&quality=10&repeat=100&speed=1&gray=0 // VGA 10 fps for 30 min, repeat, realtime                   http://192.168.0.117/start?framesize=VGA&length=1800&interval=100&quality=10&repeat=100&speed=1&gray=0
 // VGA 2 fps, for 30 minutes repeat, 30x playback            http://192.168.0.117/start?framesize=VGA&length=1800&interval=500&quality=10&repeat=300&speed=30&gray=0 // VGA 2 fps, for 30 minutes repeat, 30x playback            http://192.168.0.117/start?framesize=VGA&length=1800&interval=500&quality=10&repeat=300&speed=30&gray=0
Ligne 152: Ligne 154:
 int file_number = 0; int file_number = 0;
 int internet_connected = 0; // 0 non connecté , 1 mode sta , 2 freewifi, 3 mode AP int internet_connected = 0; // 0 non connecté , 1 mode sta , 2 freewifi, 3 mode AP
-bool ntp_ok = false; 
 struct tm timeinfo; struct tm timeinfo;
 time_t now; time_t now;
Ligne 280: Ligne 281:
  
 void Test_horaires() {   // cherche si heure maintenant contenue dans horaires void Test_horaires() {   // cherche si heure maintenant contenue dans horaires
-  if (internet_connected >= 3 || ntp_ok == false) { // pas internet = pas horaire+  Serial.print ( timeinfo.tm_year) ; 
 +  if ( timeinfo.tm_year < 110 { // date year deouis 1900
     return;     return;
 +  } else {
 +    Serial.println(F(" test horaire"));
 +    int heure = 0 ;
 +    int taille_plages = strlen(horaire);
 +    if (taille_plages > 3 ) {
 +      char buf[3] = "00";
 +      for (int i = 0; i < taille_plages; i++) {
 +        buf[0] = horaire[i++];
 +        if (horaire[i] != ',' && horaire[i] != ';' && horaire[i] != ' ') buf[1] = horaire[i++];
 +        else buf[1] = '\0';
 +        buf[2] = '\0';
 +        heure = atoi(buf);
 +        time(&now);
 +        localtime_r(&now, &timeinfo);
 +        //Serial.print(F("heures "));
 +        //Serial.println(heure);
 +        if ((int)timeinfo.tm_hour  == heure) {
 +          //Serial.print(F("  "));
 +          //Serial.println(strftime_buf);
 +          heure = 99;
 +          break;
 +        }
 +      }
 +      int reste = 58 - (int)timeinfo.tm_min;
 +      if (reste > 3 && heure < 90) {
 +        //end_avi();
 +        Serial.print(F("Sleep "));
 +        Serial.println(reste);
 +        esp_sleep_enable_timer_wakeup(1000000 * 60 * (uint64_t)reste);
 +        esp_deep_sleep_start();
 +        delay(1000);
 +      }
 +    } else Serial.println(F("ok"));
   }   }
-  Serial.println(F("test horaire")); 
-  int heure = 0 ; 
-  int taille_plages = strlen(horaire); 
-  if (taille_plages > 3 ) { 
-    char buf[3] = "00"; 
-    for (int i = 0; i < taille_plages; i++) { 
-      buf[0] = horaire[i++]; 
-      if (horaire[i] != ',' && horaire[i] != ';' && horaire[i] != ' ') buf[1] = horaire[i++]; 
-      else buf[1] = '\0'; 
-      buf[2] = '\0'; 
-      heure = atoi(buf); 
-      time(&now); 
-      localtime_r(&now, &timeinfo); 
-      //Serial.print ( timeinfo.tm_hour) ; 
-      //Serial.print(F("heures ")); 
-      //Serial.println(heure); 
-      if ((int)timeinfo.tm_hour  == heure) { 
-        //Serial.print(F("  ")); 
-        //Serial.println(strftime_buf); 
-        heure = 99; 
-        break; 
-      } 
-    } 
-    //strftime(strftime_buf, sizeof(strftime_buf), "%M", &timeinfo); 
-    int reste = 58 - (int)timeinfo.tm_min; 
-    if (reste > 3 && heure < 90) { 
-      end_avi(); 
-      Serial.print(F("Sleep ")); 
-      Serial.println(reste); 
-      esp_sleep_enable_timer_wakeup(1000000 * 60 * (uint64_t)reste); 
-      esp_deep_sleep_start(); 
-      delay(1000); 
-    } 
-  } else Serial.println(F("ok")); 
 } }
 /// ///
Ligne 351: Ligne 352:
   json["repeat"            = repeat;   json["repeat"            = repeat;
   json["xspeed"            = xspeed;   json["xspeed"            = xspeed;
-  json["total_frames"      total_frames;+  json["length"            xlength;
   json["gray"              = gray;   json["gray"              = gray;
   json["ssid"              = ssid;   json["ssid"              = ssid;
Ligne 370: Ligne 371:
     Serial.println(F("Mounting FS..."));     Serial.println(F("Mounting FS..."));
     if (readFileconfig() == true) {     if (readFileconfig() == true) {
-      Serial.print(F("flash config ")); +      //Serial.print(F("flash config ")); 
-      Serial.println(buf_config);+      //Serial.println(buf_config);
       File configFile = SPIFFS.open("/config.jsn", "w");       File configFile = SPIFFS.open("/config.jsn", "w");
       configFile.print(buf_config);       configFile.print(buf_config);
Ligne 411: Ligne 412:
           if (json["quality"])          quality   = json["quality"] | quality ;           if (json["quality"])          quality   = json["quality"] | quality ;
           if (json["capture_interval"]) capture_interval =  json["capture_interval"] | capture_interval;           if (json["capture_interval"]) capture_interval =  json["capture_interval"] | capture_interval;
-          if (json["total_frames"])     total_frames =  json["total_frames"] | total_frames;+          if (json["length"])           xlength =  json["length"] | xlength;
           if (json["ssid"])             strlcpy (ssid , json["ssid"], sizeof(ssid));           if (json["ssid"])             strlcpy (ssid , json["ssid"], sizeof(ssid));
           else strlcpy (ssid , ssid_ap, sizeof(ssid));           else strlcpy (ssid , ssid_ap, sizeof(ssid));
Ligne 427: Ligne 428:
         configFile.close();         configFile.close();
         Serial.println(F("OK"));         Serial.println(F("OK"));
 +        total_frames = xlength * 1000 / capture_interval;
  
       }       }
Ligne 565: Ligne 567:
             skipping = 0;             skipping = 0;
             Serial.println(" Queue cleared. ");             Serial.println(" Queue cleared. ");
 +            delay(100);
           }           }
  
Ligne 633: Ligne 636:
   card_err = init_sdcard();   card_err = init_sdcard();
   if (card_err != true) {   if (card_err != true) {
-    Serial.printf("SD Card init failed with error 0x%x", card_err);+    Serial.printf("init sd error 0x%x", card_err);
     major_fail();     major_fail();
-    return; 
   }   }
   loadSPIFFSConfigFile();   loadSPIFFSConfigFile();
  
-  Serial.printf(" http://%s.local - to access the camera\n", devname);+  //Serial.printf(" http://%s.local - to access the camera\n", devname);
  
   pinMode(33, OUTPUT);    // little red led on back of chip   pinMode(33, OUTPUT);    // little red led on back of chip
Ligne 702: Ligne 704:
 bool init_wifi() bool init_wifi()
 { {
-  WiFi.disconnect(true); +  if (internet_connected < 3) { // que si pas deja en AP 
-  WiFi.mode(WIFI_STA); +    WiFi.disconnect(true); 
-  WiFi.setHostname(devname); +    WiFi.mode(WIFI_STA); 
-  WiFi.begin(ssid, pass); +    WiFi.setHostname(devname); 
-  delay(1000); +    WiFi.begin(ssid, pass);
-  while (WiFi.status() != WL_CONNECTED ) {+
     delay(1000);     delay(1000);
-    Serial.print(F(".")); +    while (WiFi.status() !WL_CONNECTED ) {
-    if (connAttempts == 10) { +
-      Serial.println(F("tentative FreeWifi")); // juste pour ntp +
-      WiFi.begin("FreeWifi"); +
-      delay(2000); +
-      if (WiFi.SSID() == (String)"FreeWifi") { +
-        Serial.println(F("oui")); +
-        internet_connected = 2; +
-      }+
       delay(1000);       delay(1000);
-    else if (connAttempts > 13) { // laisse tomber, passage AP +      Serial.print(F(".")); 
-      internet_connected = 3; +      if (connAttempts == 10) { 
-      ntp_ok = false;+        Serial.println(F("tentative FreeWifi ntp")); // juste pour ntp 
 +        WiFi.begin("FreeWifi"); 
 +        delay(2000); 
 +        if (WiFi.SSID() == (String)"FreeWifi") { 
 +          Serial.println(F("Temps FreeWifi")); 
 +          internet_connected = 2; 
 +        } 
 +        delay(1000); 
 +      }  
 +      if(connAttempts > 13) { // laisse tomber, passage AP 
 +        internet_connected = 3
 +        break
 +      
 +      connAttempts++;
     }     }
-    connAttempts++; 
   }   }
   if (internet_connected == 0) internet_connected = 1;   if (internet_connected == 0) internet_connected = 1;
   if (internet_connected < 3) {   if (internet_connected < 3) {
     Serial.println(WiFi.SSID());     Serial.println(WiFi.SSID());
-    Serial.println(internet_connected); 
     char pool[16] = "";     char pool[16] = "";
     if ( internet_connected == 2) {     if ( internet_connected == 2) {
Ligne 735: Ligne 739:
       sprintf(pool, "pool.ntp.org");       sprintf(pool, "pool.ntp.org");
     }     }
-    Serial.print(F("Waiting for system time to be set "));+    Serial.print(F("Attente ntp de "));
     Serial.print(pool);     Serial.print(pool);
     configTime(0, 0, pool);     configTime(0, 0, pool);
Ligne 744: Ligne 748:
     int retry = 0;     int retry = 0;
     const int retry_count = 10;     const int retry_count = 10;
-    delay(1000);+    delay(2000);
     time(&now);     time(&now);
     localtime_r(&now, &timeinfo);     localtime_r(&now, &timeinfo);
 +    Serial.print(F(" : "));
     Serial.println(ctime(&now));     Serial.println(ctime(&now));
 +    Serial.print(F(" - "));
 +
     while (!time(nullptr) && ++retry < retry_count) {     while (!time(nullptr) && ++retry < retry_count) {
       Serial.printf("... (%d/%d) -- %d\n", retry, retry_count, timeinfo.tm_year);       Serial.printf("... (%d/%d) -- %d\n", retry, retry_count, timeinfo.tm_year);
Ligne 753: Ligne 760:
       time(&now);       time(&now);
       localtime_r(&now, &timeinfo);       localtime_r(&now, &timeinfo);
-      ntp_ok = true; 
       Serial.println(ctime(&now));       Serial.println(ctime(&now));
-      sprintf(localip, "%s", WiFi.localIP().toString().c_str());+      Serial.print(F(" ok ntp "));
     }     }
-    ntp_ok = true// on force +    sprintf(localip, "%s", WiFi.localIP().toString().c_str());
   }   }
   if (internet_connected >= 2) {   if (internet_connected >= 2) {
Ligne 778: Ligne 783:
     Serial.println(WiFi.localIP());     Serial.println(WiFi.localIP());
     if (!MDNS.begin(devname)) {     if (!MDNS.begin(devname)) {
-      Serial.println(F("Error setting up MDNS responder!"));+      Serial.println(F("Error MDNS !"));
     } else {     } else {
-      Serial.printf("mDNS responder started '%s'\n", devname);+      Serial.printf("mDNS started '%s'\n", devname);
     }     }
   }   }
Ligne 804: Ligne 809:
   sdmmc_card_t *card;   sdmmc_card_t *card;
  
-  Serial.println(F("Mounting SD card..."));+  //Serial.println(F("Mounting SD card..."));
   ret = esp_vfs_fat_sdmmc_mount("/sdcard", &host, &slot_config, &mount_config, &card);   ret = esp_vfs_fat_sdmmc_mount("/sdcard", &host, &slot_config, &mount_config, &card);
  
   if (ret == ESP_OK) {   if (ret == ESP_OK) {
-    Serial.println(F("SD card mount successfully!"));+    Serial.println(F("SD mount ok!"));
   }  else  {   }  else  {
-    Serial.printf("Failed to mount SD card VFAT filesystem. Error: %s", esp_err_to_name(ret));+    Serial.printf("err mount SD card VFAT Error: %s", esp_err_to_name(ret));
     major_fail();     major_fail();
     return false;     return false;
Ligne 826: Ligne 831:
   File root = fs.open(dirname);   File root = fs.open(dirname);
   if (!root) {   if (!root) {
-    Serial.println(F("Failed to open directory"));+    Serial.println(F("err open directory"));
     return;     return;
   }   }
   if (!root.isDirectory()) {   if (!root.isDirectory()) {
-    Serial.println(F("Not a directory"));+    Serial.println(F("Not a dir"));
     return;     return;
   }   }
Ligne 893: Ligne 898:
       digitalWrite(33, LOW);       digitalWrite(33, LOW);
       end_avi();       end_avi();
-      Serial.println(F("Done capture due to command"));+      Serial.println(F("ok capture command"));
       frames_so_far = total_frames;       frames_so_far = total_frames;
       newfile = 0;    // file is closed       newfile = 0;    // file is closed
Ligne 901: Ligne 906:
       if (newfile == 1 && recording == 1) {                            // regular recording       if (newfile == 1 && recording == 1) {                            // regular recording
         if (frames_so_far >= total_frames)  {                                // we are done the recording         if (frames_so_far >= total_frames)  {                                // we are done the recording
-          Serial.println(F("Done capture for total frames!"));+          Serial.println(F("ok capture for total frames!"));
           digitalWrite(33, LOW);                                                       // close the file           digitalWrite(33, LOW);                                                       // close the file
           end_avi();           end_avi();
Ligne 978: Ligne 983:
     cam_err = esp_camera_init(&config);     cam_err = esp_camera_init(&config);
     if (cam_err != ESP_OK) {     if (cam_err != ESP_OK) {
-      Serial.printf("Camera init failed with error 0x%x", cam_err);+      Serial.printf("Camera init error 0x%x", cam_err);
       major_fail();       major_fail();
     }     }
Ligne 1001: Ligne 1006:
   File ficnofic = fs.open(nomfic, FILE_WRITE);   File ficnofic = fs.open(nomfic, FILE_WRITE);
   if (!ficnofic) {   if (!ficnofic) {
-    Serial.println(F("Failed to open /nofic.jsn for writing"));+    Serial.println(F("err open /nofic.jsn writing"));
   }   }
   DynamicJsonDocument json(32);   DynamicJsonDocument json(32);
Ligne 1010: Ligne 1015:
   File ficnofic = fs.open(nomfic, FILE_READ);   File ficnofic = fs.open(nomfic, FILE_READ);
   if (!ficnofic) {   if (!ficnofic) {
-    Serial.println(F("Failed to open /nofic.jsn for reading"));+    Serial.println(F("err open /nofic.jsn reading"));
   }   }
   DynamicJsonDocument json(32);   DynamicJsonDocument json(32);
   DeserializationError error = deserializeJson(json, ficnofic);   DeserializationError error = deserializeJson(json, ficnofic);
   if (error) {   if (error) {
-    Serial.println(F("err lecture json /nofic.jon"));+    Serial.println(F("err json /nofic.jsn"));
     ficnofic.println();     ficnofic.println();
     return (numero_fichier);     return (numero_fichier);
Ligne 1027: Ligne 1032:
  
 static esp_err_t start_avi() { static esp_err_t start_avi() {
-  Serial.println("Starting an avi ");+  Serial.println(F("Starting an avi "));
   config_camera();   config_camera();
-  if ( ntp_ok == true) {+  if ( (int)timeinfo.tm_year > 110 ) {
     time(&now);     time(&now);
     localtime_r(&now, &timeinfo);     localtime_r(&now, &timeinfo);
Ligne 1061: Ligne 1066:
     //Serial.printf("File open: %s\n", fname);     //Serial.printf("File open: %s\n", fname);
   }  else  {   }  else  {
-    Serial.println("Could not open file");+    Serial.println("err open file");
     major_fail();     major_fail();
   }   }
Ligne 1067: Ligne 1072:
     //Serial.printf("File open: %s\n", "/sdcard/idx.tmp");     //Serial.printf("File open: %s\n", "/sdcard/idx.tmp");
   }  else  {   }  else  {
-    Serial.println("Could not open file");+    Serial.println(F("err open file"));
     major_fail();     major_fail();
   }   }
Ligne 1171: Ligne 1176:
     size_t err = fwrite(fb_q[fb_out]->buf, 1, fb_q[fb_out]->len, avifile);     size_t err = fwrite(fb_q[fb_out]->buf, 1, fb_q[fb_out]->len, avifile);
     if (err == 0 ) {     if (err == 0 ) {
-      Serial.println("Error on avi write");+      Serial.println(F("Err avi write"));
       major_fail();       major_fail();
     }     }
Ligne 1220: Ligne 1225:
   //Serial.print(" Write Q: "); Serial.print((fb_in + fb_max - fb_out) % fb_max); Serial.print(" in/out  "); Serial.print(fb_in); Serial.print(" / "); Serial.println(fb_out);   //Serial.print(" Write Q: "); Serial.print((fb_in + fb_max - fb_out) % fb_max); Serial.print(" in/out  "); Serial.print(fb_in); Serial.print(" / "); Serial.println(fb_out);
   current_end = ftell (avifile);   current_end = ftell (avifile);
-  Serial.println(F("End of avi - closing the files"));+  Serial.println(F("End of avi - close files"));
   elapsedms = millis() - startms;   elapsedms = millis() - startms;
   float fRealFPS = (1000.0f * (float)frame_cnt) / ((float)elapsedms) * xspeed;   float fRealFPS = (1000.0f * (float)frame_cnt) / ((float)elapsedms) * xspeed;
Ligne 1250: Ligne 1255:
   print_quartet(movi_size + frame_cnt * 8 + 4, avifile);   print_quartet(movi_size + frame_cnt * 8 + 4, avifile);
  
-  Serial.println(F("\n*** Video recorded and saved ***\n"));+  Serial.println(F("\n*** Video ok,saved ***\n"));
   Serial.print(F("Recorded "));   Serial.print(F("Recorded "));
   Serial.print(elapsedms / 1000);   Serial.print(elapsedms / 1000);
Ligne 1284: Ligne 1289:
  
   }  else  {   }  else  {
-    Serial.println(F("Could not open file"));+    Serial.println(F("err open file"));
     //major_fail();     //major_fail();
   }   }
Ligne 1306: Ligne 1311:
  
   // incremente le numero_fichier   // incremente le numero_fichier
-  if ( ntp_ok == false) {+  if ( (int)timeinfo.tm_year < 110) {
     numero_fichier++;     numero_fichier++;
     nofichiersave(SD_MMC, "/nofic.jsn");     nofichiersave(SD_MMC, "/nofic.jsn");
Ligne 1395: Ligne 1400:
     Serial.printf("File saved: %s\n", filename);     Serial.printf("File saved: %s\n", filename);
   }  else  {   }  else  {
-    Serial.println(F("Could not open file"));+    Serial.println(F("err open file"));
   }   }
   fclose(file);   fclose(file);
Ligne 1443: Ligne 1448:
     Serial.printf("File saved: %s\n", filename);     Serial.printf("File saved: %s\n", filename);
   }  else  {   }  else  {
-    Serial.println(F("Could not open file"));+    Serial.println(F("err open file"));
   }   }
   fclose(file);   fclose(file);
Ligne 1497: Ligne 1502:
   } else {   } else {
     //recording = 1;     //recording = 1;
-    Serial.println(F("starting recording"));+    Serial.println(F("start recording"));
  
     sensor_t * s = esp_camera_sensor_get();     sensor_t * s = esp_camera_sensor_get();
Ligne 1656: Ligne 1661:
 Gray      = 1 ou 0<br> Gray      = 1 ou 0<br>
  
-Fichier sur la microSD /config.json <br> +
-ex: {"devname":"esp32-cam","framesize":6,"repeat":100,"xspeed":1,"gray":0,"quality":10,"capture_interval":10000,"total_frames":180,"ssid":"SNHACK","pass":"1234567890","horaire":"10 11,12,13,14,15,16,17,18,19,20"}+
 <br>mis a jour dela config initiale par  <br>mis a jour dela config initiale par 
 <h3><a href="http://%s/saveconfig"> saveconfig</a></h3> <h3><a href="http://%s/saveconfig"> saveconfig</a></h3>
  
 +Fichier sur la microSD /config.jsn <br>
 +%s
 </body> </body>
 </html>)rawliteral"; </html>)rawliteral";
 +  //ex: {"devname":"esp32-cam","framesize":6,"repeat":100,"xspeed":1,"gray":0,"quality":10,"capture_interval":10000,"length":180,"ssid":"SNHACK","pass":"1234567890","horaire":"10 11,12,13,14,15,16,17,18,19,20"}
  
-  sprintf(the_page, msg, devname, devname, vernum, the_message, localip, localip, localip, localip, localip, localip, localip, localip, localip, localip);+  sprintf(the_page, msg, devname, devname, vernum, the_message, localip, localip, localip, localip, localip, localip, localip, localip, localip, localip, buf_config);
   Serial.println(the_page);   Serial.println(the_page);
 } }
Ligne 1673: Ligne 1680:
  
   recording = 0;   recording = 0;
-  Serial.println(F("stopping recording"));+  Serial.println(F("stop recording"));
  
   do_stop("Stopping previous recording");   do_stop("Stopping previous recording");
Ligne 1715: Ligne 1722:
  <h3><a href="http://%s/saveconfig"> saveconfig</a></h3>  <h3><a href="http://%s/saveconfig"> saveconfig</a></h3>
  
-Fichier sur la microSD /config.json ex: {"framesize":6,"repeat":100,"xspeed":1,"gray":0,"quality":10,"capture_interval":10000,"total_frames":180},+Fichier sur la microSD /config.json ex: {"framesize":6,"repeat":100,"xspeed":1,"gray":0,"quality":10,"capture_interval":10000,"length":180},
 cf list<br> cf list<br>
  LED flash sur une frame, SOS flash si pas de microSD<br>  LED flash sur une frame, SOS flash si pas de microSD<br>
Ligne 1749: Ligne 1756:
   File root = fs.open(dirname);   File root = fs.open(dirname);
   if (!root) {   if (!root) {
-    Serial.println(F("Failed to open directory"));+    Serial.println(F("err open dir"));
     return;     return;
   }   }
   if (!root.isDirectory()) {   if (!root.isDirectory()) {
-    Serial.println(F("Not a directory"));+    Serial.println(F("Not a dir"));
     return;     return;
   }   }
Ligne 1759: Ligne 1766:
  
   while (file) {   while (file) {
 +    delay(100);
     if (file.isDirectory()) {     if (file.isDirectory()) {
       output += "<br><h2><a href=\"http://";       output += "<br><h2><a href=\"http://";
Ligne 1768: Ligne 1776:
       output += "</a></h2>";       output += "</a></h2>";
       output += "\n";       output += "\n";
-      Serial.println((String)file.name()); +      //Serial.println((String)file.name());
       if (levels) {       if (levels) {
         listDir(fs, file.name(), levels - 1);         listDir(fs, file.name(), levels - 1);
Ligne 1783: Ligne 1790:
       output += "  : ";       output += "  : ";
       output += file.size();       output += file.size();
-      Serial.println((String)file.name()); +      //Serial.println((String)file.name());
     }     }
     file = root.openNextFile();     file = root.openNextFile();
Ligne 1797: Ligne 1803:
   output += "</body></html>";   output += "</body></html>";
   server.send(200, "text/html", output);   server.send(200, "text/html", output);
-  Serial.println(F("fin"));+  //Serial.println(F("fin"));
   return;   return;
 } }
Ligne 1803: Ligne 1809:
 bool listDir_handler() { bool listDir_handler() {
   listDir(SD_MMC, "/", 0);   listDir(SD_MMC, "/", 0);
-  Serial.println(F("listDir fin"));+  //Serial.println(F("listDir fin"));
  
   return true;   return true;
Ligne 1887: Ligne 1893:
 bool saveSPIFFSConfigFile(void) bool saveSPIFFSConfigFile(void)
 { {
-  Serial.println(F("Saving config"));+  Serial.println(F("Save config"));
   recording = 0;   recording = 0;
   DynamicJsonDocument json(512);   DynamicJsonDocument json(512);
Ligne 1896: Ligne 1902:
   json["repeat"            = repeat;   json["repeat"            = repeat;
   json["xspeed"            = xspeed;   json["xspeed"            = xspeed;
-  json["total_frames"      total_frames;+  json["length"            xlength;
   json["gray"              = gray;   json["gray"              = gray;
   json["ssid"              = ssid;   json["ssid"              = ssid;
Ligne 1962: Ligne 1968:
   Serial.println(F("Camera http started"));   Serial.println(F("Camera http started"));
 } }
 +</code>
projets/esp32-cam_timelaps_code.1591188598.txt.gz · Dernière modification : 2024/02/09 16:55 (modification externe)