Skip to content

Arduino Overview

Mikkel102454 edited this page Oct 6, 2026 · 5 revisions

Arduino overview

The device has a configuration access point and a normal refresh/deep-sleep cycle. It does not continuously poll a refresh timer in the main loop.

Configuration

On first boot without saved WiFi credentials, or on GPIO0 button wake from deep sleep, the device enters configuration mode.

  1. Join the access point named by CONFIG_AP_SSID using the configured AP password.
  2. Open http://192.48.56.2/ while connected to that access point.
  3. Enter the target WiFi SSID/password, HTTP or HTTPS JSON endpoint, and cron schedule.
  4. Save. The access point stops and the device attempts the normal refresh cycle.

SSID must contain 1–32 characters; the form requires a password of 8–63 characters. Leaving the password blank keeps the saved password. Open networks are not supported by this form. The endpoint must include http:// or https://.

Settings are stored with ESP32 Preferences under namespace json-paper. The stored fields include SSID, password, endpoint, and cron. On startup, older raw-form EEPROM credentials can be migrated when no current settings record is loaded.

The default endpoint serves the repository's Server/hello-world.json. The default schedule is 0 * * * *.

Refresh cycle

flowchart TD
    A[Boot or wake] --> B[Load settings]
    B --> C{Button wake or no WiFi credentials?}
    C -->|Yes| D[Configuration access point]
    D --> E[Save settings]
    E --> F[Connect to WiFi]
    C -->|No| F
    F --> G{Connected and clock valid?}
    G -->|Yes| H[Fetch and parse protocol 2.0 JSON]
    H --> I[Render and refresh if commands exist]
    I --> J[Calculate next cron occurrence]
    J --> K[Deep sleep]
    G -->|No| L[Choose next schedule or retry delay]
    L --> K
    K --> A
Loading

The device starts NTP synchronization and can use an already valid retained clock. Without a trustworthy clock it sleeps for 15 minutes before retrying. A failed WiFi connection sleeps until the next cron occurrence when the clock is valid, otherwise for the same 15-minute retry delay.

Commands are fetched and parsed before the framebuffer is allocated. If no commands are returned, the existing display is kept. After rendering, the panel is put to sleep and powered down. Deep sleep disables WiFi and enables timer and GPIO0 wake sources.

Schedule syntax

Schedules use Copenhagen local time with CET/CEST daylight-saving rules. The timezone is compiled into firmware, not a form setting.

Field Allowed values
Minute 0–59 or *
Hour 0–23 or *
Day of month 1–31 or *
Month 1–12 or *
Weekday 0–6 or *; Sunday is 0

Only a single integer or * is accepted in each of the five fields. Lists, ranges, names, and steps such as */15 are not supported. If both day of month and weekday are specified, either may match.

Schedule Meaning
0 * * * * Every hour on the hour
30 8 * * * Daily at 08:30 local time
0 9 * * 1 Mondays at 09:00 local time

The next scheduled time is calculated after the refresh completes. Normal boot and completion of provisioning run a refresh cycle before sleeping to the next scheduled time.

See Hardware and Setup, Protocol Structure, and Troubleshooting.

Implementation references

Clone this wiki locally