M5StickPomodoro

Firmware v1.1.2-2-g5b05f27 · GitHub · Releases · Supported models & porting

A standalone, battery-friendly, gesture/position controlled Pomodoro timer for the M5Stick series, including M5StickC, M5StickC Plus V1.1, M5StickC Plus2 and M5StickS3. You control it mostly by how the device is placed: face down pauses, standing it on its end shows a big countdown bar, a tap on the table shows the time.

M5StickC Plus lying on its long edge, running a WORK session at 24:59

Install from the browser

This browser cannot talk to USB devices. To install, open this page in Chrome or Edge on a computer and connect the M5Stick to that computer. You can still read the guide below. Serial access needs a secure page (https).
  1. Connect the M5Stick over USB and switch it on (the port only exists while it is on).
  2. Press Connect and pick the port with usbserial in its name (StickS3: usbmodem or "USB JTAG/serial").
  3. Press Install and wait. The right build for your chip is picked by itself, and the device restarts when the install is done.

At its first start the timer checks the hardware. When you close the installer, this page reads that self-check and shows the result here: the model it found, or "Unsupported device" with the reason. The device shows the same: "Unsupported device" on its screen, or five short beeps, means this model is not supported (see "Is my M5Stick supported?" below).

Updating keeps your saved settings. One firmware fits every supported model; the board is detected at boot.

This page counts visits, connections and successful installs anonymously with GoatCounter (no cookies, no personal data).

macOS: if the port is busy or nothing connects, run killall scrod in Terminal (the VoiceOver braille service grabs new USB serial ports) and close any other program that has the port open.

TL;DR

Two modes

Buttons (they work the same in WORK and BREAK; B changes the length of the mode you are in)

Button Press Hold
M5 (front, under the screen) Screen dark: show the time (like a pose change). Screen on: restart the current mode (on release); press again within 5 s → switch WORK ⇄ BREAK. While 00:00 blinks: start the other mode. 1.5 s: sound on / off. 3 s: tap-to-wake in horizontal poses on / off. The screen shows what releasing will do.
B (right side) 1st press only shows the length for a second, then the countdown (the session keeps running). Each next press +1 min (1–60), and 1 s after the last press a new session starts with it. Adds minutes quickly.
Power (left side) Off: switch on. On, screen lit: sound on / off. 1.5 s: tap-to-wake in horizontal poses on / off. 6 s: switch off.

On the StickS3 the power button belongs to the power chip and the firmware cannot see it: a press switches on or restarts, a double press switches off, holding it enters flashing mode. Use the M5 button holds for sound and tap there.

Poses

When a session ends (beeps, then 00:00 FINISHED blinks for 2 min)

Supported models (the board is detected at boot; one firmware for the ESP32 models, a separate build for the ESP32-S3)

Model Status Notes
M5StickC (original) ✅ tested No buzzer: the red LED blinks instead of beeping, and the power button's short press switches the LED (LED ON / LED OFF). Smaller 80×160 screen: compact status line; in portrait it shows only the mode and battery (option flags such as NO LED / TAP appear in landscape). Only units with the MPU6886 IMU (early SH200Q units are not supported).
M5StickC Plus v1.1 ✅ tested Main target; all features as described here.
M5StickC Plus2 ⚠️ untested Prepared from the docs, not yet run on a device. No AXP192: power held by GPIO4, PWM backlight, buzzer without the 5 V boost, power button (C) on GPIO35. Its IMU interrupt is not documented, so orientation is polled once a second (no deep sleep while paused, no tap-to-wake).
M5StickS3 ✅ tested ESP32-S3, its own build. Speaker instead of the buzzer; the BMI270 reaches the ESP32 through the power chip (taps and wake-on-motion as on the Plus); no RTC, so time comes from the less accurate ESP32 clock. The power button belongs to the power chip (double press: off). While on USB it does not sleep, so it can always be flashed.
M5StickC Plus SE ❌ not supported No motion sensor (IMU). The firmware recognises it and shows "Unsupported device" (E1) instead of running.

