cronologic-de / webusb

Configure a Raspberry Pi Pico using SCPI over WebUSB
Mozilla Public License 2.0
7 stars 1 forks source link

WebUSB

Configure a Raspberry Pi Pico using SCPI over WebUSB.

This is used by cronologic GmbH & Co. KG in the development of time-to-digital converters, Gsps digitizers and pulse generators.

Project structure and building

This repository consists of two parts: The MCU firmware and the web frontend to control it. Check the readme files for each of these parts for instructions on how to build it.

The frontend is automatically deployed at https://cronologic-de.github.io/webusb/, feel free to check it out!

When cloning the repository, make sure to also initialize the SCPI parser library submodule at firmware/lib/scpi-parser, else the firmware won’t build. If you use git clone on the command line, adding --recurse-submodules should suffice.

Status

Work on this project had begun, but is currently paused due to a shift in priorities.

The completed parts are:

The main missing parts are:

WebUSB or Web Serial?

Web Serial abstracts away low-level USB enumeration and protocol. In fact, it’s not limited to USB at all. If your machine has built-in serial ports, these can be accessed, too. You are limited to sending and receiving bytes (convertable into text, of course, if your protocol isn’t binary) and cannot perform any low-level interaction with the device.

However, WebUSB on the other hand only works if the operating system has not already claimed the device. This is why, unintuitively, you cannot use WebUSB to access a USB Serial device (also known as USB CDC) like the Pi Pico: The OS already claims exclusive access on the device by providing a serial port for it.

This is why we’ve stopped working on WebUSB and continued with Web Serial, at least for the prototype. Once we migrate from a CDC-presenting microcontroller to a USBTMC configuration, WebUSB might become the way to go again. Determining whether there are operating systems that automatically claim TMC devices, and if so, how to prevent that, is left as a future investigation.

License

The code in this repository is licensed under the Mozilla Public License 2.0. This more or less means that you can do with this code whatever you want, but if you improve the code you shall make your changes available ot others upon request. Please read the license for additional details.

We encourage you to contribute to this repository. By uploading to this repository you agree to make your changes available under the beforementioned license.