Cloc - Alarm Clock 2.0

The alarm clock you've always dreamed of!
Cloc is an original alarm clock. Developed around an ESP32 module, it has functions not found in a commercial product:
- Automatic time setting from NTP server thanks to integrated Wi-Fi.
- Fully configurable by an integrated web server (PC, IOS, Android compatible ...).
- Time and alarm display on two separate displays. Seconds are indicated by flashing the digital point of the time display. The alarm has several display modes (off, fixed, flashing when the alarm is activated).
- Different alarms for each day of the week
- Integrated beep reproducing the sound of a classic electronic alarm clock
- IR transmission and reception to turn on and select a song from your playlist or your favorite radio station as an alarm. Simply place Cloc near your hi-fi system or your multimedia player.
- Two buttons only (Stop and Disable alarm)
- Display brightness as function of time is programmable from the HTML interface
- Updates of the firmware and the embedded WEB server can be done remotely in OTA mode.
This project is scheduled for publication in the March/April edition of Elektor Magazine. The article will, of course, include the schematic (and lots of explanations).
To be continued...
--------------------------------------------------- En français -----------------------------------------------------------------------
Cloc est un réveil original, car développé autour d'un module ESP32, il intègre des fonctionnalités qu'on ne trouve pas dans un produit du commerce:
- Mise à l'heure automatique grâce à la connexion WiFi intégrée par serveur NTP.
- Entièrement paramétrable par un serveur Web intégré (compatible PC, IOS, Androïd ...).
- Affichage de l'heure et de l'alarme sur 2 afficheurs distincts. La seconde est visualisée par le clignotement du point pour le temps. L'alarme a plusieurs types d'affichage (éteint, fixe clignotant lorsque l'alarme s'active).
- Programmation d' alarmes différentes pour chaque jour de la semaine
- Beep intégré reproduisant le son d'un réveil électronique classique
- Et surtout capteurs IR (émission et réception) intégrés au design et permettant d'allumer et de sélectionner un morceau de sa playlist ou bien sa station de radio préférée en guise de sonnerie d'alarme. Il suffit de poser Cloc près de sa chaine hifi ou de son lecteur multimédia.
- 2 boutons seulement ( Stop alarm et Disable alarm)
- L'a luminosité est réglable selon un créneau horaire qu'on peut programmer depuis l'interface HTML
- La mise à jour du firmware et du serveur WEB embarqué peuvent se faire à distance en mode OTA.
Le projet fera l'objet d'une publication dans le numéro de Mars/Avril du magazine Elektor. Bien entendu l'article publiera le schéma et de nombreuses explications sur le logiciel et le fonctionnement de Cloc 2.0 !
à suivre donc .....
- Automatic time setting from NTP server thanks to integrated Wi-Fi.
- Fully configurable by an integrated web server (PC, IOS, Android compatible ...).
- Time and alarm display on two separate displays. Seconds are indicated by flashing the digital point of the time display. The alarm has several display modes (off, fixed, flashing when the alarm is activated).
- Different alarms for each day of the week
- Integrated beep reproducing the sound of a classic electronic alarm clock
- IR transmission and reception to turn on and select a song from your playlist or your favorite radio station as an alarm. Simply place Cloc near your hi-fi system or your multimedia player.
- Two buttons only (Stop and Disable alarm)
- Display brightness as function of time is programmable from the HTML interface
- Updates of the firmware and the embedded WEB server can be done remotely in OTA mode.
This project is scheduled for publication in the March/April edition of Elektor Magazine. The article will, of course, include the schematic (and lots of explanations).
To be continued...
--------------------------------------------------- En français -----------------------------------------------------------------------
Cloc est un réveil original, car développé autour d'un module ESP32, il intègre des fonctionnalités qu'on ne trouve pas dans un produit du commerce:
- Mise à l'heure automatique grâce à la connexion WiFi intégrée par serveur NTP.
- Entièrement paramétrable par un serveur Web intégré (compatible PC, IOS, Androïd ...).
- Affichage de l'heure et de l'alarme sur 2 afficheurs distincts. La seconde est visualisée par le clignotement du point pour le temps. L'alarme a plusieurs types d'affichage (éteint, fixe clignotant lorsque l'alarme s'active).
- Programmation d' alarmes différentes pour chaque jour de la semaine
- Beep intégré reproduisant le son d'un réveil électronique classique
- Et surtout capteurs IR (émission et réception) intégrés au design et permettant d'allumer et de sélectionner un morceau de sa playlist ou bien sa station de radio préférée en guise de sonnerie d'alarme. Il suffit de poser Cloc près de sa chaine hifi ou de son lecteur multimédia.
- 2 boutons seulement ( Stop alarm et Disable alarm)
- L'a luminosité est réglable selon un créneau horaire qu'on peut programmer depuis l'interface HTML
- La mise à jour du firmware et du serveur WEB embarqué peuvent se faire à distance en mode OTA.
Le projet fera l'objet d'une publication dans le numéro de Mars/Avril du magazine Elektor. Bien entendu l'article publiera le schéma et de nombreuses explications sur le logiciel et le fonctionnement de Cloc 2.0 !
à suivre donc .....
Project Elements
Proto 1 verso (PNG, 2.65 MB)
C'est mon premier proto
New Settings Page (PNG, 62.84 KB)
For buzzer optimization.
Proto 1 verso (PNG, 2.54 MB)
Premier proto côté recto
capture-decran-rtc-time.png (PNG, 33.52 KB)
RTC time
ESP Tool screen shot (PNG, 97.57 KB)
Be careful with the adress !
Web 3 (JPG, 27.64 KB)
Alarmes programmables
Web 2 (JPG, 25.78 KB)
Paramètres systèmes
Web 1 (JPG, 25.32 KB)
Ecran principal
libraries_17072023.zip
(ZIP)
libraries includeing Adafruit_BusIO
Bin files.zip
(ZIP)
All the files to direct programming the ESP32 using ESP Tools
Alarm_Clock 2.02.rar
(RAR)
version 2.02 14012023
Alarm_Clock 2.03.rar
(RAR)
version 2.03 14012023
change Alarm J+1 with Alarm D+1 (Day is Jour in french !) in the parametres.html file. Please update ESP32 Sketch Data Upload in the IDE.
SimpleReceiver.rar
(RAR)
Allows to easely view the code of your IR remote on the serial port of the ESP32.
Libraries.rar
(RAR)
Libraries
Alarm_Clock 2.10.rar
(RAR)
Corrects several bugs, including the capability to use any character for ssid and password.
Alarm_Clock 2.20.rar
(RAR)
Slight modification on the parameters page (now you can enter the full Gateway IP).
Alarm_Clock 2.41.zip
(ZIP)
Alarm_Clock 2.50.zip
(ZIP)
Beep optimization ! See update from the author.
Alarm_Clock 2.30.zip
(ZIP)
New firmware and SPIFFS. The web page now shows RTC time (if a RTC module is connected) or NTP time.
220564 Cloc KiCad6 v1.2 30112022-2.zip
(ZIP)
KiCad6 project + BoM
Direct programming the ESP32 using ESP Tool
(DOCX)
The .bin files have been included in the firmware section.
Discussion (11 comments)

