jameszah / ESP32-CAM-Video-Recorder

Video Recorder for ESP32-CAM with http server for config and ftp (or http) server to download video
GNU General Public License v3.0
443 stars 101 forks source link

Library time.h #45

Closed JFJO closed 2 years ago

JFJO commented 3 years ago

Bonjour j'ai apprécié votre code Mais je n'arrive pas à obtenir la date pour l'enregistrement des photos et des videos. Je pense que cela vient du fichier time.h J'ai mis à jour avec Time-1.6.0.zip https://github.com/PaulStoffregen/Time ecran_serveur Ce fichier est remplacé par Timelib.h Quand j'utilise Timelib.h j'ai de nombreuses erreur de compilation.

Merci de me conseiller pour solutionner mon problème.

jameszah commented 3 years ago

But I can't seem to get the date for recording the photos and videos.

Do you have internet access from the esp32? Are there firewalls blocking the esp32 from calling for time, and time getting back to the esp32.

This code fetches the date from pool.ntp.org -- you might try an alternate time server for your area. Find some here https://www.ntppool.org/en/

configTime(0, 0, "pool.ntp.org");

  setenv("TZ", TIMEZONE, 1);  // mountain time zone from #define at top
  tzset();

Then this code loops until it gets a date returned, before giving up after too many retry_count.

  while (timeinfo.tm_year < (2016 - 1900) && ++retry < retry_count) {
    Serial.printf("Waiting for system time to be set... (%d/%d) -- %d\n", retry, retry_count, timeinfo.tm_year);
    delay(1000);
    time(&now);
    localtime_r(&now, &timeinfo);
  }

You don't need any more time libraries or includes.