USB/Serial Device Access from a Yew WASM App #3291
Replies: 2 comments
-
The MDN docs mention the Web Serial API and Web USB API but only a few browsers support them at present. A Yew frontend above a native Tauri backend could also work if you don't mind distributing an executable. I would imagine that would allow you to do most if not all of the app in Rust if that is a consideration. |
Beta Was this translation helpful? Give feedback.
-
It's also possible to distribute a helper executable "serial server" to which you communicate from your webapp. That's the way the Arduino folks do it for their web IDE. You could create a workspace with:
That way, the shared crate ensures serializing/deserializing requests will always succeed. You can always strip out the server component and fall back to pure WASM when the web API's are more broadly adopted. I'm currently working on a Yew frontend for a warp+serialport serial server that communicates with an Arduino over USB. I also serve the webapp with the same warp server on localhost in that project, since it all self-contained (no hosting or databases required). If you'd like I can try to document it a little and set it to public somewhere. |
Beta Was this translation helpful? Give feedback.
-
Hello folks! I am getting ready to begin developing an app for our Search and Rescue team to interface to some local devices we have (radios, locators, and a few other peripherals. Physical buttons for a dispatch console). I know WASM cannot directly interact with these OS-level constructs, but is there any good guidance or documentation of doing this via the browser's exposed APIs?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions