fix(odrive web): valid WebUSB "any device" filter + VID-only default - #771
Merged
Conversation
The odrive WebUSB consoles used `{ acceptAllDevices: true }` for the "any
device" path, but acceptAllDevices is a Web Bluetooth option and is invalid
for WebUSB -- requestDevice throws "Required member filters is undefined", so
"show all devices" never worked. Use `{ filters: [{}] }` (a single empty
filter matches everything). Also make the default filter VID-only, so any espp
device (VID 0x1209) is offered rather than only the ODrive PID. The Web Serial
console and the WebHID visualizer are unaffected (different APIs).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Fixes WebUSB device selection in the ODrive web consoles by replacing an invalid “any device” option and broadening the default match criteria to improve device discoverability.
Changes:
- Replace the invalid
acceptAllDevices(Web Bluetooth) usage with a WebUSB-valid “match all” filter (filters: [{}]). - Change the default filter from VID+PID to VID-only (
vendorId: DEFAULT_VID) so more devices under that VID appear. - Update inline comments and the “Default filter” status line to reflect the new behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| components/odrive_ascii/web/odrive_webusb_console.html | Fix WebUSB requestDevice options; adjust default filter and user-facing status text. |
| components/odrive_ascii/web/odrive_control_panel.html | Same WebUSB requestDevice fix and default filter change; update status text accordingly. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
1459
to
+1460
| logLine("sys", "Ready. Click Connect and pick the ODrive native (vendor) USB device."); | ||
| logLine("sys", `Default filter: VID 0x${DEFAULT_VID.toString(16)} / PID 0x${DEFAULT_PID.toString(16)}. Tick "Any device" to see all.`); | ||
| logLine("sys", `Default filter: any espp device (VID 0x${DEFAULT_VID.toString(16)}). Tick "Any device" to see all.`); |
Comment on lines
674
to
675
| // 1) Ask the user to pick a device. Default filter targets the espp | ||
| // ODrive vendor VID/PID; "Any device" shows every device instead. |
Comment on lines
1187
to
+1188
| logLine("sys", "Ready. Click Connect and pick the ODrive vendor USB device."); | ||
| logLine("sys", `Default filter: VID 0x${DEFAULT_VID.toString(16)} / PID 0x${DEFAULT_PID.toString(16)}. Tick "Any device" to see all.`); | ||
| logLine("sys", `Default filter: any espp device (VID 0x${DEFAULT_VID.toString(16)}). Tick "Any device" to see all.`); |
| setConnectedUI(false); | ||
| logLine("sys", "Ready. Click Connect and pick the ODrive vendor USB device."); | ||
| logLine("sys", `Default filter: VID 0x${DEFAULT_VID.toString(16)} / PID 0x${DEFAULT_PID.toString(16)}. Tick "Any device" to see all.`); | ||
| logLine("sys", `Default filter: any espp device (VID 0x${DEFAULT_VID.toString(16)}). Tick "Any device" to see all.`); |
finger563
added a commit
that referenced
this pull request
Sep 5, 2026
) #771 was merged with only the initial VID-filter fix; two later review rounds never reached main. This carries them over so the odrive consoles match the other espp web consoles: - requestUsbDevice(): the "show all devices" path uses one empty filter {} and falls back to a VID-only filter if a WebUSB implementation rejects the empty filter (the shared helper now used by every espp WebUSB console). - reword the comments, the "Any device" tooltip, and the status lines to the actual filter semantics ("any device with VID 0x1209", not "ODrive VID/PID"), and zero-pad the VID hex. Affects odrive_webusb_console.html and odrive_control_panel.html only. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The odrive WebUSB consoles used
{acceptAllDevices:true}for the "any device" path, butacceptAllDevicesis a Web Bluetooth option and is invalid for WebUSB —requestDevicethrows "Required member filters is undefined", so "show all devices" never worked.{filters:[{}]}(a single empty filter matches every device).0x1209) is offered, not just the ODrive PID — consistent with the other espp web consoles.Affects
odrive_webusb_console.htmlandodrive_control_panel.html. The Web Serial console (odrive_console.html) and the WebHID visualizer (hid_visualizer.html) use different APIs and are unaffected. These consoles speak the ODrive ASCII protocol (no dispatcher module), so there is no module-presence check to add.🤖 Generated with Claude Code