Andi 1 year ago
Hallo, schönes Projekt! Danke! Ich habe den Wecker inzwischen auch in Betrieb.
Die rote LED vom ESP32-Kit habe ich inzwischen ausgemacht.
Allerdings ist der Buzzer zur Weckzeit bei mir sehr leise und ich habe Sorgen, dass ich mal verschlafe. ;-)
Ich habe den Bausatz von Elektror gekauft und leider das Etikett des Buzzers schon entsorgt. Welcher Typ genau mitgeliefert wurde, bekomme ich wahrscheinlich nicht raus. Es gibt da ja sicher auch lautere Typen.
Kann man den Buzzer per Software lauter bekommen oder muss ich doch einen separat anschließen? Ich habe im Quellcode nicht wirklich eine passende Stelle gefunden.
Per Transistor und dann gegen 5V wäre wohl die Lösung.?
Danke und viele Grüße
A.
PS: Inzwischen habe ich noch mal nachgesehen, welcher Typ Buzzer es ist: KPM-1205A
Das ist natürlich kein 3,3V-Typ, sondern 5V! Und besonders laut ist er laut Datenblatt auch nicht. Danke Elektror, mal wieder irgendwas geliefert! Laut Stückliste also eine Falschlieferung!
Ich habe jetzt einen Transistortreiber gegen 5V ergänzt. Es scheint ein wenig lauter zu sein.
Aber ich werde mich wahrscheinlich trotzem um einen anderen Typ umsehen.
Vielleicht kann man ja ausserdem an der Software noch etwas "drehen"!?
Danke!
Die rote LED vom ESP32-Kit habe ich inzwischen ausgemacht.
Allerdings ist der Buzzer zur Weckzeit bei mir sehr leise und ich habe Sorgen, dass ich mal verschlafe. ;-)
Ich habe den Bausatz von Elektror gekauft und leider das Etikett des Buzzers schon entsorgt. Welcher Typ genau mitgeliefert wurde, bekomme ich wahrscheinlich nicht raus. Es gibt da ja sicher auch lautere Typen.
Kann man den Buzzer per Software lauter bekommen oder muss ich doch einen separat anschließen? Ich habe im Quellcode nicht wirklich eine passende Stelle gefunden.
Per Transistor und dann gegen 5V wäre wohl die Lösung.?
Danke und viele Grüße
A.
PS: Inzwischen habe ich noch mal nachgesehen, welcher Typ Buzzer es ist: KPM-1205A
Das ist natürlich kein 3,3V-Typ, sondern 5V! Und besonders laut ist er laut Datenblatt auch nicht. Danke Elektror, mal wieder irgendwas geliefert! Laut Stückliste also eine Falschlieferung!
Ich habe jetzt einen Transistortreiber gegen 5V ergänzt. Es scheint ein wenig lauter zu sein.
Aber ich werde mich wahrscheinlich trotzem um einen anderen Typ umsehen.
Vielleicht kann man ja ausserdem an der Software noch etwas "drehen"!?
Danke!
Reply
Show more
2 Comment(s)

Richard Leach 1 year ago
Built the clock compiled and loaded software but a cannot connect to the default page to set the clock up. Here is the serial dump on switch on:
1. I/O initialized
2. Buzz initialized : E (538) ledc: freq_hz=0 duty_resolution=8
E (539) ledc: ledc_get_duty(740): LEDC is not initialized
3. Initialization of DS3231 RTC > Couldn't find RTC DS3231
4. Initializing EEPROM... done
SSID: chambre Password: enablemeplease
Lundi > 1 - 07:40 Mardi > 1 - 07:00 Mercredi > 1 - 07:45 Jeudi > 1 - 07:00
Vendredi > 1 - 07:45 Samedi > 1 - 07:05 Dimanche > 0 - 10:00
Durée alarme > 00:30 - Alarm disabled: 0
Bright Start > 07:30 Bright Stop > 23:30
Alarm J+1 > 22:30 - End of previous alarm: 1
Time offset > 1.0 - Auto Daylight: 1
Media ON > 07f8 - Media OFF > 4cb3
Buzzer > OFF
DHCP mode > OFF
IP Fixe > 192.168.010.049
Gateway > 192.168.010.001
5. SPIFFS volume is mounted
6. Trying to connect to [chambre] : ...............
7. Failed to connect. Starting access point [ESP32 CLOCK] .
Connected in AP mode (192.168.4.1)
8. Ignore NTP - access to the server
9. Web server started
1. I/O initialized
2. Buzz initialized : E (538) ledc: freq_hz=0 duty_resolution=8
E (539) ledc: ledc_get_duty(740): LEDC is not initialized
3. Initialization of DS3231 RTC > Couldn't find RTC DS3231
4. Initializing EEPROM... done
SSID: chambre Password: enablemeplease
Lundi > 1 - 07:40 Mardi > 1 - 07:00 Mercredi > 1 - 07:45 Jeudi > 1 - 07:00
Vendredi > 1 - 07:45 Samedi > 1 - 07:05 Dimanche > 0 - 10:00
Durée alarme > 00:30 - Alarm disabled: 0
Bright Start > 07:30 Bright Stop > 23:30
Alarm J+1 > 22:30 - End of previous alarm: 1
Time offset > 1.0 - Auto Daylight: 1
Media ON > 07f8 - Media OFF > 4cb3
Buzzer > OFF
DHCP mode > OFF
IP Fixe > 192.168.010.049
Gateway > 192.168.010.001
5. SPIFFS volume is mounted
6. Trying to connect to [chambre] : ...............
7. Failed to connect. Starting access point [ESP32 CLOCK] .
Connected in AP mode (192.168.4.1)
8. Ignore NTP - access to the server
9. Web server started
Reply

Richard Leach 1 year ago
Solved that problem now - I was trying to connect to the wifi with a computer that didn't have wifi !!
Next problem is how to change the remote control to support another device. I could do with some pointers to get me started
Next problem is how to change the remote control to support another device. I could do with some pointers to get me started
Reply

