Dormitory washing machine controller built with React, TypeScript, Vite, and local PWA assets for GitHub Pages.
- React + TypeScript + Vite frontend, split into reusable control, connection, status, builder, and manual-packet components.
- No runtime CDN, external font, or remote icon dependency.
- Web Bluetooth connection for the common
0xffe0service, with write fallback discovery when0xffe2is not available. - Notification listener for
0xffe1and status response parsing. - Remembered-device flow through
navigator.bluetooth.getDevices()when Chrome exposes the Web Bluetooth permissions backend. - Protocol-driven command generation from
TT / CC / MM / LLfields and the reverse-engineered CRC. - Responsive phone and desktop control console.
- Local
.mod8-bit loop asset underwebui/public/audio/, mounted as background playback with a mute control. - Common presets for intensive wash, standard wash, quick wash, spin, and tub clean.
- Water-level control and custom parameter builder.
- Manual raw HEX packet sender.
- Separate pause and resume controls, with pause using the confirmed fixed packet.
Request frames are generated as:
AA TT CC MM LL CRC_H CRC_L 55
The CRC is calculated over the first five bytes:
crc = 0xE4A5
crc ^= byte
if crc & 1: crc = (crc >> 1) ^ 0x8048
else: crc = crc >> 1
Known fields:
TT=00query status,TT=01send control.CC=9Anormal washing/query family.CC=9Bspecial mode family.MM=01intensive,02standard,03quick,04spin,08tub clean.LL=01/02/03low, middle, high water level.
The pause/resume packet is intentionally editable because the reference data does not contain a verified pause sample. The default is generated from TT=01 CC=9B MM=05 LL=00.
The frontend app lives under webui/:
cd webui
npm install
npm run dev
npm test
npm run buildOpen the Vite dev server on localhost; Web Bluetooth requires HTTPS or a secure localhost context.
The UI entry is webui/src/main.tsx; app-level state and Bluetooth orchestration live in webui/src/App.tsx, while view modules live under webui/src/components/.
The production build uses /FreeWashing/ as the Vite base path:
cd webui
npm run build.github/workflows/pages.yml builds and tests from webui/, then deploys webui/dist to GitHub Pages on pushes to main.
Chrome's navigator.bluetooth.getDevices() returns devices that the current origin is already allowed to access. The app uses that API when available so a previously selected device can be listed and reconnected without opening the chooser again.
This API is still experimental and browser/platform dependent. If it is not available, the app falls back to requestDevice().