40 Commits
Author SHA1 Message Date
wenilandClaude Opus 4.8 1f739d0267 docs: document the Waveshare AMOLED-2.06 board port
Add docs/boards/waveshare-amoled-2.06.md (pins, CO5300 col offset 22,
Windows UTF-8 flashing gotcha, daemon name + address fixes) and list the
board in README.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 12:51:14 +03:00
Hermann Björgvin aa9533a878 Merge pull request #57 from kvenanzi/windows-daemon 2026-06-03 11:31:20 +00:00
kvenanzi eb70456755 Add native Windows host daemon (bleak/WinRT)
Adds a Windows port of the host daemon so the Clawdmeter stays connected
on Windows independent of WSL. Mirrors the macOS daemon and speaks the
existing GATT data service unchanged — no firmware changes.

- claude_usage_daemon_windows.py: Windows-local OAuth token read +
  Anthropic poll + BLE scan/connect/write, with auto-reconnect
  (connect-retry wrapper, zombie-link break, split fast/slow backoff)
- tray_windows.py: pystray login-startup tray app (status icon + Quit)
- autostart_windows.py: winreg HKCU\Run autostart via pythonw.exe
- icon_assets.py: per-state tray icons composited from logo.h
- install-windows.ps1 + daemon/README-windows.md: turnkey setup
- pytest suite: token / poll / reconnect / tray / autostart / no-WSL guard
2026-06-02 16:39:07 -05:00
Hermann Björgvin HaraldssonandClaude Opus 4.7 13cc4231a0 Rename BLE device "Claude Controller" → "Clawdmeter"
Brand consistency: the device now advertises as "Clawdmeter". Updated the
three functional spots that must agree for discovery-by-name to work —
ble.cpp DEVICE_NAME (advertised) and both daemons' DEVICE_NAME (scan match) —
plus the README/CLAUDE.md/install-script references (and fixed the stray
"Claudemeter" typo in the README).

Note: hosts cache the GATT name, so an already-paired device keeps showing the
old name until removed/re-paired (bluetoothctl remove <mac>).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-02 14:01:57 +00:00
Hermann Björgvin HaraldssonandClaude Opus 4.7 bd5d45cef3 splash: brand terracotta tint; README + remove BT screenshots
- convert_to_c.js: remap the claudepix body color (#CD7F6A) to Anthropic brand
  terracotta (#D97757) so the splash creature matches the brand; regenerate
  splash_animations.h.
- README: document the 3-second hold-to-pair gesture, drop the now-removed
  Bluetooth screen from the screenshots table + prose, and delete the
  Bluetooth screenshots (216 + 1.8").

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-02 14:01:57 +00:00
Hermann Björgvin 6b5314ef28 Fix formatting and improve hardware section clarity 2026-05-24 20:35:06 +00:00
Hermann Björgvin c2715e7cc4 Update README with alternative board support details
Clarified compatibility with alternative boards and added guidance for pull requests.
2026-05-24 20:34:08 +00:00
Hermann Björgvin a07cab1359 Added ESP32-C6 2.16inch AMOLED to README.md 2026-05-24 20:32:13 +00:00
Hermann Björgvin 12184549ff Revert "switch daemon to /api/oauth/usage endpoint" 2026-05-24 20:04:07 +00:00
Brian Pugh 525ebe8921 switch daemon to /api/oauth/usage endpoint 2026-05-24 15:26:43 -04:00
Hermann Björgvin b75dda8a85 Merge pull request #28 from BrianPugh/macos-keychain
macos uses keychain; remove stale comments
2026-05-24 18:50:19 +00:00
Brian Pugh b7b8e3f5ca must specify board target (e.g. waveshare_amoled_216), fixes 'flash all environments' bug. 2026-05-21 21:08:59 -04:00
Brian Pugh acd4819737 macos uses keychain; remove stale comments 2026-05-21 21:08:13 -04:00
Hermann Björgvin 09b5ba8c72 Updated affiliate link 2026-05-21 09:47:01 +00:00
tobby168andClaude Opus 4.7 20351212b2 Device-abstraction refactor: HAL + per-board folders + responsive UI
Replaces the build-flag-driven #ifdef sprawl (~30 blocks across 6 files)
with a small HAL in firmware/src/hal/ and per-board folders under
firmware/src/boards/. Shared code (main.cpp, ui.cpp, splash.cpp) no
longer contains a single `#ifdef BOARD_*` — optional features are
guarded by BoardCaps (runtime) and BOARD_HAS_* macros (compile-time,
inside the board's own files).

Why: lets community contributors port to new ESP32 + AMOLED + touch
combos by dropping in a boards/<name>/ folder + a PlatformIO env,
without touching shared files. See docs/porting/adding-a-board.md.

Highlights:

- New HAL: display_hal, touch_hal, input_hal, power_hal, imu_hal,
  board_caps. Each board provides display.cpp, touch.cpp, input.cpp,
  power.cpp, imu.cpp, caps.cpp, board_init.cpp + private hardware
  drivers (e.g. io_expander.{h,cpp} on AMOLED-1.8).
- PlatformIO build_src_filter selects each board's folder per env.
- ui.cpp picks fonts and layout from board_caps() via compute_layout()
  with screen-height breakpoints (>= 460 → large, else compact).
- splash.cpp computes CELL = min(W,H)/20 — responsive instead of two
  hardcoded values.
- idle.cpp (from #24) rewired through display_hal + power_hal — no
  longer depends on the deleted display_cfg.h / power.h.
- power_hal gains power_hal_is_vbus_in() for idle's
  IDLE_SLEEP_WHEN_CHARGING gate.
- boards/template/ + docs/porting/{adding-a-board,hal-contract,
  capability-flags}.md to bootstrap new ports.
- display_cfg.h, power.{h,cpp}, imu.{h,cpp}, io_expander.{h,cpp}
  deleted from src/ root (moved into boards/<name>/ or hal/).

Verification: both `pio run -e waveshare_amoled_216` and
`pio run -e waveshare_amoled_18` succeed unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 18:27:24 -07:00
Hermann Björgvin e3709b66e7 Update README.md 2026-05-14 19:01:56 +00:00
Hermann Björgvin 78c3a43c53 Update README.md 2026-05-14 19:01:23 +00:00
512039e740 Add macOS host support
Cherry-picks the macOS-specific pieces from PR #5: Python daemon using
bleak (CoreBluetooth backend), LaunchAgent template, flash-mac.sh, and
install-mac.sh. Token is read from the macOS Keychain ("Claude
Code-credentials" service); Linux behavior is unchanged. README split
into "macOS installation" and "Linux installation" sections with
parallel Flash / Pair / Install subsections.

Co-Authored-By: Chris Davidson <36679917+lorddavidson@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 18:39:13 +00:00
Hermann Björgvin 8ceb9f6e4f Update README.md
Added affiliate link
2026-05-14 12:23:27 +00:00
Hermann Björgvin 40d7af93d8 Update README to reflect changes in demo and animations
Removed demo section and added attribution for Clawd animations.
2026-05-12 01:53:20 +00:00
Hermann Björgvin 4c9363440a Update README.md 2026-05-12 01:51:53 +00:00
Hermann Björgvin HaraldssonandClaude Opus 4.7 bd2afb544f Swap demo video link for inline GIF in README
GitHub's clickable-thumbnail trick worked but was awkward; a 500x500
12fps GIF renders inline everywhere. Drop the now-unused thumbnail.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 17:05:36 +00:00
Hermann Björgvin HaraldssonandClaude Opus 4.7 7281fb3c2f Use clickable thumbnail for demo video in README
GitHub strips relative src on <video> tags, so swap to an image link
pointing at the raw mp4. Extracted a frame for the thumbnail so the
two demo cells aren't visually identical.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 17:02:12 +00:00
Hermann Björgvin HaraldssonandClaude Opus 4.7 11dfa3e4b9 Add Demo section to README with photo and video
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 16:57:49 +00:00
Hermann Björgvin Haraldsson 7736ef1bab Capitalize Clawdmeter and extend tagline 2026-05-11 03:29:34 +00:00
Hermann Björgvin Haraldsson 48783bfb4b Drop open/public from library references in README 2026-05-11 03:10:50 +00:00
Hermann Björgvin Haraldsson 4e56ba4749 Rename to clawdmeter, link claudepix from splash section 2026-05-11 03:09:41 +00:00
Hermann Björgvin Haraldsson 2f40906816 Humanize README prose across remaining sections 2026-05-11 02:56:09 +00:00
Hermann Björgvin Haraldsson 1635729486 Humanize README intro paragraph 2026-05-11 02:51:29 +00:00
Hermann Björgvin Haraldsson 1a8c4038aa Rename creatures to Clawd in README and drop middle name 2026-05-11 02:44:36 +00:00
Hermann Björgvin Haraldsson b48a11c62f Correct Clawd attribution: singular animation, x.com link, mascot wording 2026-05-11 02:43:01 +00:00
Hermann Björgvin Haraldsson 62b226b793 Move Screens section above Features in README 2026-05-11 02:36:41 +00:00
Hermann Björgvin Haraldsson f92e1bba3e Remove stale demo.gif from previous Panlee panel 2026-05-11 02:35:43 +00:00
Hermann Björgvin Haraldsson 4b32236f67 Refresh README screenshots and prune controller-era references
Replace the 480x320 Panlee-era usage/bluetooth/controller PNGs with
fresh 480x480 captures of the current UI (Usage, Bluetooth, Splash).
Drop the Controller screen column entirely — that screen was removed
when buttons took over its shortcuts.

README cleanup: daemon poll cadence corrected to 60s, splash mood-
group + auto-rotation behaviour documented, "tap the logo to cycle"
replaced with the actual middle-button gesture, Lucide section
rewritten to point at tools/png_to_lvgl.js instead of the dead inline
Python+inkscape recipe, and intro line drops "touch controller" since
touch only toggles splash now. demo.gif flagged as stale (recapture is
a hardware task).
2026-05-11 02:33:29 +00:00
Hermann Björgvin Haraldsson 7fc8ed721a Remove Controller screen, global button shortcuts, touch-toggled splash
UX overhaul:
- Drop the Controller screen entirely (touch zones, swipe gestures, HID
  gesture engine, four icon arrays, hand icon)
- Two persistent screens (Usage, Bluetooth) cycled by the middle PWR
  button; splash becomes a touch-toggled welcome animation
- Left button (GPIO 0): hold to send Space (Claude Code voice-mode PTT)
- Right button (GPIO 18): press to send Shift+Tab (mode toggle)
- Middle button on splash cycles animations instead of screens
- Remove USB plug/unplug auto-switch (Controller was the unplug target)
- Hide battery indicator on splash when in LOW state — it's noisy over
  the pixel-art animations

Implementation:
- Delete firmware/src/hid.{cpp,h} and touch.{cpp,h}; their roles fold
  into main.cpp button handlers and LVGL CLICKED events respectively
- splash_get_root() exposes the splash container so ui.cpp can attach
  a click handler for the dismiss-on-tap behavior
- Tap detection uses LVGL's built-in LV_EVENT_CLICKED with event
  bubbling on the inner panels — debouncing is handled by LVGL
- On Bluetooth screen, only the Reset Bluetooth zone is clickable;
  taps elsewhere are no-ops (no conflict with splash toggle)

Docs:
- README: drop Controller from screens table, rewrite Physical buttons
  table, remove Gesture controls section
- CLAUDE.md: update file map, button assignments, drop gesture refs
2026-05-11 00:51:07 +00:00
Hermann Björgvin Haraldsson 90eaeec35b Add credits section to README 2026-05-11 00:17:54 +00:00
Hermann Björgvin HaraldssonandClaude Opus 4.7 97a5443601 Migrate to Waveshare ESP32-S3-Touch-AMOLED-2.16 with auto-rotation, splash, and battery
Full hardware swap from Panlee SC01 Plus (480×320 IPS) to Waveshare 2.16"
square AMOLED (480×480, CO5300 + CST9220 + AXP2101 + QMI8658). Library
stack moves to Arduino_GFX, SensorLib, XPowersLib on the pioarduino
platform 55.03.38-1 (Arduino Core 3.x).

UI:
- 4 screens (splash, usage, controller, bluetooth) with 3-button physical
  navigation: GPIO 0 = prev, AXP PKEY = cycle, GPIO 18 = next.
- IMU-driven 90° auto-rotation. CO5300 can't rotate via MADCTL, so flush
  callback does CPU strip-rotation in PARTIAL render mode. Rotation
  transitions use AMOLED brightness flash (instant black → redraw → ramp).
- Battery indicator (Lucide icons) in upper-right, RGB565A8 alpha so it
  blends over the splash animations.
- USB plugged/unplugged auto-switches between Usage and Controller
  screens (suppressed while on splash).
- Fonts and icons re-scaled ~1.9× for the higher-DPI panel; 20px margins
  to clear rounded corners.

Splash:
- 13 × 20×20 pixel-art creature animations sourced from
  claudepix.vercel.app via tools/scrape_claudepix.js (scraper handles
  both PRESET creature-engine and standalone FRAMES+PAL formats).
  tools/convert_to_c.js emits firmware/src/splash_animations.h.
  Attribution preserved in README and the generated header.

Tooling:
- tools/png_to_lvgl.js converts alpha PNGs to LVGL RGB565A8 (planar
  layout, with --tint to colorize Lucide black-on-transparent sources).
- tools/scrape_claudepix.js, tools/convert_to_c.js for the splash
  pipeline.

Docs:
- New worktree CLAUDE.md with hardware pin map, file inventory, build
  commands, and the 8 critical gotchas (CO5300 rotation, OPI PSRAM,
  pioarduino requirement, LVGL 9 font patching, centralized touch read,
  even-aligned flush regions, touch swap/mirror values, RGB565A8 layout).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 22:04:04 +00:00
Hermann Björgvin HaraldssonandClaude Opus 4.6 10b8052bcc Replace USB serial/HID with Bluetooth Low Energy
Move all communication from USB to BLE. The device now advertises as
"Claude Controller" and acts as both a BLE HID keyboard (for touch
gestures) and a GATT data server (for usage updates from the daemon).

- Add NimBLE-Arduino BLE module with custom GATT service + HID keyboard
- Add third screen (Bluetooth) with connection status, MAC, reset button
- Rewrite daemon in bash using bluetoothctl/busctl for BLE GATT writes
- Add screenshot capture via LVGL snapshot over serial
- Remove TinyUSB mode — normal pio upload works again
- Update README with BLE architecture, screenshots, gesture docs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 19:30:19 +00:00
Hermann Björgvin HaraldssonandClaude Opus 4.6 930055170f Add two-screen UI with controller and Lucide icons
Two screens switchable by tapping the Claude logo:
- Usage screen: session and weekly utilization with animation
- Controller screen: touch gesture HID keyboard controls

Controller screen features:
- Lucide icons for ESC, DEL, left/right arrow buttons
- Gestures panel with hand icon header and hint list
- Session usage bar with reset timer at bottom
- Hold anywhere for voice dictation (space key)
- Hidden Ctrl+Space on logo hold

Also fixes stuck modifier keys with releaseAll() after each keystroke.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 19:15:36 +00:00
Hermann Björgvin HaraldssonandClaude Opus 4.6 2611c70881 Initial commit: Claude Usage Tracker for Panlee SC01 Plus
Physical desk monitor that displays Claude Code usage limits (5-hour session
and 7-day weekly utilization) on an ESP32-S3 touchscreen via USB serial.

Firmware: LVGL 9 dashboard with LovyanGFX on SC01 Plus, Anthropic brand
colors and custom fonts (Tiempos, Styrene B, DejaVu Sans Mono), Claude
spinner animation with rotating status words.

Daemon: Pure bash script that reads the Claude Code OAuth token, makes a
minimal Haiku API call, extracts usage from rate-limit response headers,
and sends JSON to the ESP32 over serial. Uses inotifywait for instant
USB plug/unplug detection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 02:37:11 +00:00