ybourdon 1 year ago
See IRremote exemple Simple Sender in your IDE. You have to adapt the protocol by changing these lines in the Alarm_Clock source code: Change or comment line 125 (-- #define DECODE_BOSEWAVE) : And change these 2 lines (353 and 364) from IrSender.sendBoseWave(code) to IrSender.send.......Use the included SimpleReceiver file (wich is already configured for Alarm Cloc) to test your codes.
Reply
Show more
1 Comment(s)

HeJa 1 year ago
Hello Mr. Bourdon,
Thank you for your great project! I will learn a lot about the ESP32 , and have a nice alarm-clock as well!
I am using the ArduinoIDE 1.8.19, with ESP32-boards version 2.0.9, with your libraries, and instructions.
First compile said:
==============================================================================
In file included from D:\Electronica\Arduino\ESP32_Cloc\Alarm_Clock\Alarm_Clock.ino:21:
More than one library found for "EEPROM.h"
D:\Electronica\Arduino\libraries\RTClib\src/RTClib.h:25:10: fatal error: Adafruit_I2CDevice.h: No such file or directory
Used: D:\ArduinoIDE\portable\packages\esp32\hardware\esp32\2.0.9\libraries\EEPROM
#include <Adafruit_I2CDevice.h>
Not used: D:\Electronica\Arduino\libraries\EEPROM
^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Erorr compiling for board ESP32 PICO-D4
==============================================================================
It uses the correct (esp32) EEPROM-library, but there is a library missing!
So I downloaded library Adafruit_BusIO-master. And compiled again, it gave all the errors Herr Reiner Seibt showed in his comment below!
Now here is the strange thing: in my IDE-preferences I use "compiler warnings = ALL". When I compile with "compiler warnings = STANDARD" here is the result:
==============================================================================In file included from D:\Electronica\Arduino\ESP32_Cloc\Alarm_Clock\Alarm_Clock.ino:26:
D:\Electronica\Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:4:2: warning: #warning AsyncElegantOTA.loop(); is deprecated, please remove it from loop() if defined. This function will be removed in a future release. [-Wcpp]
#warning AsyncElegantOTA.loop(); is deprecated, please remove it from loop() if defined. This function will be removed in a future release.
^~~~~~~
In file included from D:\Electronica\Arduino\ESP32_Cloc\Alarm_Clock\Alarm_Clock.ino:126:
D:\Electronica\Arduino\libraries\Arduino-IRremote-master\src/IRremote.hpp:219:2: warning: #warning INFO: For ESP32, RP2040, mbed and particle boards SEND_PWM_BY_TIMER is enabled by default. If this is not intended, deactivate the line in IRremote.hpp over this warning message in file IRremote.hpp. [-Wcpp]
#warning INFO: For ESP32, RP2040, mbed and particle boards SEND_PWM_BY_TIMER is enabled by default. If this is not intended, deactivate the line in IRremote.hpp over this warning message in file IRremote.hpp.
^~~~~~~
De schets gebruikt 971669 bytes (74%) programma-opslagruimte. Maximum is 1310720 bytes.
Globale variabelen gebruiken 46760 bytes (14%) van het dynamisch geheugen. Resteren 280920 bytes voor lokale variabelen. Maximum is 327680 bytes.
==============================================================================
It compiles OK (sorry for the last lines in Dutch), with only 2 warnings!
So, the level of compiler warnings decides what is an error? This is strange behaviour. I think many ArduinoIDE users have STANDARD (and so do you I presume!), but I normally use ALL, because I want my software to be as "clean as possible".
1) Please can you elaborate on the two remaining WARNINGS, and on the type-difference errors in the comment below of Herr Reiner Seibt ?
2) And should I replace the NTP-server name for a Dutch one?
Thank you in advance for your reaction!
Greetings from
Hennie Jalink
Deventer
The Netherlands
henniejalink@hotmail.com
Thank you for your great project! I will learn a lot about the ESP32 , and have a nice alarm-clock as well!
I am using the ArduinoIDE 1.8.19, with ESP32-boards version 2.0.9, with your libraries, and instructions.
First compile said:
==============================================================================
In file included from D:\Electronica\Arduino\ESP32_Cloc\Alarm_Clock\Alarm_Clock.ino:21:
More than one library found for "EEPROM.h"
D:\Electronica\Arduino\libraries\RTClib\src/RTClib.h:25:10: fatal error: Adafruit_I2CDevice.h: No such file or directory
Used: D:\ArduinoIDE\portable\packages\esp32\hardware\esp32\2.0.9\libraries\EEPROM
#include <Adafruit_I2CDevice.h>
Not used: D:\Electronica\Arduino\libraries\EEPROM
^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Erorr compiling for board ESP32 PICO-D4
==============================================================================
It uses the correct (esp32) EEPROM-library, but there is a library missing!
So I downloaded library Adafruit_BusIO-master. And compiled again, it gave all the errors Herr Reiner Seibt showed in his comment below!
Now here is the strange thing: in my IDE-preferences I use "compiler warnings = ALL". When I compile with "compiler warnings = STANDARD" here is the result:
==============================================================================In file included from D:\Electronica\Arduino\ESP32_Cloc\Alarm_Clock\Alarm_Clock.ino:26:
D:\Electronica\Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:4:2: warning: #warning AsyncElegantOTA.loop(); is deprecated, please remove it from loop() if defined. This function will be removed in a future release. [-Wcpp]
#warning AsyncElegantOTA.loop(); is deprecated, please remove it from loop() if defined. This function will be removed in a future release.
^~~~~~~
In file included from D:\Electronica\Arduino\ESP32_Cloc\Alarm_Clock\Alarm_Clock.ino:126:
D:\Electronica\Arduino\libraries\Arduino-IRremote-master\src/IRremote.hpp:219:2: warning: #warning INFO: For ESP32, RP2040, mbed and particle boards SEND_PWM_BY_TIMER is enabled by default. If this is not intended, deactivate the line in IRremote.hpp over this warning message in file IRremote.hpp. [-Wcpp]
#warning INFO: For ESP32, RP2040, mbed and particle boards SEND_PWM_BY_TIMER is enabled by default. If this is not intended, deactivate the line in IRremote.hpp over this warning message in file IRremote.hpp.
^~~~~~~
De schets gebruikt 971669 bytes (74%) programma-opslagruimte. Maximum is 1310720 bytes.
Globale variabelen gebruiken 46760 bytes (14%) van het dynamisch geheugen. Resteren 280920 bytes voor lokale variabelen. Maximum is 327680 bytes.
==============================================================================
It compiles OK (sorry for the last lines in Dutch), with only 2 warnings!
So, the level of compiler warnings decides what is an error? This is strange behaviour. I think many ArduinoIDE users have STANDARD (and so do you I presume!), but I normally use ALL, because I want my software to be as "clean as possible".
1) Please can you elaborate on the two remaining WARNINGS, and on the type-difference errors in the comment below of Herr Reiner Seibt ?
2) And should I replace the NTP-server name for a Dutch one?
Thank you in advance for your reaction!
Greetings from
Hennie Jalink
Deventer
The Netherlands
henniejalink@hotmail.com
Reply

ybourdon 1 year ago
I am currently on holidays.
I will come back to you in some days.
Many people have built this Clock without any issue with the compilation.
Have you used the included librairie files ?
No need to change the NTP if you use this Clock in Europe.
Regards.
Yves
I will come back to you in some days.
Many people have built this Clock without any issue with the compilation.
Have you used the included librairie files ?
No need to change the NTP if you use this Clock in Europe.
Regards.
Yves
Reply

HeJa 1 year ago
Thanks, Yves! Enjoy your holidays :<)
1) I think most people have STANDARD compiler-messages in their IDE-preferences... and they do not look at any warnings, I'm afraid. The type-mismatch (String versus char*) is the reason for the compiler to give an error, but only when I use ALL in my preferences. And as there are no signs that printf() gives runtime errors, I will compile with STANDARD.
2) I used the included libraries, yet there was one "missing" ( Adafruit_BusIO-master ).
3) I will keep the NTP, thanks!
1) I think most people have STANDARD compiler-messages in their IDE-preferences... and they do not look at any warnings, I'm afraid. The type-mismatch (String versus char*) is the reason for the compiler to give an error, but only when I use ALL in my preferences. And as there are no signs that printf() gives runtime errors, I will compile with STANDARD.
2) I used the included libraries, yet there was one "missing" ( Adafruit_BusIO-master ).
3) I will keep the NTP, thanks!
Reply

HeJa 1 year ago
Hello Yves,
My cloc2.0 is assembled en software loaded. The hardware works fine.
0) As for the "String versus char* " errors (when using ALL in the IDE-settings for "compiler warnings"):
These can be remedied by adding .c_str() to the String-parameters. This String method returns the char* to the content of the String.
1) software does not take into account that ssid and/or pwd can contain %-characters (which I have...). So clock.html did not show in browser, because of a js-error! So I performed a String.replace( "%", "%") on ssid and pwd in webserver.processor functions, and the screens show now as it should.
2) when refreshing clock-screen in browser the string "dBm" is added to rssi again and again. This may occur because of line 90 in parametres.js:
rssi.value = rssi.value + " dBm";
Should it be? rssi.value = r + " dBm"; /* 20230814 This works OK! */
3) updating in parametres.html does work for Buzzer ON, but not for Media ON/OFF, Fixed IP. I have not tested yet updates of ssid and pwd because of the %-troubles...
I'm relatively new to webservers and async requests, and I try to work out what happens in webserver.ino:
- onSetParam() is only called when the Save-button is pushed. But some field-changes are directly triggered i.e. onSetWifiSetup()? So I see updating wifi ssid and pwd twice ! Why is this?
Updating parameters via Save-button
==============================
20230814 So far updating via Save-button does not work for me.
I'm busy testing. I can see that the Request-data received breaks when using chars like % & #, because they seem to have special meaning in the used protocol!
When I replace them in parametres.js (with, say, %=.P &=.A etc) the data arrives ok in 10 parameters. And then there is the big if-statement in webserver.onSetParam(): the condition is always false when special characters are in the fields... I'm working on a solution for this.
20230815 I have reworked the function onSetParam( AsyncWebServerRequest *request), and it looks good. So far I checked which "special" characters (in ssid and pwd) will break the message: % # and &. I replaced them with ".P", ".H" and ".A" in the .js, and decoded them back in webserver.ino source. But testing is still busy! As soon as testing is done, I will drop webserver.ino below.
4) there are some errors in the .css files, as can be seen in Firefox CTRL-SHIF-I:
4.1 font-size: 14pt;//Divers textes : CLOCK , Time, Min, Max,.....
// as comment should be /* .... */ I think
20230814 this works!
4.2 -moz-box-shadow: inset 0 2px 4px #000, 0 1px 1px rgba(255, 255, 255, 0.3);
Unknown attribute ‘-moz-box-shadow’. Declaration ignored.
20230813 I found that these are (old!) browser-specific style elements, which can be deleted (as long as we use modern browsers :<)
I'm grateful for your help!
HeJa
My cloc2.0 is assembled en software loaded. The hardware works fine.
0) As for the "String versus char* " errors (when using ALL in the IDE-settings for "compiler warnings"):
These can be remedied by adding .c_str() to the String-parameters. This String method returns the char* to the content of the String.
1) software does not take into account that ssid and/or pwd can contain %-characters (which I have...). So clock.html did not show in browser, because of a js-error! So I performed a String.replace( "%", "%") on ssid and pwd in webserver.processor functions, and the screens show now as it should.
2) when refreshing clock-screen in browser the string "dBm" is added to rssi again and again. This may occur because of line 90 in parametres.js:
rssi.value = rssi.value + " dBm";
Should it be? rssi.value = r + " dBm"; /* 20230814 This works OK! */
3) updating in parametres.html does work for Buzzer ON, but not for Media ON/OFF, Fixed IP. I have not tested yet updates of ssid and pwd because of the %-troubles...
I'm relatively new to webservers and async requests, and I try to work out what happens in webserver.ino:
- onSetParam() is only called when the Save-button is pushed. But some field-changes are directly triggered i.e. onSetWifiSetup()? So I see updating wifi ssid and pwd twice ! Why is this?
Updating parameters via Save-button
==============================
20230814 So far updating via Save-button does not work for me.
I'm busy testing. I can see that the Request-data received breaks when using chars like % & #, because they seem to have special meaning in the used protocol!
When I replace them in parametres.js (with, say, %=.P &=.A etc) the data arrives ok in 10 parameters. And then there is the big if-statement in webserver.onSetParam(): the condition is always false when special characters are in the fields... I'm working on a solution for this.
20230815 I have reworked the function onSetParam( AsyncWebServerRequest *request), and it looks good. So far I checked which "special" characters (in ssid and pwd) will break the message: % # and &. I replaced them with ".P", ".H" and ".A" in the .js, and decoded them back in webserver.ino source. But testing is still busy! As soon as testing is done, I will drop webserver.ino below.
4) there are some errors in the .css files, as can be seen in Firefox CTRL-SHIF-I:
4.1 font-size: 14pt;//Divers textes : CLOCK , Time, Min, Max,.....
// as comment should be /* .... */ I think
20230814 this works!
4.2 -moz-box-shadow: inset 0 2px 4px #000, 0 1px 1px rgba(255, 255, 255, 0.3);
Unknown attribute ‘-moz-box-shadow’. Declaration ignored.
20230813 I found that these are (old!) browser-specific style elements, which can be deleted (as long as we use modern browsers :<)
I'm grateful for your help!
HeJa
Reply
Show more
1 Comment(s)

