Linux lab: Mozilla's WebThings Gateway
Crash Landing
The smart home is gaining momentum, and Mozilla joins the fray. Mozilla WebThings is billed as an open platform for managing IoT devices. We decided to investigate.
Many Internet of Things (IoT) solutions are proprietary tools that limit choice and compromise user privacy. As one might expect, the open source community, which has always prized freedom and openness, has been hard at work on solutions that would avoid the many problems associated with vendor lock-in.
The Mozilla project recently added a promising new technology to the IoT mix. Mozilla's WebThings [1] is an implementation of the Web of Things architecture, which attempts to build the IoT around proven and well known Internet technologies, such as REST, HTTP, and JSON.
According to Mozilla's website, WebThings consists of two primary components:
- WebThings Gateway [2] – a software distribution for smart home gateways focused on privacy, security, and interoperability. The gateway acts as an interface between the IoT network and the Internet or local network.
- WebThings Framework [3] – a collection of reusable software components to help developers build their own web things .
WebThings, which is open source and freely available on GitHub [4] supports a number of home automation protocols, including Zigbee [5], which has been under development for more than 15 years, and Z-Wave [6].
An open platform for IoT with multiple protocol support is a very promising development – but does WebThings work now with real-world IoT devices? We decided to find out.
Hardware
WebThings Gateway runs on a conventional Raspberry Pi (models 1 to 4) with a modified Raspbian operating system. Mozilla also offers an image for the Turris Omnia WLAN router [7], and the WebThings developers are working on a version for OpenWRT-based devices. Users control devices with the Things graphical user interface.
To enable communication between the computers on the network and Zigbee or Z-Wave IoT devices, you'll also need to plug a suitable gateway device into the Raspberry Pi. For our tests, we used the ConBee II Zigbee [8] USB stick. UZB, a Z-Wave USB stick, is also available [9].
First Contact
We used a Raspberry Pi 4B as our gateway computer. As end devices, we used several Zigbee-capable lamps by manufacturers Aurora, Enlite, Müller-Licht, and Philips. We also added a switchable OSRAM socket to the Zigbee network.
To build the WebThings Gateway system for the Raspberry Pi, download the image from the project website and unpack the archive. Then transfer the resulting image to a MicroSD card, which acts as the boot medium. (See the instructions on the Mozilla WebThings website [10].) Then plug the ConBee II stick into the Raspberry Pi and start the system.
Next set up a WLAN named WebThings Gateway nnnn, where nnnn is a random string of characters and digits. Users will connect to this WLAN hotspot on other computers. Open a web browser and type http://gateway.local in the address bar; this opens a list of available wireless networks. Select your WLAN from the list and associate your Rasp Pi with the desired WLAN by entering the WPA2 key (Figure 1).
Then log in to this WLAN on your computer and call the http://gateway.local URL once again. In the browser, Mozilla's gateway creates a subdomain that allows access to the gateway from the Internet. The keys for secure access to the gateway using the HTTPS protocol are generated in the background (Figure 2). You may have to forward the gateway IP address and port on the router.
In the next step, create a new user account in the browser. Enter the desired name, password, and email address. You are then taken to an almost empty screen that prompts you to search for new equipment. To start the search, press the plus button bottom right.
The system now searches the local network for connected Zigbee devices and lists them in the browser window. Alternatively, you can use the Add by URL link to manually integrate smart devices on the WLAN via their IP addresses.
The system settings can be accessed by opening the menu hidden behind the hamburger icon top left in the browser window. In the Settings
submenu, first change the system settings. Use the system settings to create additional users and integrate other devices, which Mozilla refers to as Things, into the system. In addition, you can modify the WLAN or the subdomain configuration (Figure 3).
Modules
To operate most devices, you will need to retroactively install add-ons. Right from the start, only the WebThings, Z-Wave, and Zigbee modules are active. The WebThings module is used to integrate smart end devices that can be addressed via WLAN into Mozilla's home automation software. You can install additional modules later to access terminal devices, communicate via Bluetooth, and more (Figure 4).
Clicking on the plus button in the bottom right corner of the add-ons list display takes you to a list of additional modules. Click on the + Add button to integrate the module with the system.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
System76 Refreshes Meerkat Mini PC
If you're looking for a small form factor PC powered by Linux, System76 has exactly what you need in the Meerkat mini PC.
-
Gnome 48 Alpha Ready for Testing
The latest Gnome desktop alpha is now available with plenty of new features and improvements.
-
Wine 10 Includes Plenty to Excite Users
With its latest release, Wine has the usual crop of bug fixes and improvements, along with some exciting new features.
-
Linux Kernel 6.13 Offers Improvements for AMD/Apple Users
The latest Linux kernel is now available, and it includes plenty of improvements, especially for those who use AMD or Apple-based systems.
-
Gnome 48 Debuts New Audio Player
To date, the audio player found within the Gnome desktop has been meh at best, but with the upcoming release that all changes.
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.