Firefox 151 Supports Web Serial API, Enabling Direct Control of Microcontrollers and 3D Printers from the Browser
With Firefox 151, the Web Serial API is now supported, allowing direct control of microcontrollers, 3D printers, and other serial devices from the browser. Mozilla has also collaborated with Adafruit for testing.
The desktop version of Firefox has finally added support for the Web Serial API. Mozilla announced that Firefox 151 for Desktop now supports the Web Serial API, enabling web applications to directly communicate with hardware connected via serial ports without the need for native software.
What is the Web Serial API? The Web Serial API is a web API that allows websites to read from and write to serial devices using JavaScript. While modern computers typically do not include serial ports, devices connected via USB or paired through Bluetooth are often recognized by operating systems as serial ports. The Web Serial API provides developers with a way to communicate with these devices through the web platform. A wide variety of devices are supported, including microcontrollers, development boards, 3D printers, power meters, and other hardware that relies on serial connections. Specific examples include Espressif’s ESP-based boards (such as the popular ESP32 chip), the Raspberry Pi Pico, 3D printers, and LEGO devices.
Significance for Hobbyists and Makers This new functionality makes Firefox a more practical browser for individuals involved in hardware projects. Hobbyists, hardware hackers, educators, makers, and developers can use the Web Serial API for a variety of use cases, ranging from home automation to hardware prototyping and 3D printing. One particularly noteworthy aspect is Mozilla’s collaboration with Adafruit, a leading organization in open-source hardware and STEM education. Mozilla worked with Adafruit to test Firefox’s implementation with hardware workflows commonly used in the Adafruit community.
Partnership with Adafruit and CircuitPython Adafruit has been one of the organizations demonstrating the value of the Web Serial API. By using Web Serial to deliver firmware to devices, Adafruit has made installing CircuitPython quick and easy. CircuitPython provides an environment for running Python programs on small microcontroller boards. When installing CircuitPython firmware using Firefox, it is recommended to use the Adafruit Web Serial Tool rather than the OPEN INSTALLER method on the CircuitPython website. For example, with Adafruit’s ESP32-S2-based boards, messages sent from web code can be displayed directly on the device via Web Serial. Using a local web page, messages are sent via Web Serial and received by the device running CircuitPython’s code.py file.
Demo Projects by Mozilla Engineers Mozilla engineer Alex Franchuk has created interesting projects combining Web Serial with electronics. One such demo, called “Page Playground,” merges electronics and web editing into a functional and entertaining device. While many tools already exist for running custom code on small, inexpensive microcontroller boards, Web Serial makes it easier than ever to connect these devices to a computer and interact with them through a web-based user interface.
Context of Feature Gaps Among Browsers The Web Serial API has been supported by Chromium-based browsers (such as Google Chrome and Microsoft Edge) for some time, but it had long been absent from Firefox. With its introduction in Firefox 151, users can now engage in hardware development without relying solely on Chromium-based browsers. This move by Mozilla demonstrates its commitment to addressing the diverse needs of the developer community. As web technologies become increasingly important in hardware development and IoT, greater API compatibility across major browsers is essential for the health of the web platform. As of Firefox 151, desktop users can now connect to and interact with hardware such as microcontrollers and 3D printers directly through Web Serial-enabled web applications. For more technical details, refer to the Mozilla Developer Network (MDN) documentation. --- Frequently Asked Questions Q: Can the Web Serial API be used on the mobile version of Firefox? A: This announcement is limited to Firefox 151 for Desktop. There is no mention of support for the mobile version of Firefox, so at present, it is only available in desktop environments. Q: What devices are compatible with the Web Serial API? A: Compatible devices include ESP32-based boards from Espressif, the Raspberry Pi Pico, 3D printers, LEGO devices, and a wide range of other equipment that supports serial communication via USB or Bluetooth. Adafruit’s CircuitPython-compatible devices are also included. Q: Will existing Web Serial applications for Chrome or Edge work on Firefox? A: Since the Web Serial API is a standardized web API, applications developed in compliance with the specification are likely to work in Firefox as well. However, minor implementation differences between browsers may require testing on an application-by-application basis.
Source: Lobsters
← Back to Home
Comments