Reiner Seibt 1 year ago
Hallo, Herr Bourdon,
ich nutze die Arduino-IDE 1.8.19, um den ESp32 Pico D4 nutzen zukönnen, wurde über GitHub-Link ESP32 v2.0.9 installiert (eine andere Version hat er nicht angeboten).
Beim compilieren kommen einige Fehler bei den Libraries.
AsyncElegantOTA zeigt 2 Warnungen an.
ESPAsyncWebServer hat bei der letzten Version den Namen nach ESPAsyncWebSrv geändert. (Sollte ich alle gefunden haben)
Die EEPROM-Lib. wird bei mir durch die von ESP32 ersetzt. ???
Es gibt aber einige Fehler, siehe Listing, im Bereich eeprom und webserver mit serial.printf Fehlern.???
Muß die Software an die neuen Libs (Juli 2023 angepaßt werden)?
ich habe die Libraries von Download probiert, Fehler bleiben??
Mit freundlichen Grüßen
Reiner Seibt
Email: RSeibt@T-Online.de
---------------
Fehler Listing Arduino IDE 1.8.19 mit ESP32 v2.0.9 (vom Juli 2023) ---------------
---------------
In file included from H:\Eigene Dateien\- Arduino\Alarm_Clock\Alarm_Clock.ino:26:
H:\Eigene Dateien\- Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:4:2: warning: #warning AsyncElegantOTA.loop(); is deprecated, please remove it from loop() if defined. This function will be removed in a future release. [-Wcpp]
#warning AsyncElegantOTA.loop(); is deprecated, please remove it from loop() if defined. This function will be removed in a future release.
^~~~~~~
In file included from H:\Eigene Dateien\- Arduino\Alarm_Clock\Alarm_Clock.ino:126:
H:\Eigene Dateien\- Arduino\libraries\IRremote\src/IRremote.hpp:204:2: warning: #warning INFO: For ESP32, RP2040, mbed and particle boards SEND_PWM_BY_TIMER is enabled by default. If this is not intended, deactivate the line in IRremote.hpp over this warning message in file IRremote.hpp. [-Wcpp]
#warning INFO: For ESP32, RP2040, mbed and particle boards SEND_PWM_BY_TIMER is enabled by default. If this is not intended, deactivate the line in IRremote.hpp over this warning message in file IRremote.hpp.
^~~~~~~
H:\Eigene Dateien\- Arduino\Alarm_Clock\eeprom.ino: In function 'void printEEPROM()':
eeprom:93:19: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("SSID: %s Password: %s\n", wifi.ssid, wifi.pwd.c_str());
^~~~~~~~~~~~~~~~~~~~~~~~~~
eeprom:94:19: error: format '%s' expects argument of type 'char*', but argument 4 has type 'String' [-Werror=format=]
Serial.printf("Lundi > %i - %s Mardi > %i - %s Mercredi > %i - %s Jeudi > %i - %s\n", timer.lunActif, timer.lun_start, timer.marActif, timer.mar_start, timer.merActif, timer.mer_start, timer.jeuActif,timer.jeu_start);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eeprom:94:19: error: format '%s' expects argument of type 'char*', but argument 6 has type 'String' [-Werror=format=]
eeprom:94:19: error: format '%s' expects argument of type 'char*', but argument 8 has type 'String' [-Werror=format=]
eeprom:94:19: error: format '%s' expects argument of type 'char*', but argument 10 has type 'String' [-Werror=format=]
eeprom:95:19: error: format '%s' expects argument of type 'char*', but argument 4 has type 'String' [-Werror=format=]
Serial.printf("Vendredi > %i - %s Samedi > %i - %s Dimanche > %i - %s\n", timer.venActif, timer.ven_start, timer.samActif, timer.sam_start, timer.dimActif, timer.dim_start);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eeprom:95:19: error: format '%s' expects argument of type 'char*', but argument 6 has type 'String' [-Werror=format=]
eeprom:95:19: error: format '%s' expects argument of type 'char*', but argument 8 has type 'String' [-Werror=format=]
eeprom:96:19: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Durée alarme > %s - Alarm disabled: %i\n", timer.duree, alarmDisable);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eeprom:97:19: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Bright Start > %s Bright Stop > %s \n", bright_start, bright_stop);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eeprom:97:19: error: format '%s' expects argument of type 'char*', but argument 4 has type 'String' [-Werror=format=]
eeprom:98:19: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Alarm J+1 > %s - End of previous alarm: %i\n", alarm_switch, alarmNext);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
H:\Eigene Dateien\- Arduino\Alarm_Clock\init.ino: In function 'void initWiFi()':
init:110:19: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("6. Trying to connect to [%s] : ", wifi.ssid);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
init:138:21: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("7. Connected to %s\n", wifi.ip);
^~~~~~~~~~~~~~~~~~~~~~
H:\Eigene Dateien\- Arduino\Alarm_Clock\webserver.ino: In function 'void onSetParam(AsyncWebServerRequest*)':
webserver:155:26: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Offset: %s hours / GMT\n", String(offsetNew,0));
^~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
webserver:165:26: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Bright ON: %s\n", bright_startNew);
^~~~~~~~~~~~~~~~~
webserver:170:26: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Bright OFF: %s\n", bright_stopNew);
^~~~~~~~~~~~~~~~~~
webserver:176:26: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Alarm display switch: %s\n", alarm_switchNew);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
webserver:185:26: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Media ON: %s\n", med1);
^~~~~~~~~~~~~~~~
webserver:191:26: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Media OFF: %s\n", med2);
^~~~~~~~~~~~~~~~~
webserver:197:26: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Wifi Parameters received: %s\n", ssid);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
webserver:203:26: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Wifi Parameters received: %s\n", pwd);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
H:\Eigene Dateien\- Arduino\Alarm_Clock\webserver.ino: In function 'void onSetWifiSetup(AsyncWebServerRequest*)':
webserver:284:23: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Wifi Parameters received: %s %s\n", ssid, pwd);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
webserver:284:23: error: format '%s' expects argument of type 'char*', but argument 4 has type 'String' [-Werror=format=]
cc1plus.exe: some warnings being treated as errors
Mehrere Bibliotheken wurden für "WiFi.h" gefunden
Benutzt: C:\Users\Reiner Seibt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\WiFi
Nicht benutzt: C:\Program Files (x86)\Arduino\libraries\WiFi
Bibliothek EEPROM in Version 2.0.0 im Ordner: C:\Users\Reiner Seibt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\EEPROM wird verwendet
Bibliothek SPIFFS in Version 2.0.0 im Ordner: C:\Users\Reiner Seibt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\SPIFFS wird verwendet
Bibliothek FS in Version 2.0.0 im Ordner: C:\Users\Reiner Seibt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\FS wird verwendet
Bibliothek LedControl in Version 1.0.6 im Ordner: H:\Eigene Dateien\- Arduino\libraries\LedControl wird verwendet
Bibliothek RTClib in Version 2.1.1 im Ordner: H:\Eigene Dateien\- Arduino\libraries\RTClib wird verwendet
Bibliothek Adafruit_BusIO in Version 1.14.1 im Ordner: H:\Eigene Dateien\- Arduino\libraries\Adafruit_BusIO wird verwendet
Bibliothek Wire in Version 2.0.0 im Ordner: C:\Users\Reiner Seibt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\Wire wird verwendet
Bibliothek WiFi in Version 2.0.0 im Ordner: C:\Users\Reiner Seibt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\WiFi wird verwendet
Bibliothek AsyncTCP-master in Version 1.1.1 im Ordner: H:\Eigene Dateien\- Arduino\libraries\AsyncTCP-master wird verwendet
Bibliothek ESPAsyncWebSrv in Version 1.2.6 im Ordner: H:\Eigene Dateien\- Arduino\libraries\ESPAsyncWebSrv wird verwendet
Bibliothek AsyncElegantOTA in Version 2.2.7 im Ordner: H:\Eigene Dateien\- Arduino\libraries\AsyncElegantOTA wird verwendet
Bibliothek Update in Version 2.0.0 im Ordner: C:\Users\Reiner Seibt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\Update wird verwendet
Bibliothek IRremote in Version 4.0.0 im Ordner: H:\Eigene Dateien\- Arduino\libraries\IRremote wird verwendet
Bibliothek SPI in Version 2.0.0 im Ordner: C:\Users\Reiner Seibt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\SPI wird verwendet
exit status 1
format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
-------------
Update: deaktiviert man die Zeilen // wird der Sketch kompiliert.
Normalerweise dürften diese Sketch-ungenauigkeiten auch bei anderen IDE´s stören ??
-------------
Korrektur des Sketch:
-----------
//Syntax Sketch-Veränderungen: Anzahl: 22, compiling: ok, Funktion: ok, Upload Data und Programm ok,
//eeprom
//93 Serial.printf("SSID: %s Password: %s\n", wifi.ssid.c_str(), wifi.pwd.c_str()); //Fehler, .c_str() erweitert,
//94 Serial.printf("Lundi > %i - %s Mardi > %i - %s Mercredi > %i - %s Jeudi > %i - %s\n", timer.lunActif, timer.lun_start.c_str(),
//95 timer.marActif, timer.mar_start.c_str(), timer.merActif, timer.mer_start.c_str(), timer.jeuActif,timer.jeu_start.c_str()); //Fehler, .c_str() erweitert,
//
//97 Serial.printf("Vendredi > %i - %s Samedi > %i - %s Dimanche > %i - %s\n", timer.venActif, timer.ven_start.c_str(), timer.samActif, timer.sam_start.c_str(), timer.dimActif, timer.dim_start.c_str());
//98 Serial.printf("Durée alarme > %s - Alarm disabled: %i\n", timer.duree.c_str(), alarmDisable); //Fehler, .c_str() erweitert,
//99 Serial.printf("Bright Start > %s Bright Stop > %s \n", bright_start.c_str(), bright_stop.c_str()); //Fehler, .c_str() erweitert,
//100 Serial.printf("Alarm J+1 > %s - End of previous alarm: %i\n", alarm_switch.c_str(), alarmNext); //Fehler, .c_str() erweitert,
//
//init
//110 Serial.printf("6. Trying to connect to [%s] : ", wifi.ssid.c_str()); //Fehler, .c_str() erweitert,
//
//138 Serial.printf("7. Connected to %s\n", wifi.ip.c_str()); //Fehler, .c_str() erweitert,
//
//Webserver
//155 String hilfe = ""; //Variable hilfe NEU
//156 hilfe = String(offsetNew,0); //Variable mit String(offsetNew,0) geladen NEU
//157 Serial.printf("Offset: %s hours / GMT\n", hilfe.c_str()); //Fehler, .c_str() erweitert, alt: Serial.printf("Offset: %s hours / GMT\n", String(offsetNew,0));
//
//167 Serial.printf("Bright ON: %s\n", bright_startNew.c_str()); //Fehler, .c_str() erweitert,
//
//172 Serial.printf("Bright OFF: %s\n", bright_stopNew.c_str()); //Fehler, .c_str() erweitert,
//
//178 Serial.printf("Alarm display switch: %s\n", alarm_switchNew.c_str()); //Fehler, .c_str() erweitert,
//
//187 Serial.printf("Media ON: %s\n", med1.c_str()); //Fehler, .c_str() erweitert,
//
//193 Serial.printf("Media OFF: %s\n", med2.c_str()); //Fehler, .c_str() erweitert,
//
//199 Serial.printf("Wifi Parameters received: %s\n", ssid.c_str()); //Fehler, .c_str() erweitert,
//
//205 Serial.printf("Wifi Parameters received: %s\n", pwd.c_str()); //Fehler, .c_str() erweitert,
//
//286 Serial.printf("Wifi Parameters received: %s %s\n", ssid.c_str(), pwd.c_str()); //Fehler, .c_str() erweitert,
//
//Ende--
Notiz: für Deutschland die NTP-server anpassen.
const char* ntpServer1 = "de.pool.ntp.org"; // serveur NTP Français "pool.ntp.org", DE-Server "de.pool.ntp.org"
const char* ntpServer2 = "ntp1.t-online.de"; // serveur NTP Apple US "time.apple.com",DE-Server "ntp1.t-online.de"
Für eine Fritz-Box: HTCP einschalten.
ich nutze die Arduino-IDE 1.8.19, um den ESp32 Pico D4 nutzen zukönnen, wurde über GitHub-Link ESP32 v2.0.9 installiert (eine andere Version hat er nicht angeboten).
Beim compilieren kommen einige Fehler bei den Libraries.
AsyncElegantOTA zeigt 2 Warnungen an.
ESPAsyncWebServer hat bei der letzten Version den Namen nach ESPAsyncWebSrv geändert. (Sollte ich alle gefunden haben)
Die EEPROM-Lib. wird bei mir durch die von ESP32 ersetzt. ???
Es gibt aber einige Fehler, siehe Listing, im Bereich eeprom und webserver mit serial.printf Fehlern.???
Muß die Software an die neuen Libs (Juli 2023 angepaßt werden)?
ich habe die Libraries von Download probiert, Fehler bleiben??
Mit freundlichen Grüßen
Reiner Seibt
Email: RSeibt@T-Online.de
---------------
Fehler Listing Arduino IDE 1.8.19 mit ESP32 v2.0.9 (vom Juli 2023) ---------------
---------------
In file included from H:\Eigene Dateien\- Arduino\Alarm_Clock\Alarm_Clock.ino:26:
H:\Eigene Dateien\- Arduino\libraries\AsyncElegantOTA\src/AsyncElegantOTA.h:4:2: warning: #warning AsyncElegantOTA.loop(); is deprecated, please remove it from loop() if defined. This function will be removed in a future release. [-Wcpp]
#warning AsyncElegantOTA.loop(); is deprecated, please remove it from loop() if defined. This function will be removed in a future release.
^~~~~~~
In file included from H:\Eigene Dateien\- Arduino\Alarm_Clock\Alarm_Clock.ino:126:
H:\Eigene Dateien\- Arduino\libraries\IRremote\src/IRremote.hpp:204:2: warning: #warning INFO: For ESP32, RP2040, mbed and particle boards SEND_PWM_BY_TIMER is enabled by default. If this is not intended, deactivate the line in IRremote.hpp over this warning message in file IRremote.hpp. [-Wcpp]
#warning INFO: For ESP32, RP2040, mbed and particle boards SEND_PWM_BY_TIMER is enabled by default. If this is not intended, deactivate the line in IRremote.hpp over this warning message in file IRremote.hpp.
^~~~~~~
H:\Eigene Dateien\- Arduino\Alarm_Clock\eeprom.ino: In function 'void printEEPROM()':
eeprom:93:19: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("SSID: %s Password: %s\n", wifi.ssid, wifi.pwd.c_str());
^~~~~~~~~~~~~~~~~~~~~~~~~~
eeprom:94:19: error: format '%s' expects argument of type 'char*', but argument 4 has type 'String' [-Werror=format=]
Serial.printf("Lundi > %i - %s Mardi > %i - %s Mercredi > %i - %s Jeudi > %i - %s\n", timer.lunActif, timer.lun_start, timer.marActif, timer.mar_start, timer.merActif, timer.mer_start, timer.jeuActif,timer.jeu_start);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eeprom:94:19: error: format '%s' expects argument of type 'char*', but argument 6 has type 'String' [-Werror=format=]
eeprom:94:19: error: format '%s' expects argument of type 'char*', but argument 8 has type 'String' [-Werror=format=]
eeprom:94:19: error: format '%s' expects argument of type 'char*', but argument 10 has type 'String' [-Werror=format=]
eeprom:95:19: error: format '%s' expects argument of type 'char*', but argument 4 has type 'String' [-Werror=format=]
Serial.printf("Vendredi > %i - %s Samedi > %i - %s Dimanche > %i - %s\n", timer.venActif, timer.ven_start, timer.samActif, timer.sam_start, timer.dimActif, timer.dim_start);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eeprom:95:19: error: format '%s' expects argument of type 'char*', but argument 6 has type 'String' [-Werror=format=]
eeprom:95:19: error: format '%s' expects argument of type 'char*', but argument 8 has type 'String' [-Werror=format=]
eeprom:96:19: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Durée alarme > %s - Alarm disabled: %i\n", timer.duree, alarmDisable);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eeprom:97:19: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Bright Start > %s Bright Stop > %s \n", bright_start, bright_stop);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
eeprom:97:19: error: format '%s' expects argument of type 'char*', but argument 4 has type 'String' [-Werror=format=]
eeprom:98:19: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Alarm J+1 > %s - End of previous alarm: %i\n", alarm_switch, alarmNext);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
H:\Eigene Dateien\- Arduino\Alarm_Clock\init.ino: In function 'void initWiFi()':
init:110:19: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("6. Trying to connect to [%s] : ", wifi.ssid);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
init:138:21: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("7. Connected to %s\n", wifi.ip);
^~~~~~~~~~~~~~~~~~~~~~
H:\Eigene Dateien\- Arduino\Alarm_Clock\webserver.ino: In function 'void onSetParam(AsyncWebServerRequest*)':
webserver:155:26: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Offset: %s hours / GMT\n", String(offsetNew,0));
^~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
webserver:165:26: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Bright ON: %s\n", bright_startNew);
^~~~~~~~~~~~~~~~~
webserver:170:26: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Bright OFF: %s\n", bright_stopNew);
^~~~~~~~~~~~~~~~~~
webserver:176:26: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Alarm display switch: %s\n", alarm_switchNew);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
webserver:185:26: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Media ON: %s\n", med1);
^~~~~~~~~~~~~~~~
webserver:191:26: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Media OFF: %s\n", med2);
^~~~~~~~~~~~~~~~~
webserver:197:26: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Wifi Parameters received: %s\n", ssid);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
webserver:203:26: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Wifi Parameters received: %s\n", pwd);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
H:\Eigene Dateien\- Arduino\Alarm_Clock\webserver.ino: In function 'void onSetWifiSetup(AsyncWebServerRequest*)':
webserver:284:23: error: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
Serial.printf("Wifi Parameters received: %s %s\n", ssid, pwd);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
webserver:284:23: error: format '%s' expects argument of type 'char*', but argument 4 has type 'String' [-Werror=format=]
cc1plus.exe: some warnings being treated as errors
Mehrere Bibliotheken wurden für "WiFi.h" gefunden
Benutzt: C:\Users\Reiner Seibt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\WiFi
Nicht benutzt: C:\Program Files (x86)\Arduino\libraries\WiFi
Bibliothek EEPROM in Version 2.0.0 im Ordner: C:\Users\Reiner Seibt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\EEPROM wird verwendet
Bibliothek SPIFFS in Version 2.0.0 im Ordner: C:\Users\Reiner Seibt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\SPIFFS wird verwendet
Bibliothek FS in Version 2.0.0 im Ordner: C:\Users\Reiner Seibt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\FS wird verwendet
Bibliothek LedControl in Version 1.0.6 im Ordner: H:\Eigene Dateien\- Arduino\libraries\LedControl wird verwendet
Bibliothek RTClib in Version 2.1.1 im Ordner: H:\Eigene Dateien\- Arduino\libraries\RTClib wird verwendet
Bibliothek Adafruit_BusIO in Version 1.14.1 im Ordner: H:\Eigene Dateien\- Arduino\libraries\Adafruit_BusIO wird verwendet
Bibliothek Wire in Version 2.0.0 im Ordner: C:\Users\Reiner Seibt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\Wire wird verwendet
Bibliothek WiFi in Version 2.0.0 im Ordner: C:\Users\Reiner Seibt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\WiFi wird verwendet
Bibliothek AsyncTCP-master in Version 1.1.1 im Ordner: H:\Eigene Dateien\- Arduino\libraries\AsyncTCP-master wird verwendet
Bibliothek ESPAsyncWebSrv in Version 1.2.6 im Ordner: H:\Eigene Dateien\- Arduino\libraries\ESPAsyncWebSrv wird verwendet
Bibliothek AsyncElegantOTA in Version 2.2.7 im Ordner: H:\Eigene Dateien\- Arduino\libraries\AsyncElegantOTA wird verwendet
Bibliothek Update in Version 2.0.0 im Ordner: C:\Users\Reiner Seibt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\Update wird verwendet
Bibliothek IRremote in Version 4.0.0 im Ordner: H:\Eigene Dateien\- Arduino\libraries\IRremote wird verwendet
Bibliothek SPI in Version 2.0.0 im Ordner: C:\Users\Reiner Seibt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\SPI wird verwendet
exit status 1
format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Werror=format=]
-------------
Update: deaktiviert man die Zeilen // wird der Sketch kompiliert.
Normalerweise dürften diese Sketch-ungenauigkeiten auch bei anderen IDE´s stören ??
-------------
Korrektur des Sketch:
-----------
//Syntax Sketch-Veränderungen: Anzahl: 22, compiling: ok, Funktion: ok, Upload Data und Programm ok,
//eeprom
//93 Serial.printf("SSID: %s Password: %s\n", wifi.ssid.c_str(), wifi.pwd.c_str()); //Fehler, .c_str() erweitert,
//94 Serial.printf("Lundi > %i - %s Mardi > %i - %s Mercredi > %i - %s Jeudi > %i - %s\n", timer.lunActif, timer.lun_start.c_str(),
//95 timer.marActif, timer.mar_start.c_str(), timer.merActif, timer.mer_start.c_str(), timer.jeuActif,timer.jeu_start.c_str()); //Fehler, .c_str() erweitert,
//
//97 Serial.printf("Vendredi > %i - %s Samedi > %i - %s Dimanche > %i - %s\n", timer.venActif, timer.ven_start.c_str(), timer.samActif, timer.sam_start.c_str(), timer.dimActif, timer.dim_start.c_str());
//98 Serial.printf("Durée alarme > %s - Alarm disabled: %i\n", timer.duree.c_str(), alarmDisable); //Fehler, .c_str() erweitert,
//99 Serial.printf("Bright Start > %s Bright Stop > %s \n", bright_start.c_str(), bright_stop.c_str()); //Fehler, .c_str() erweitert,
//100 Serial.printf("Alarm J+1 > %s - End of previous alarm: %i\n", alarm_switch.c_str(), alarmNext); //Fehler, .c_str() erweitert,
//
//init
//110 Serial.printf("6. Trying to connect to [%s] : ", wifi.ssid.c_str()); //Fehler, .c_str() erweitert,
//
//138 Serial.printf("7. Connected to %s\n", wifi.ip.c_str()); //Fehler, .c_str() erweitert,
//
//Webserver
//155 String hilfe = ""; //Variable hilfe NEU
//156 hilfe = String(offsetNew,0); //Variable mit String(offsetNew,0) geladen NEU
//157 Serial.printf("Offset: %s hours / GMT\n", hilfe.c_str()); //Fehler, .c_str() erweitert, alt: Serial.printf("Offset: %s hours / GMT\n", String(offsetNew,0));
//
//167 Serial.printf("Bright ON: %s\n", bright_startNew.c_str()); //Fehler, .c_str() erweitert,
//
//172 Serial.printf("Bright OFF: %s\n", bright_stopNew.c_str()); //Fehler, .c_str() erweitert,
//
//178 Serial.printf("Alarm display switch: %s\n", alarm_switchNew.c_str()); //Fehler, .c_str() erweitert,
//
//187 Serial.printf("Media ON: %s\n", med1.c_str()); //Fehler, .c_str() erweitert,
//
//193 Serial.printf("Media OFF: %s\n", med2.c_str()); //Fehler, .c_str() erweitert,
//
//199 Serial.printf("Wifi Parameters received: %s\n", ssid.c_str()); //Fehler, .c_str() erweitert,
//
//205 Serial.printf("Wifi Parameters received: %s\n", pwd.c_str()); //Fehler, .c_str() erweitert,
//
//286 Serial.printf("Wifi Parameters received: %s %s\n", ssid.c_str(), pwd.c_str()); //Fehler, .c_str() erweitert,
//
//Ende--
Notiz: für Deutschland die NTP-server anpassen.
const char* ntpServer1 = "de.pool.ntp.org"; // serveur NTP Français "pool.ntp.org", DE-Server "de.pool.ntp.org"
const char* ntpServer2 = "ntp1.t-online.de"; // serveur NTP Apple US "time.apple.com",DE-Server "ntp1.t-online.de"
Für eine Fritz-Box: HTCP einschalten.
Reply
Show more
1 Comment(s)

HiTec 1 year ago
Im Schaltplan 220564-1 Cloc v2.0.kicad_sch aus 220564 Cloc KiCad6 v1.2 30112022-2.zipist ein C7 1uF an ESP32 EN und GND angeschlossen.
Beim Bausatz ist der nicht dabei. (Auch nicht auf den Zip-Beuteln vermerkt)
Wird der nicht benötigt?
Beim Bausatz ist der nicht dabei. (Auch nicht auf den Zip-Beuteln vermerkt)
Wird der nicht benötigt?
cloc2.png (6kb)
Reply

Senior Editor, Elektor 1 year ago
Hi,
this capacitor is used only in case an older-type of ESP-32 Module is being used, to solve random problems of power-up-reset on that module. The kit includes the latest generation of ESP-32, therefore that capacitor shouldn't be necessary.
Kind Regards
Roberto
this capacitor is used only in case an older-type of ESP-32 Module is being used, to solve random problems of power-up-reset on that module. The kit includes the latest generation of ESP-32, therefore that capacitor shouldn't be necessary.
Kind Regards
Roberto
Reply
Show more
1 Attachment(s)
2 Comment(s)

RonaldR 2 years ago
Hi, for some reason I get a compil error.
I use in the Arduino ID 1.8.19 the "ESP32 Pico kit".
At compiling it gives error "exit status 1".
In the verbose window I see the message "E:\02 Arduino\Arduino 1.8.19\libraries\Arduino-IRremote-master\src/private/IRTimer.hpp:1371:50: error: missing binary operator before token "("
#if ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(2, 0, 2)"
I have installed all the required libraries, so I do not know why this "exit status 1" occurs.
I also cannot find the library folder in the Elektor downloads as well as in the boardmanager the ESP32 Pico D4 board.
Any one a clou how to solve the compiling error and how to add the ESP32 Pico D4 to the Arduino IDE?
Thanks!
Ronald
I use in the Arduino ID 1.8.19 the "ESP32 Pico kit".
At compiling it gives error "exit status 1".
In the verbose window I see the message "E:\02 Arduino\Arduino 1.8.19\libraries\Arduino-IRremote-master\src/private/IRTimer.hpp:1371:50: error: missing binary operator before token "("
#if ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(2, 0, 2)"
I have installed all the required libraries, so I do not know why this "exit status 1" occurs.
I also cannot find the library folder in the Elektor downloads as well as in the boardmanager the ESP32 Pico D4 board.
Any one a clou how to solve the compiling error and how to add the ESP32 Pico D4 to the Arduino IDE?
Thanks!
Ronald
Reply

ybourdon 2 years ago
Hello Ronald,
I will try to help you.
I use Arduino IDE 1.8.19.
I have select ESP32 PICO-D4, please try to update esp32 by Espressif Systems to version 2.0.6.
I also include last firmware file as well as librairies file.
Tell me if it helps !
Regards.
Yves
PS : SimpleReceiver is a small program to help you to find your IR code.
I will try to help you.
I use Arduino IDE 1.8.19.
I have select ESP32 PICO-D4, please try to update esp32 by Espressif Systems to version 2.0.6.
I also include last firmware file as well as librairies file.
Tell me if it helps !
Regards.
Yves
PS : SimpleReceiver is a small program to help you to find your IR code.
Alarm_Clock 2.03.rar (720kb)
SimpleReceiver.rar (76kb)
Libraries.rar (1609kb)
SimpleReceiver.rar (76kb)
Libraries.rar (1609kb)
Reply

RonaldR 2 years ago
Ybourdon, you rock!!
I could only update the ESP32 to version 1.06.
I found out that I was using the wrong Github URL and changed it to https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json.
Now I could update to version 2.0.6, even to version 2.0.7. and select the ESP32 Pico D4 and it compiled!!
I also tried to compile it for 3 other ESP32 boards, ESP32 Dev Module, ESP32 Wrover Module and WEMOS D1 R32. They all compile!
Thanks for your help!!
Regards,
Ronald
I could only update the ESP32 to version 1.06.
I found out that I was using the wrong Github URL and changed it to https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json.
Now I could update to version 2.0.6, even to version 2.0.7. and select the ESP32 Pico D4 and it compiled!!
I also tried to compile it for 3 other ESP32 boards, ESP32 Dev Module, ESP32 Wrover Module and WEMOS D1 R32. They all compile!
Thanks for your help!!
Regards,
Ronald
Reply
Show more
1 Comment(s)

behbeh 2 years ago
Hello Friends,
very nice Project. Do you have a schematic as PDF File. I do not used Kicad....
Thanks
Bernd
very nice Project. Do you have a schematic as PDF File. I do not used Kicad....
Thanks
Bernd
Reply

ybourdon 2 years ago
You will have much more details in the next publication by Elektor !
Yves
Yves
Cloc schéma v1.2.pdf (94kb)
Reply

behbeh 2 years ago
Hello,
do you have some gerber Dat files from the Layout. This is easyer to build a board with a PCB Maker.?
Thanks Bernd
do you have some gerber Dat files from the Layout. This is easyer to build a board with a PCB Maker.?
Thanks Bernd
Reply

ybourdon 2 years ago
You can find this file under CAD !
220564 Cloc KiCad6 v1.2 30112022-2.zip (ZIP)
220564 Cloc KiCad6 v1.2 30112022-2.zip (ZIP)
Reply
Show more
3 Comment(s)

EN0169854ID 2 years ago
Hi,
I built this clock last December and set different alarms for every day to try things out. That worked fine, but today I noticed that the alarm display seems to be advancing one day. The alarm for Thursday (today) is set at 17:00 and for Friday (tomorrow) it is set at 11:00. When I write this, it is Thursday, Jan 5, 8:40. Therefore, the clock should show 17:00 as alarm time, but instead it shows 11:00. Now we just entered a new year, so maybe there is a problem in a calculation? A hard-coded 2022 somewhere? Note that "End of previous alarm" is unchecked. Also note that I power-cycled the clock yesterday (January 4).
Attached are screenshots of my settings.
Update 5/1, 11:00: the alarm did not go off, which is good news :-). Next check at 17:00.
Update 5/1, 17:00: the alarm sounded at 17:00 and flashed 17:00 (not 11:00), then went back to showing 11:00
Update 6/1, 8:00: the alarm is supposed to sound today at 11:00 but doesn't show the alarm time. I suppose this is because the alarm for tomorrow (Saturday) is disabled.
Update 6/1, 11:00: the alarm sounded as intended at 11:00, flashing 11:00, then went back to no display, probably because the alarm for tomorrow (Saturday) is disabled.
Conclusion: something is wrong with the way the upcoming alarm is displayed.
I built this clock last December and set different alarms for every day to try things out. That worked fine, but today I noticed that the alarm display seems to be advancing one day. The alarm for Thursday (today) is set at 17:00 and for Friday (tomorrow) it is set at 11:00. When I write this, it is Thursday, Jan 5, 8:40. Therefore, the clock should show 17:00 as alarm time, but instead it shows 11:00. Now we just entered a new year, so maybe there is a problem in a calculation? A hard-coded 2022 somewhere? Note that "End of previous alarm" is unchecked. Also note that I power-cycled the clock yesterday (January 4).
Attached are screenshots of my settings.
Update 5/1, 11:00: the alarm did not go off, which is good news :-). Next check at 17:00.
Update 5/1, 17:00: the alarm sounded at 17:00 and flashed 17:00 (not 11:00), then went back to showing 11:00
Update 6/1, 8:00: the alarm is supposed to sound today at 11:00 but doesn't show the alarm time. I suppose this is because the alarm for tomorrow (Saturday) is disabled.
Update 6/1, 11:00: the alarm sounded as intended at 11:00, flashing 11:00, then went back to no display, probably because the alarm for tomorrow (Saturday) is disabled.
Conclusion: something is wrong with the way the upcoming alarm is displayed.
screenshot-2023-01-05-at-08-39-28-esp32-clock-parametrage.png (65kb)
screenshot-2023-01-05-at-08-40-12-esp32-web-controlled-clock.png (45kb)
screenshot-2023-01-05-at-08-40-23-esp32-web-clock.png (39kb)
screenshot-2023-01-05-at-08-40-12-esp32-web-controlled-clock.png (45kb)
screenshot-2023-01-05-at-08-40-23-esp32-web-clock.png (39kb)
Reply

