Build an IoT hub with Minim Labs and a Raspberry Pi 3 [Guide]
At Minim, we think everyone should have the tools they need to monitor their home wireless network. We just launched Minim Labs, giving everyone the ability to install the Minim agent, known as Unum, on their routers and signup for platform access. Usually, this implies running some variation of OpenWrt on your router, but all you need is a Raspberry Pi and a Minim Labs account (free)!
A Raspberry Pi 3 is especially useful for this case because it’s fairly inexpensive and has a built-in wireless adapter that can be used as a wireless access point for all of your IoT devices. With the Unum agent running on the Pi and the Pi acting as a wireless access point, you can manage and monitor your IoT devices in just a few steps. (Note: You can also run Unum in a docker container if you don’t have a spare Raspberry Pi.)
The hardware configuration will assume that the Pi is connected to Internet via ethernet and that you will connect your IoT devices to the Pi’s wireless.
Step by step instructions: Setup your Raspberry Pi with Minim Labs
Tested with Pi 2 Model B+ and Pi 3 Model B+
0. Prerequisites:
- Raspberry Pi 3 B+ running the latest version of Raspbian Stretch. It might be beneficial to reinstall the operating system if you are running an old version. Head over to the Raspberry Pi website to download Raspbian. The Raspbian Stretch with Desktop version will work fine. Then look here for installation instructions.
- Minim Labs account - If you already have a Minim account, you will need to logout and create a new Minim Labs account via my.minim.co/labs with a different email address from your former account.
1. Install dependencies
First, we'll need to check for updates and install the right dependencies. Use the commands below, and note that installing dependencies may take a few minutes.
# check for updates
sudo apt update
# install dependencies; this may take a few minutes
sudo apt install -y bridge-utils dnsmasq dnsutils gawk hostapd libjansson4
2. Download unum-sdk package
Next, you'll download the unum-sdk
from Minim's hosting, using the following command:
curl -L https://github.com/MinimSecure/unum-sdk/releases/download/v2018.1.0/unum-sdk_2018.1.0_armhf.deb -o unum-sdk.deb
3. Install Unum
Now that you've downloaded the Unum package, it's time to install it:
sudo dpkg -i unum-sdk.deb
4. Generate your Minim MAC address
Minim authenticates and registers your Raspberry Pi by assigning you a MAC Address. To generate a MAC Address:
- Login to the Minim Labs portal, my.minim.co/labs (If you are brought back to the Minim Labs signup page, scroll down and select Already Registered? to be directed to the login page.)
- Select Provision New Unum
- Select Auto-generate MAC address and Submit.
- You can now find the newly-generated MAC Address on the Device Provisioning dashboard. Note this for Step 5.
5. Configure Unum
Configure Unum for the Raspberry Pi: Run the minim-config
tool and pick the default for configuration options. As a short-cut, you can simply press enter with a blank value to use the default value, which is shown between square brackets [] for each prompt. There are a few unique entries you will also need to input:
- SSID - This is your WiFi network name of choice
- Passphrase - This must be at least 8 characters
- MAC Address - Use the MAC Address from Step 4
minim-config
Troubleshooting
We start a handful of services to make the Raspberry Pi to act as an access point. To view the status for them you can try some of the commands below.
# The hostapd service is required to actually turn the Pi into an access point sudo service hostapd status # The dnsmasq service is used to provide IP addresses to connected devices sudo service dnsmasq status # And finally to check the status of the unum-sdk service sudo service unum status
For more troubleshooting, visit the Getting Started Guide for Raspberry Pi Wiki page. To submit a ticket for help, visit the Minim Labs GitHub page.