Friday, March 29, 2024
ExplainerHow ToIoT HardwaresIoT PlatformsIoT Software&ToolsRaspberry PiTutorials/DIY

Mozilla WebThings Gateway | Getting Started WebThings Gateway for Raspberry Pi

Mozilla WebThings is Mozilla’s open source implementation of the Web of Things, including the WebThings Gateway and the WebThings framework. The Mozilla IoT team’s mission is to create a Web of Things implementation which embodies those values and helps drive IoT standards for security, privacy and interoperability.

Mozilla WebThings is an open platform for monitoring and controlling devices over the web, including:

  • WebThings Gateway –  WebThings Gateway is a software distribution for smart home gateways which allows users to directly monitor and control their smart home over the web, without a middleman.  It provides a web-based user interface to monitor and control smart home devices, a rules engine to automate them and an add-ons system to extend the gateway with support for a wide range of existing smart home devices. Now Mozilla WebThing Gateway available for Raspberry PI, Linux, Docker.
  • WebThings Framework – WebThings Framework is a collection of re-usable software components to help developers build their own web things which directly expose the Web Thing API. This means they can be discovered by a Web of Things gateway or client, which can then automatically detect the device’s capabilities and monitor and control it over the web. It includes implementations in a range of programming languages including Node.js, Python, Java, Rust and C++ (for Arduino). You can learn more about Mozilla WebThings in online documentation.

Getting Started WebThings Gateway for Raspberry Pi

We need a Raspberry Pi Board with  Micro SD card for this tutorial. Follow steps given below :

1. Download Image from the Mozilla IoT website.

2. Flash Image using Etcher.

  • Open Etcher
  • Insert your SD card into an SD card reader attached to your computer
  • Select the downloaded image as the source file
  • Select your SD card as the target
  • Click “Flash!”

3. Boot Raspberry Pi –

  • Insert the flashed microSD card into your RPi Boards
  • Plug in any USB dongles (The Raspberry Pi 3 comes with Wi-Fi and Bluetooth radios. The USB dongles are needed if you want to support other smart home protocols like Zigbee and Z-Wave.)
  • Connect the power supply to boot the Pi
  • Wait a few minutes for the software to boot

4. Connect Wi-Fi – When the gateway starts up it will create a Wi-Fi hotspot called “WebThings Gateway XXXX” (where XXXX are four digits from your Raspberry Pi’s MAC address). Use Your PC or smartphone to scan for and connect to that wireless network. Now A captive portal page will appear, showing nearby all Wi-Fi networks. Select the desired network and enter the password when prompted. The “Connecting to WiFi…” page will automatically disappear.

Remember –

  • If you are connected to the “WebThings Gateway XXXX” Wi-Fi network but you don’t see the welcome screen, you can try typing http://192.168.2.1 into your web browser’s address bar to manually navigate to the page.
  • As an alternative to Wi-Fi, you can connect the Raspberry Pi to your home network using an Ethernet cable and it will attempt to automatically get an IP address from your router. You can then start first time setup by typing “http://gateway.local” into your web browser.
  • If you move the gateway to another location and it can no longer access your home network, it will revert to access point mode so you can connect to it and re-configure a different network.

5. Choose Subdomain – After you’ve connected the RPi board to your WLAN, you should ensure that your PC/tab/smartphone is connected to the same Wi-Fi network and then navigate to http://gateway.local in your web browser.

Now you can get the option to register a free subdomain to safely access your gateway over the Internet using a secure tunnelling service provided by Mozilla.

Enter your choice of subdomain and an email address in case you need to retrieve your subdomain later to re-install on a new gateway. Click “Create” and wait a few moments for the subdomain registration to complete. Try loading your subdomain on your smartphone or computer by loading https://SUBDOMAIN.mozilla-iot.org (where ‘SUBDOMAIN’ is the subdomain name you’ve chosen).

Remember:

  • You can choose to skip this step (either to only use the gateway locally on your home network or manually configure DNS yourself), but note that currently if you do skip this step you’ll have to re-flash the gateway in order to register a subdomain.
  • If http://gateway.local fails to load (e.g. on Android or Windows) you can look up the IP address of the gateway on your home router and use that instead (look for a hostname of “gateway” or a MAC address starting with “b8:27:eb”.
  • If neither http://gateway.local or http:// will load in your browser, check to make sure your computer is definitely connected to the same Wi-Fi network you connected the gateway to.
  • If you have previously registered a subdomain you want to re-use, enter the subdomain and the email address you used to register it and follow the on-screen instructions to re-claim it.

6. Create User Account – After registering your subdomain you should be automatically redirected to the next step of the setup process, which is to create your first user account on the gateway. This is how you’ll access the gateway to discover, add, monitor and manage all your connected devices. Enter your name, email address and a password then click “Next”. You can create additional user accounts later.

You should then be redirected to an empty “Things” screen of the gateway where you can start to add devices.

You can visit WebThings Gateway User Guide to learn how to use your gateway including adding and managing smart devices, creating rules to automate your home, using logging to track data from your devices, and more.

Source : Moxilla Webthings


Recommended : https://onionlinux.com/ansible-infrastructure-as-a-codeiaac/

I hope you like this post. Do you have any questions? Leave a comment down below!

Thanks for reading. If you like this post probably you might like my next ones, so please support me by subscribing my blog

Harshvardhan Mishra

Hi, I'm Harshvardhan Mishra. Tech enthusiast and IT professional with a B.Tech in IT, PG Diploma in IoT from CDAC, and 6 years of industry experience. Founder of HVM Smart Solutions, blending technology for real-world solutions. As a passionate technical author, I simplify complex concepts for diverse audiences. Let's connect and explore the tech world together! If you want to help support me on my journey, consider sharing my articles, or Buy me a Coffee! Thank you for reading my blog! Happy learning! Linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *