Local standalone launcher for the DEPZ sensor web viewer — bypasses browser WebSerial by talking to devices over pyserial.
Project description
depz-sensor-viewer
A local, standalone launcher for the DEPZ sensor web viewer. It runs a tiny
localhost web server that serves the viewer SPA and talks to your DEPZ
sensors over pyserial — so the UI never
touches the browser WebSerial API.
Why
The hosted viewer uses the browser's WebSerial API, which means:
- a port-picker prompt every time you connect,
- Chrome-only support, and
- failures under some enterprise / managed-Chrome policies that disable WebSerial entirely.
This launcher sidesteps all of that. The Python process opens the serial port
locally with pyserial and pipes raw bytes to the SPA over a WebSocket. No
prompt, no WebSerial, works in any browser pointed at localhost.
Install & run
pipx install depz-sensor-viewer
depz-sensor-viewer
This starts the server on http://127.0.0.1:8765 (or a random free port if
8765 is taken) and opens your browser. Options:
depz-sensor-viewer --port 9000 # pick a port (0 = random free)
depz-sensor-viewer --host 127.0.0.1 # bind address (localhost by default)
depz-sensor-viewer --no-browser # just start the server
Press Ctrl-C to stop.
Linux: serial permissions
On Linux, opening /dev/ttyACM* requires membership in the dialout group.
If devices don't open, add yourself and re-login:
sudo usermod -aG dialout $USER
# then log out and back in (or: newgrp dialout)
The viewer diagnoses this for you at GET /api/permissions and shows the fix in
the UI. ModemManager can also briefly grab a freshly-plugged CDC device; retry
after a second, or sudo systemctl mask ModemManager if it persists.
HTTP / WebSocket contract
The bundled SPA detects standalone mode and drives devices through this fixed
interface (served by depz_sensor_viewer.server):
| Endpoint | Response |
|---|---|
GET /api/health |
{"standalone": true, "version": "<pkg>"} |
GET /api/devices |
{"devices": [{path, usb_vid, usb_pid, serial, sensor_type, usb_model_hint}]} |
GET /api/permissions |
{ok, os, issues, fix: {command, explanation}} |
WS /ws/serial?path=<port>&baud=<n> |
raw byte pipe (see below) |
/api/devices enumerates only ports whose USB identity is a known DEPZ device
(via the SDK's USB table); it does not open the ports. baud defaults to
115200 and is nominal for the CDC-ACM devices.
/ws/serial framing:
- client → server binary frame →
serial.write(bytes) - server → client binary frame ← bytes read from the serial port
- text frames carry JSON control/status:
- server:
{"opened": true, "path": ..., "baud": ...}right after open - server:
{"error": "...", "code": "...", "fix": {...}}on failure (permission errors include the per-OSfix) - client:
{"cmd": "set_baud", "baud": <int>}(optional)
- server:
The port is closed when the WebSocket closes.
Building the bundled SPA
The wheel ships the built SPA under depz_sensor_viewer/_static/. To (re)build
it from the repo's TypeScript viewer:
python packages/depz-sensor-viewer/scripts/bundle_spa.py
This runs bun run build at the repo root and copies dist/client/** into
_static/. Pass --skip-build to copy an existing dist/client/ without
rebuilding. Until you run it, the package ships a placeholder index.html that
points here — the API endpoints above are live regardless.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file depz_sensor_viewer-0.1.3.tar.gz.
File metadata
- Download URL: depz_sensor_viewer-0.1.3.tar.gz
- Upload date:
- Size: 462.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
713a2d7c0bdc093ad130d87349c3ba84073ad85a67aced398cd8ed8264f22bc7
|
|
| MD5 |
2c444f797550b7137afab1ae86f727fe
|
|
| BLAKE2b-256 |
1a60cb81ec8eb4c356b079fbbf7b5629fb33b9f41f1cdef64ca931508be4c197
|
Provenance
The following attestation bundles were made for depz_sensor_viewer-0.1.3.tar.gz:
Publisher:
publish-viewer.yml on depz-ai/depz-sensor-sdk-and-viewer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
depz_sensor_viewer-0.1.3.tar.gz -
Subject digest:
713a2d7c0bdc093ad130d87349c3ba84073ad85a67aced398cd8ed8264f22bc7 - Sigstore transparency entry: 2089612517
- Sigstore integration time:
-
Permalink:
depz-ai/depz-sensor-sdk-and-viewer@e8ace4cd25d4a9a9be17fdee5a2b455c32992e84 -
Branch / Tag:
refs/tags/viewer-v0.1.3 - Owner: https://github.com/depz-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-viewer.yml@e8ace4cd25d4a9a9be17fdee5a2b455c32992e84 -
Trigger Event:
push
-
Statement type:
File details
Details for the file depz_sensor_viewer-0.1.3-py3-none-any.whl.
File metadata
- Download URL: depz_sensor_viewer-0.1.3-py3-none-any.whl
- Upload date:
- Size: 475.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99055cb702e85d87cb4f4a4d80be1f76b1bedb74a8ec108cd424a115bb34305f
|
|
| MD5 |
ea388d492ada1c45325355d1d544babc
|
|
| BLAKE2b-256 |
676bed8f797ffb8f0b73729b3f9cb483d5b7b5d77ad419b0b8e44e77df6a2120
|
Provenance
The following attestation bundles were made for depz_sensor_viewer-0.1.3-py3-none-any.whl:
Publisher:
publish-viewer.yml on depz-ai/depz-sensor-sdk-and-viewer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
depz_sensor_viewer-0.1.3-py3-none-any.whl -
Subject digest:
99055cb702e85d87cb4f4a4d80be1f76b1bedb74a8ec108cd424a115bb34305f - Sigstore transparency entry: 2089612956
- Sigstore integration time:
-
Permalink:
depz-ai/depz-sensor-sdk-and-viewer@e8ace4cd25d4a9a9be17fdee5a2b455c32992e84 -
Branch / Tag:
refs/tags/viewer-v0.1.3 - Owner: https://github.com/depz-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-viewer.yml@e8ace4cd25d4a9a9be17fdee5a2b455c32992e84 -
Trigger Event:
push
-
Statement type: