WebSerial: How to communicate with a microcontroller from the browser
I want to talk a bit about the WebSerial API . You have likely seen websites that allow you to flash microcontrollers directly from a web page. I first encountered this with the Micro:bit educational kit. A child can build a Scratch algorithm and, with a single click, upload the firmware to the board straight from the browser. This is incredibly convenient (as long as you have an internet connection): No need to install specialized software (IDEs, drivers, or command-line utilities). No complex environment setups or configurations. Minimal permission issues (though Linux users might still need occasional adjustments). Essentially, you only need a single HTML + JavaScript page to handle all the logic. It works almost everywhere on Chromium-based browsers (Google Chrome, Microsoft Edge, Opera, Vivaldi, Brave). Interestingly, on Chrome for Android, this method provides access to Bluetooth/BLE serial, though I couldn’t get it to work with USB CDC devices. It is also worth noting...