CodeCraft Hub

Wio Terminal AI Token Dashboard

Wio Terminal AI Token Dashboard - Wio Terminal (D51R) - rong - CodeCraft Hub

Scene: Smart Home

Devices / BOM: Wio Terminal (D51R)

Smart Home application on CodeCraft Hub. This open-source BLE hardware dashboard tracks real-time Codex & Claude AI quota. It fetches official usage data from local logged-in accounts with zero token cost, computes daily API USD costs, and displays all stats

Documentation

Claude / Codex AI quota visualization dashboard based on Wio Terminal, supporting BLE Bluetooth push, local web preview and usage cost statistics.

Deploy steps

  1. steps

    ✨ Core Features

    Dual-platform Quota Monitoring: View 5h / 7d used percentage and reset time of Claude & Codex official quota

    Automatic Account Sync: Fetch real quota data from local logged-in accounts; Codex adopts official API with zero token consumption

    Token Usage Statistics: Count today & past 7 days token consumption via local session logs

    Cost Conversion: Calculate daily calling cost in USD based on official API pricing

    BLE Bluetooth Sync: Push data to Wio Terminal via BLE with low-power partial screen refresh

    Local Web Preview: Check dashboard data via local browser page

    ⚙️ Working Principle Local

    Code snippet included — open the application page to copy it.

    🎯 Application Scenarios

    Develop with Codex CLI / Claude Code, need real-time quota monitoring

    Need persistent desktop usage reminder, avoid frequent web/terminal quota checking

    Reuse existing Seeed Wio Terminal as a dedicated AI hardware dashboard

    📋 Prerequisites

    Hardware Seeed

    Wio Terminal + USB-C Cable Software

    Python 3.9+, PC Bluetooth Enabled Account Authorization

    Codex: Complete local authorization via codex login

    Claude (Optional): Logged in Claude Code locally

    Special Configuration ~/.codex/config.toml must connect official server directly. Remove third-party proxy config: model_provider = "custom"

    📝 Usage Guide

    Initial Setup (Run Once Only)

    Install Python Dependencies

    Run command in project root PowerShell: pip install -r requirements.txt

    Flash Firmware to Wio Terminal

    Method 1: Flash via Arduino IDE

    Open project:arduino\ai_quota_dashboard\ai_quota_dashboard.ino

    Board Selection: Seeed Wio Terminal

    Install required libraries, compile and upload firmware

    Method 2: Flash precompiled firmware via CLI

    Flash firmware to your device (in-app tool on CodeCraft Hub).

    Confirm Codex Official Direct Connection

    Delete third-party relay config in local config file, keep official default connection.

    Claude Authorization (Optional)

    Just log in Claude Code locally, no extra configuration needed.

    Daily Startup (Dual Terminals Required)

    Kill Historical Python Processes

    Get-CimInstance Win32_Process -Filter "Name='python.exe'" | Where-Object { $ .CommandLine -match 'server.py|auto_sync.py' } | ForEach-Object { Stop-Process -Id $ .ProcessId -Force }

    Terminal 1: Start BLE Server

    py -u server.py --ble --ble-interval 15 Parameter: BLE data refresh interval 15s

    Terminal 2: Start Auto Quota Sync

    py -u tools\auto_sync.py --interval 60 Parameter: Fetch quota data every 60s

    Power on Wio Terminal

    Dashboard loads automatically. Green top-right icon means Bluetooth connected, data refreshes every 60s by default.

    Optional Commands

    Local Web Preview: Visit http://127.0.0.1:8765/preview.html

    Single Quota Fetch (No Loop): py tools\auto_sync.py --once

    Codex Only (Skip Claude): py tools\auto_sync.py --no-claude --interval 60

    ✅ Running Verification

    Sync terminal outputs log every minute:

    [13:57:01] codex 5h=2% (reset 15:29) 7d=1% ... today=$0.66 tokens=153.35KToken -> posted+BLE

    Server terminal outputs[BLE] synced for successful Bluetooth push

    Wio Terminal screen …