You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The firmware connects to a Wi-Fi network at startup. The default SSID is Wokwi-GUEST (password-free), which is the virtual Wi-Fi network provided by the Wokwi simulator.
To use a different network, update the WiFi.begin() call in setup():
The firmware synchronises the real-time clock via NTP:
#defineNTP_SERVER"pool.ntp.org"int UTC_OFFSET = 19800; // seconds east of UTC (e.g. 19800 = UTC+5:30)
#defineUTC_OFFSET_DST0
The UTC offset can also be adjusted at runtime via the Set Time menu option, which increments/decrements UTC_OFFSET by 3600 s (hours) or 60 s (minutes) as the user scrolls.
Alarm Configuration
Up to 3 alarms are supported (controlled from the Node-RED dashboard via MQTT in the updated firmware).
Default alarm times are hard-coded as:
int alarm_hours[] = {0, 1};
int alarm_minutes[] = {1, 10};
Each alarm triggers once per day; alarm_triggered[] is reset to false at the next day boundary.
Application Architecture
setup()
Configures all GPIO pins.
Initialises the OLED display, DHT22 sensor, and (updated firmware) servo.
Connects to Wi-Fi.
Synchronises time with NTP.
(Updated firmware only) Connects to the MQTT broker and subscribes to control topics.
loop()
Calls update_time_with_check_alarm() – refreshes the display and fires any due alarms.
Checks whether the OK button has been pressed to enter the menu.