Flashing — quickest way (no tools to install)

  1. Connect the device over USB and switch it on.
  2. Open the web installer in Chrome or Edge (not Safari).
  3. Press Connect, pick the port with usbserial in its name (on the StickS3: usbmodem or "USB JTAG/serial"), press Install. The installer picks the right build for the chip by itself. The device restarts; saved settings are kept.
  4. Close the installer: the page reads the device's self-check and shows the result under the install button — the model it found, or "Unsupported device" with the reason. The device shows the same: "Unsupported device" on its screen, or five short beeps, means this model is not supported — see Is my M5Stick supported?.

On macOS, if the port is busy, run killall scrod first (see below).

Flashing from source: install PlatformIO, run scripts/flash.sh, choose the device, confirm.

Details: Build and flash.


Contents


Features at a glance


Cheat sheet

You do It does
Switch on: press the power button (left side) The device starts and begins a new WORK session.
Switch off: hold the power button for about 6 seconds The screen goes dark and the device powers off completely.
Put it face down Pauses. The screen goes dark and the device sleeps deeply.
Turn it face up (any visible pose) Resumes from exactly where it paused.
M5 button (big, under the screen), screen dark Shows the time for 5 s, like a change of pose.
M5 button, screen on Restarts the current mode (when released).
M5 button while 00:00 blinks Starts the other mode (WORK → BREAK or BREAK → WORK).
M5 again within 5 s (during the yellow / violet grace period) Switches to the other mode and starts it.
B button (right side), single press Shows the current mode's length (SET WORK / SET BREAK) for a second, then the countdown for the usual 5 s: the session keeps running. During the finish blinking, the blinking goes on and its 2 minutes are not reset.
B further presses / hold +1 minute per press (wraps 60 → 1); holding repeats quickly. 1 s after the last press the new length is saved and a new session starts.
Power button (left side), short press, screen on Sound on / off (SOUND ON / SOUND OFF).
Power button, hold ~1.5 s, screen on Tap-to-wake in horizontal poses on / off (TAP ON / TAP OFF).
M5 button, hold 1.5 s / 3 s The same as the power button's short press / hold: sound / tap-to-wake on / off. While you hold, the banner shows the change; it applies on release.
Tap the table (tap poses) Shows the full MM:SS for 5 s.
Session ends, then move it to another pose for 1 s Starts the other mode (WORK → BREAK or BREAK → WORK).
Session ends, then face down and back up Starts the same mode again.
Nothing done for 2 minutes after the end Deep sleep. Wake it with M5, or face down for about a second and back to any visible pose (same mode).

How it works

Switching on and off

Two modes: WORK and BREAK

WORK BREAK
Default length 25 min 5 min
Bar colour while running green → orange → red blue → light blue
Grace-period colour yellow violet
Start signal one longer beep one short beep
End signal three short beeps two long beeps
Status label WORK BREAK

Power-on always starts WORK. Switch modes with a second press of the M5 button during the grace period, or by changing the pose when a session ends.

Starting a session and the grace period

Every session — after power-on, after the M5 button, after changing the length with B, or after a mode switch — starts with a 5-second grace period:

While a session runs

The timer keeps running in every pose where the screen faces you. To save battery and stay out of your way, the screen stays dark most of the time. It turns on:

Pausing and resuming

When a session ends

  1. The end signal sounds: three short beeps for WORK, two long beeps for BREAK.

  2. 00:00 FINISHED blinks (500 ms on / 500 ms off) for 2 minutes.

  3. During the blinking you can:

    • move the device to another pose and hold it there for 1 second (e.g. from one long edge to the other, or from standing on an end to lying on its side) → the other mode starts;
    • press M5 → the same mode restarts (press again within 5 s to switch);
    • press B once → see the length (the blinking goes on); press it more → set a new length and start;
    • turn it face down → the screen turns off at once.
  4. If nobody does anything during the 2 minutes (or it is turned face down), the device goes into deep sleep: the screen is off and the timer does not run. Only two things wake it:

    • the M5 button → the same mode starts again;
    • turning it face down for about a second and then back to any visible pose (flat, an edge or an end) → the same mode starts again.

    In deep sleep a plain change of pose (without going face down first) and the B button do not wake it: the pose switch to the other mode works only during the 2 minutes of blinking.

