diff --git a/Horloge_Nixie_firmware.ino b/Horloge_Nixie_firmware.ino index 5c31c8e..c61b313 100644 --- a/Horloge_Nixie_firmware.ino +++ b/Horloge_Nixie_firmware.ino @@ -27,17 +27,20 @@ RTC_DS1307 rtc; // void syncNTPtoRTC(){ + //// Récupération du temps Internet par NTP Serial.println ("Routine de synchro NTP vers RTC :"); Serial.print ("- récupération du temps Internet : "); ntp.update(); // récupération du temps NTP Serial.println(ntp.formattedTime("%T")); // hh:mm:ss + //// Mise à jour du temps RTC de l'horloge locale Serial.print ( "- enregistrement du temps Internet dans l'horlore RTC" ); rtc.adjust(DateTime(ntp.year(), ntp.month(), ntp.day(), ntp.hours(), ntp.minutes(), ntp.seconds())); Serial.println ( " : OK." ); - Serial.print ( "Maintenant l'horloge interne indique : " ); + //// Affichage du temps RTC en console série pour débug DateTime now = rtc.now(); + Serial.print ( "Maintenant l'horloge interne indique : " ); Serial.print(daysOfTheWeek[now.dayOfTheWeek()]); Serial.print(" "); Serial.print(now.day(), DEC); @@ -83,6 +86,7 @@ void setup () { ntp.update(); Serial.println(ntp.formattedTime("%A %d/%m/%Y, il est : %T")); // www dd/mm/yyyy hh:mm:ss + //// Initialisation RTC Serial.print("Initialisation RTC"); if (! rtc.begin()) { Wire.begin(I2C_SDA,I2C_SCL); // Broches (SDA,SCL) de l'I2C pour la RTC @@ -94,14 +98,14 @@ void setup () { } Serial.println (" : OK"); - syncNTPtoRTC(); + syncNTPtoRTC(); // Mise à l'heure de l'horloge RTC locale avec l'heure Internet } ///////////////////////////////////////////////////// void loop () { - Serial.println("Rien"); + Serial.print("Rien "); delay(10000); } diff --git a/README.md b/README.md index 24310e9..df3ade0 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,23 @@ -Firmware ESP32 pour mon horloge Nixie +Firmware ~~ESP32~~ actuellement ESP8266 pour mon horloge Nixie +sera migré sur ESP32 plus tard -Utilise les librairies : wifi, NTPClient, WiFiUdp \ No newline at end of file +## Librairies utilisées : +- ESP8266WiFi +- WiFiUdp +- RTClib (https://github.com/adafruit/RTClib) +- NTP (https://github.com/sstaub/NTP) + +## Personnalisation : +Personnalisez le fichier 'secrets.h.default' avec vos identifiants de connexion WiFi +et renommez-le en 'secrets.h' + +## TODO : +Gestion des erreurs +- [ ] WiFi : utiliser le Wifi Manager https://github.com/tzapu/WiFiManager +- [ ] NTP : en cas d'echec de récupération du temps Internet +Ajouts de fonctionnalités +- [ ] affichage de l'heure sur Nixie +- [ ] ajustement de l'heure par encodeur rotatif +- [ ] alarme réveil par buzer/HP ? +- [ ] +- [ ] \ No newline at end of file