Skip to content

Add browser-based AirCube monitor (Web Serial) for Chromebooks#58

Open
craigpfeifer wants to merge 1 commit into
StuckAtPrototype:masterfrom
craigpfeifer:web-serial-monitor
Open

Add browser-based AirCube monitor (Web Serial) for Chromebooks#58
craigpfeifer wants to merge 1 commit into
StuckAtPrototype:masterfrom
craigpfeifer:web-serial-monitor

Conversation

@craigpfeifer

Copy link
Copy Markdown

Summary

Adds scripts/aircube_webapp.html, a browser-based replacement for the aircube_app.py desktop app that works on Chromebooks (and any Chrome/Edge browser).

The PyQt6 desktop app cannot run on a Chromebook:

  • pyserial sees nothing -- the Crostini (termina) VM kernel has no cdc-acm module, so no /dev/ttyACM* is ever created.
  • pyusb can open the device but not read -- the ESP32-H2 USB Serial/JTAG gates TX until the host marks the port "connected", and the required SET_CONTROL_LINE_STATE (class interface-OUT) control transfer times out through ChromeOS/Crostini's USB passthrough.

The web app reads over the Web Serial API instead (through the ChromeOS host's cdc-acm driver), using the DTR=0 RTS=1 handshake the ESP32-H2 USB Serial/JTAG requires. Note: DTR=1 resets/halts the chip, which was the root cause of an initially silent stream.

What's included

  • aircube_webapp.html -- full app: live value cards (with AQI color bands), C/F toggle, three scrolling charts (canvas, no external libs), CSV logging (session download + File System Access streaming), field-definition tooltips, and device controls (get_config, set_intensity, set_readout_period, history dump). Apache 2.0 header.
  • WEBAPP_README.md -- usage, the full Chromebook investigation, serial protocol reference, and troubleshooting.
  • Diagnostic artifacts referenced by the README: webserial_aircube_test.html, webusb_aircube_test.html, test_serial_discovery.py, test_pyusb_discovery.py.

Testing

Verified live streaming, charts, C/F toggle, CSV download, and get_config/set_intensity round-trips against an AirCube on a Chromebook over http://localhost.

🤖 Generated with Claude Code

The PyQt6 desktop app cannot run on a Chromebook: Crostini has no cdc-acm module (pyserial sees no port) and its USB passthrough drops the DTR control-OUT pyusb needs. aircube_webapp.html reads over Web Serial instead, using the DTR=0 RTS=1 handshake the ESP32-H2 USB Serial/JTAG requires. Includes live values, C/F toggle, charts, CSV logging, and device controls, plus diagnostic scripts and WEBAPP_README.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant