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
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.