The feature is very recent and its specification can be found in this W3C Communicty Draft:
I played a bit with these nice examples:
PlotSer (Plot a real time graph from data received on the serial port) https://labs.vaadin.com/plotser/
Web-Serial-API (Send data to a LED or receive analog reading from Arduino) https://github.com/svendahlstrand/web-serial-api
After that, I thought that a really useful simple tool would be an online Serial Terminal, such as miniterm, minicom, PuTTY, TeraTerm or other desktop serial terminal application, but online! And after some coding, it works. You can simply access one of the URLs below and access your serial port! 🙂
I took me some time to figure this, but note that due to security concerns, it will only work if served from a HTTPS server or locally from the filesystem. If the content is served from HTTP, the serial object will not be available and the button will be disabled.
Another important point: it works on vanilla/standard Google Chrome, but Experimental Web Platform Features must be enabled in
One of my main interests in this technology was to integrated it on project BIPES (http://www.bipes.net.br/), an open source tool to easily program several devices using Blocks (Blockly) and/or Python (MicroPython) all directly from the browser. The original BIPES communicates with the embedded devices using WebREPL protocol from MicroPython, which only works over HTTP. In that way, I had some trouble with HTTP (WebREPL) versus HTTPs (Web Serial API), so one solution was to have two BIPES versions – one with Web Serial and one with WebREPL:
BIPES with WebREPL (Wifi / network access to embedded devices) http://bipes.net.br/beta2/ui/#
BIPES with Web Serial API (USB connection to embedded devices) https://bipes.net.br/beta2serial/ui/#
(note that WebREPL version must be accessed with HTTP and Web Serial version must be accessed using HTTPS)
Finally, I forked the WebREPL (https://micropython.org/webrepl/) online client from MicroPython, which is really useful for the MicroPython community. Forked it into
https://github.com/rafaelaroca/webrepl and added Web Serial feature! Now it is possible to use WebREPL over network or directly by using USB Cable. The only sad part is the HTTP x HTTPs issues, depending on how you want to use WebREPL.
Hope this post is useful for someone 🙂