一个独立的桌面状态显示器:本机 Codex Desktop 的活动状态通过 USB-C 发送到 RP2040-Zero,在 1.3 英寸 SH1106 OLED 和三色 LED 上实时显示。
本项目只在本机读取 Codex session 事件类型。不会将提示词、回复文本、工具参数 或工具输出发送到开发板。
- Native EasyEDA Professional project — editable
codex.eprj2, including the carrier PCB, board outline, OLED connector, RP2040-Zero footprint, mounting holes and LED footprints. - One USB-C cable — the RP2040-Zero's onboard USB-C supplies power, MicroPython upload and USB CDC status transport.
- Live Codex status —
THINK,TOOL,DONEandERRORderive from local Codex Desktop session events. Intermediate commentary never becomesDONE. - Current-action ticker — a 42-character horizontal activity feed reports safe stages such as planning, editing files, running checks and waiting for a process. Prompts, replies, command text and tool arguments are never shown.
- Active task counter — the OLED's top-right corner shows
T0,T1,T2and so on for the number of Codex tasks currently executing. - Five themed animations — sleeping-cat standby, orbiting idea particles, an active build conveyor, check-mark confetti and a glitching warning scene make each state visually distinct on the monochrome display.
- DuskRain home page — supplied SH1106 startup animation is preserved, then a compact live status panel is rendered over the home screen.
- Cat-nap standby loop — after
DONEremains visible for 12 seconds, the bridge entersIDLEand the OLED shows a four-frame sleeping-cat, drifting-Z and twinkling-star animation until the next Codex event. - Three hardware indicators — red fault, yellow while any project is active, and green only when Codex is connected and all recent projects are idle LEDs are controlled by GP0/GP1/GP2.
- Local preview — a Windows always-on-top preview mirrors the compact display and publishes the same newline-delimited JSON to the board.
flowchart LR
A[Codex Desktop local session log] --> B[Python activity bridge]
B --> C[status.json]
C --> D[Windows preview + USB publisher]
D -->|USB CDC · 115200 baud| E[Waveshare RP2040-Zero]
E --> F[SH1106 128×64 OLED]
E --> G[Red / Yellow / Green LED]
For the full state mapping and data-boundary explanation, see docs/WORKFLOW.md.
| Item | Selection |
|---|---|
| Controller | Waveshare RP2040-Zero, onboard USB-C |
| Display | 1.3-inch 128×64 monochrome SH1106 I2C OLED |
| I2C pins | GP4 = SDA, GP5 = SCL |
| Status LEDs | GP0 red, GP1 yellow, GP2 green; active-low |
| Carrier size | 35.40 × 42.00 mm, two-layer |
| Mounting | Four M3 / 3.2 mm NPTH holes |
The OLED header is GND / 3V3 / SCL / SDA. Use 3.3 V, not 5 V. See the
BOM, schematic and
assembly instructions before ordering or soldering.
Open codex.eprj2 in EasyEDA Professional. The source/project handling notes are in easyeda/README.md. Re-run DRC and generate fabrication files from the revision you plan to manufacture.
Install MicroPython for RP2040 on the RP2040-Zero, then upload every .py file
from firmware/micropython/ to its root filesystem using Thonny or mpremote.
Reset the board. The default OLED I2C address is 0x3C; 0x3D is also
accepted.
py -m mpremote connect COM20 fs cp .\firmware\micropython\main.py :main.py py -m mpremote connect COM20 reset
Upload the animation and driver modules as well on a new board. Details are in firmware/micropython/README_CODEX.md.
Connect the RP2040-Zero by USB-C, then run:
cd H:\playfround\codex_oled_display powershell -ExecutionPolicy Bypass -File .\host\run_codex_oled.ps1
The script installs pyserial if needed, finds the RP2040 serial port, starts
the local Codex event bridge and opens the status window. If the board is
unplugged and reinserted, it re-enumerates the USB device every 1.5 seconds and
resends the current Codex state automatically. Use -Port COM20 to override
automatic detection.
To start the bridge automatically whenever the current Windows user signs in, install the included Startup-folder shortcut once:
powershell -ExecutionPolicy Bypass -File .\host\install_autostart.ps1
Automatic port detection is recommended because Windows may assign a different
COM number after moving the device. To pin a port, append -Port COM7. Remove
the startup entry with host\uninstall_autostart.ps1.
Run build_portable.ps1 to produce a standalone Windows executable and ZIP:
powershell -ExecutionPolicy Bypass -File .\build_portable.ps1
The resulting release/CodexOLED-Portable-Windows-x64.zip can be copied to a
different Windows x64 computer. The user only needs to connect the programmed
RP2040-Zero and double-click CodexOLED.exe; Python, pip and a fixed COM number
are not required. The package also contains an optional current-user sign-in
startup installer.
The Startup shortcut launches silently in the Windows notification area. The
desktop shortcut opens a dark control center with the live OLED preview,
Codex activity, RP2040/COM connection state, reconnect and log controls. If the
runtime is already active, the shortcut reveals that existing single instance.
The cat tray icon can also show or hide the control center and exit the app.
For self-signing and trusted public distribution options, see
docs/SIGNING.md.
Run build_downloader.ps1 to create
release/CodexOLED-Bootstrap-Windows-x64.exe. This single-file bootstrapper downloads
the latest GitHub Release, requires and verifies the matching SHA-256 sidecar,
installs under %LOCALAPPDATA%\CodexOLED, optionally creates the current-user
startup shortcut, and launches the app. A valid Release must contain both
CodexOLED-Portable-Windows-x64.zip and
CodexOLED-Portable-Windows-x64.zip.sha256.
For a conventional Windows setup wizard with license, destination, shortcut, startup and ready-to-install pages, install Inno Setup 6 and run:
.\build_installer.ps1 -CertificateThumbprint <your-code-signing-thumbprint>
The resulting CodexOLED-Setup-Windows-x64.exe embeds the complete signed
runtime, so first installation cannot stall on GitHub access. It installs per
user without administrator rights and includes a normal uninstaller.
codex.eprj2 Native EasyEDA Professional project
easyeda/ EasyEDA project/opening instructions
hardware/ Electrical spec, schematic and BOM
firmware/micropython/ Deployed RP2040 MicroPython firmware and frames
host/ Local Codex bridge, serial publisher and preview
docs/ Assembly, workflow, verification and images
The USB payload is one UTF-8 JSON object per newline at 115200 baud:
{"frame":"TOOL","detail":"TOOL EXEC","online":true,"active_count":2}Normal frames are IDLE, THINK, TOOL, DONE and ERROR. The additional
TEST frame turns on all three LEDs for assembly checks. The RP2040 sends a
CODEX ACK ... line after accepting a changed status.
For non-idle states, detail is rendered as a continuous horizontal ticker.
The local bridge derives this label from a fixed allowlist of activity classes;
it does not forward session text or tool parameters to the serial device.
Source compilation, bitmap validation, COM20 deployment, serial acknowledgments and a local Codex-to-OLED end-to-end transfer have been tested. See docs/TESTING.md and TEST_REPORT.md.
This project is released under the MIT License. The project owner has authorized public redistribution of the supplied DuskRain animation bundle; see THIRD_PARTY_NOTICES.md.