ybourdon 2 years ago
Hello,
First of all thank you for your interest in my project!
I've been using this alarm clock for many months and haven't noticed any "big" glitches in daily use.
I think your problem is related to the Alarm J+1 parameter. You indicated 00:00 which may be ambiguous. Try to put another value.
I just did some tests and the principle is as follows: You can always change the alarm time of the current day and it will be taken into account.
On the other hand, if the Alarm D+1 time is outdated, the following day's alarm will be displayed, otherwise the current day's alarm time will be displayed.
I strongly advise you to reset the parameters to Default, either via the Web interface, or by turning on the alarm clock while pressing the Alarm Disable button.
And if you still have problems come back to me.
Besides, I advise you to wait for the publication by Elektor of this project in the next edition, because there are many explanations on the operation of this alarm clock, which is very simple, but which also has many tricks!
I will also correct the Alarm J+1 label to put Alarm D+1 (in French Day translates to Jour !).
Regards,
Yves
First of all thank you for your interest in my project!
I've been using this alarm clock for many months and haven't noticed any "big" glitches in daily use.
I think your problem is related to the Alarm J+1 parameter. You indicated 00:00 which may be ambiguous. Try to put another value.
I just did some tests and the principle is as follows: You can always change the alarm time of the current day and it will be taken into account.
On the other hand, if the Alarm D+1 time is outdated, the following day's alarm will be displayed, otherwise the current day's alarm time will be displayed.
I strongly advise you to reset the parameters to Default, either via the Web interface, or by turning on the alarm clock while pressing the Alarm Disable button.
And if you still have problems come back to me.
Besides, I advise you to wait for the publication by Elektor of this project in the next edition, because there are many explanations on the operation of this alarm clock, which is very simple, but which also has many tricks!
I will also correct the Alarm J+1 label to put Alarm D+1 (in French Day translates to Jour !).
Regards,
Yves
tds-1.jpg (577kb)
cloc-2.jpg (495kb)
cloc-1.jpg (642kb)
tds-2.jpg (650kb)
cloc-2.jpg (495kb)
cloc-1.jpg (642kb)
tds-2.jpg (650kb)
Reply