Poses and screen layouts

The six poses: flat, long edge A, long edge B, on its end with USB up, on its end with USB down, and face down

Pose Layout Tap to wake
Flat, screen up landscape when TAP is on
On long edge A landscape when TAP is on
On long edge B landscape, rotated 180° when TAP is on
On its end, USB up portrait always
On its end, USB down portrait, rotated 180° always
Face down — (paused) —

A new pose must be stable for a few samples (~0.5 s) before the layout changes. A layout change shows the screen for 5 seconds.

The screen

Screen examples: WORK and BREAK grace periods, WORK and BREAK running, the minute glance in landscape and portrait, and the finished state

Tap to wake

When the screen is dark, a light tap on the table (or any small vibration) shows the full MM:SS for 5 seconds.

The power button's long press is reported by the power chip at 1.5 s, while you are still holding the button. The TAP setting therefore changes at once but is saved only 6 seconds later. If you keep holding the button to switch the device off, it powers down before the change is saved, so switching off never changes the setting.

Sound

Battery indicator

What is remembered

Setting Survives power-off Changed with
WORK length yes B button in WORK
BREAK length yes B button in BREAK
Sound on / off yes short press of power button, or M5 held 1.5 s
Tap-to-wake in horizontal poses yes long press of power button, or M5 held 3 s
Current session, mode, pause state across sleep only —

Power-on always starts a fresh WORK session. Settings are written to flash only when they change, never to track the countdown.


Build and flash

Web installer

The web installer (GitHub Pages, ESP Web Tools) flashes the current release from Chrome or Edge with one button. It picks the ESP32 or ESP32-S3 build from the connected chip, writes the bootloader, partition table and firmware at their own offsets and leaves the settings partition alone, so saved settings survive. It resets the device when done and releases the port; the Close button on the "Installation complete!" screen closes the installer (press Connect again for another device). Then the page restarts the device over the same port, reads its first-boot self-check line and shows the result under the install button: "Identified: " (with a note for untested models) or "Unsupported device" with the code and reason. The page header has a live copy of the timer: it counts down, turns face down to pause, rotates to switch layouts, and its M5 button restarts (double click: the other mode). Below the install button the page shows this README (and PORTING.md as a second page), rendered from the repository at build time. It is published from the production branch by .github/workflows/pages.yml, on every push to that branch and on every version tag, so the version in the page header always follows the newest tag. The page counts visits, connections (a port picked), finished or failed installs, and how often its "No port selected" help (and which OS tab) is opened, anonymously with GoatCounter (no cookies).

Without building: release image

Every release has two files. Each contains the bootloader, partition table and firmware; flash it at offset 0x0:

Ways to flash it:

Writing the full image also resets the saved settings (session lengths, sound, tap) to their defaults. If the port is busy or missing on macOS, see the scrod note below.

From source

You need PlatformIO, either the CLI or the VS Code extension. PlatformIO downloads everything else: the espressif32@6.4.0 platform and the M5Unified@0.2.25 library (with M5GFX).

  1. Connect the M5Stick over USB and switch it on. The USB serial port only exists while the device is powered.

  2. Flash with the helper script:

    scripts/flash.sh
    

    It lists the connected devices and lets you choose one; the others are not touched. Then it checks the chosen device and shows its chip, flash size, MAC, model and current firmware. It restarts the device once to read its boot log. It flashes only after you confirm.

    • --port /dev/cu.usbserial-XXXX picks the device directly.
    • --expect "M5StickC" refuses to flash unless the device is identified as that model.
    • --yes skips the questions; --list only lists the devices; --env test flashes the test build.
    • On macOS, the VoiceOver braille service (scrod) grabs new USB serial ports and blocks flashing. The script stops it when it holds the chosen port.

    Plain PlatformIO works too: pio run -t upload --upload-port /dev/cu.usbserial-XXXX.

  3. Optionally, watch the log:

    pio device monitor
    

    On boot you should see profile=M5StickC Plus (or M5StickC), IMU INT self-test: asserted=1 released=1 and WORK: new 25 min session.

