# OpenCode Go LCD

Usage limits and reset timers on a tiny touch dashboard.

在触摸小屏上查看用量、剩余额度和重置时间。

- id: roflsunriz-esp32-opencode-usage
- author: roflsunriz
- repository: https://github.com/roflsunriz/esp32-opencode-usage
- license: MIT
- shape: wide
- scenes: tools
- boards: ESP32-2432S028R
- browser_playable: no
- preview: Project screenshots
- html: https://esp32gallery.com/projects/roflsunriz-esp32-opencode-usage/
- html_zh: https://esp32gallery.com/zh/projects/roflsunriz-esp32-opencode-usage/
- json: https://esp32gallery.com/data/catalog/projects/roflsunriz-esp32-opencode-usage.json

## Hardware

320 × 240 ILI9341 touchscreen on ESP32-2432S028R. Initial account setup uses the upstream desktop tool.

## English

```
An ESP32-2432S028R with its ILI9341 320×240 touch panel becomes a standalone meter for OpenCode Go usage: progress bars for the 5-hour, weekly and monthly windows, the percentage used, dollars spent against the cap, and time until reset. Setup is a one-time job on a Windows PC, which logs in through the official page and pushes the Wi-Fi SSID and password, the console session cookie, the workspace ID and the polling interval over USB. After that the board fetches from the official HTTPS service by itself with certificate validation, and the PC can be shut down. Amounts come from the official response rather than anything hardcoded. A BOOT click rotates the screen 180 degrees and the choice survives a power cycle. The Display tab sets the backlight timeout, default 1m, and the interval from 60 to 600 seconds. Credentials sit unencrypted in NVS, so the device and its backup should not be handed to anyone else.
```

## 中文

```
一块 ESP32-2432S028R（ILI9341，320×240 触摸屏）专门用来盯 OpenCode Go 的用量：5 小时、每周、每月三段进度条，各自的使用率、已花美元和上限、距离重置还有多久，5 小时那格没用过时就显示 —。配置只在 Windows 上做一次，用官网登录后通过 USB 把 Wi-Fi 账号密码、控制台会话 Cookie、工作区 ID 和抓取间隔写进板子；之后它自己带证书校验去连官方 HTTPS，电脑可以关机，USB 只剩供电。金额取官方返回的美元折算值，不写死在固件里。BOOT 短按把画面转 180 度并保存，Display 页能调熄屏时间和 60–600 秒的抓取间隔，初始熄屏是 1 分钟。密码和 Cookie 明文存在 NVS，设备和整片 Flash 备份别交给别人。
```