rieselkalk 2 years ago
Nach 30 Jahren WLan neben den Kopf, dann dürfte das Gehirn so langsam weich sein. Was ich damit sagen möchte, nicht alles was technisch möglich ist, ist auch sinnvoll. An ansonsten ein gutes Projekt.
After 30 years of WLan next to the head, then the brain may be so slowly soft. What I would like to say is that not everything that is technically possible makes sense. Otherwise a good project.
After 30 years of WLan next to the head, then the brain may be so slowly soft. What I would like to say is that not everything that is technically possible makes sense. Otherwise a good project.
Reply
Show more
3 Attachment(s)
3 Comment(s)

M J Bauer 2 years ago
The best feature is automatic time setting. In Australia where I live, most states have "daylight saving time" in summer, meaning that most clocks need to be adjusted twice every year. The politicians who introduced daylight saving should be hung, drawn and quartered. The 7-segment LED display is adequate, but lacks aesthetic appeal, in my view. A colour graphic LCD panel, with dimmable LED back-light, would be more impressive and would complement better the other high-tech features. Most consumer alarm-clocks fail to provide a satisfactory mechanism to invoke "snooze" mode and to cancel the alarm. The "snooze" button is often small and near other buttons on the top, so it is hard to find in the dark when you're not fully awake. Have you given some thought to this issue? How about a socket to plug in a remote snooze button? Or voice-activated snooze, so you can just tell it to "shut the f--k up". Also, a logic output to activate a bedside lamp (or whatever) when the alarm activates could be a worthwhile addition, I think.
Reply
Show more
0 Comment(s)
Updates from the author
ybourdon 10 months ago
ESP Tool: Some of you are having difficulty compiling the software correctly.
So I wrote a short text which allows you to use the ESP Tool online (nothing to download or install).
I am also attaching the .bin files that need to be programmed onto the ESP32.
Firmware 2.50 is released! Following a suggestion from Jack (thank you!), I added a new parameter to the settings page. You can now adjust the buzzer frequency from 1500 to 3000Hz (don't forget to save the new value before testing !). A test button allows you to immediately hear the result for 2.5 seconds. A number of you have complained about the weak buzzer sound. By optimizing this frequency until reaching the resonance point, the result is impressive. Don't change anything in your hardware, but try this solution!
new-settings-page-20240126133303.png (63kb)
Bin files.zip (675kb)
esp-tool-20240126142755.png (98kb)
How to program your ESP32 with ESP Tool.pdf (198kb)
Alarm_Clock 3.0.zip (15609kb)
JohanB 9 months ago
Many thanks for this project and the latest upgrade to version 3.
However, I get confused about what 'Bin files.zip' to use as there seem to be multiple versions out there:
- under Firmware 2.50,
- in the Software-tab of this project,
- and as part of the zipped project.
Could you please enlighten me?