A test build with a 2-minute default WORK session:

scripts/flash.sh --env test

Lengths already set with the B button are stored in flash and override the defaults. The defaults come from -DSESSION_MIN=25 and -DBREAK_MIN=5.


Is my M5Stick supported?

At its first start after flashing, the firmware checks what the board really has: the display and its size, the power chip, the motion sensor (IMU) and whether its reading is plausible, the clock chip (RTC) and whether it runs, and the audio codec on the StickS3. The result must match one of the supported models in src/boards.h. If it does not, the timer does not run and the device says why:

Code Meaning Typical cause
E1 No motion sensor (IMU) M5StickC Plus SE; an early M5StickC with the SH200Q sensor
E2 The motion sensor gives an implausible reading a damaged sensor
E3 The power chip does not match the model another board that looks the same to the display check
E4 No display, or one of another size a board without a screen, or another model
E5 The clock chip (RTC) is missing or not running a damaged or missing RTC
E6 The audio codec is missing (StickS3) another ESP32-S3 board
E9 Unknown board any ESP32 or ESP32-S3 board that is not an M5Stick this firmware knows

The web installer and scripts/flash.sh can only see the chip type before flashing, so they install on any ESP32 or ESP32-S3 device. The check happens afterwards, on the device.

Safety. The firmware cannot "brick" the device. The ESP32's flashing mode lives in the chip's ROM, and the firmware never writes eFuses or turns on flash encryption or secure boot. On a device it does not recognise, it drives no pins and writes to no chips, and it never powers off or deep-sleeps while it may be on USB, so the port stays available for flashing something else. On battery, an AXP192 board powers off after 2 minutes on the refusal screen; the M5 button shows the message again before that.

Getting back to flashing mode:

Power design and battery life

Estimated battery life (calculated, not measured; 120 mAh battery):

State Estimated current Estimated runtime
Session running ≈ 3.5–4 mA ≈ 30 h of continuous counting
Paused / finished (deep sleep) ≈ 0.1–0.5 mA weeks

Extra screen time from taps and pose changes and frequent beeps reduce these numbers.


Hardware notes

Found while building this on the device:

Known limitations

Project layout

platformio.ini   environments: m5stick-c-plus (default: StickC, StickC Plus, StickC Plus2), m5stick-s3 (StickS3)
                 and test (2-minute WORK session)
src/main.cpp     the firmware
src/boards.h     board profiles: one row per supported model
scripts/flash.sh choose a connected device, check it and flash it (scripts/flash.py does the work)
scripts/build_release.sh  build the single-file release image into dist/
.github/workflows/release.yml  CI build; publishes a release with the image for every v* tag
scripts/build_web.sh      build the web installer site into dist/web
scripts/render_docs.py    render README.md and PORTING.md into the site, so it always matches the repository
scripts/draw_diagrams.py  draw the SVG diagrams in docs/ (and the picture in the web installer header)
web/index.html            the web installer page
.github/workflows/pages.yml    publishes the web installer to GitHub Pages from the production branch (on pushes and tags)
PORTING.md       supported models, adding a board profile, notes on other M5Stick models
docs/            the diagrams used in this README and on the web installer page (SVG)

No port selected

If the M5Stick was not in the list, check these first:

  • macOS's VoiceOver braille service (scrod) grabs new USB serial ports, so the browser cannot open the port. Run this in Terminal, then press Try again:
    killall scrod
  • If macOS asks "Allow accessory to connect?", choose Allow.
  • No driver is needed: the port is listed as cu.usbserial-….