There have for years been an image for Raspberry Pi available (and still is) with IoT Open software pre installed. But there have been requests about how to run the software on a vanilla Raspberry Pi OS.
So, here is a guide on how to to just that:
Install the standard image either via downloading a relevant
image from here or flash via rpi-imager (recommended way, due to ease of pre-configuration etc.). Both ways requires a 64-bit, preferrably the Lite version.
The recommended image with rpi-imager is located
Raspberry Pi OS (other) -> Raspberry Pi Os Lite (64-bit)
Leave the "Raspberry Pi Device" option empty / No filtering if you have a rpi3, otherwise the recommended option becomes unavailable.
Login to the Raspberry Pi with ssh
Update the system to the latest state
sudo apt update && sudo apt upgrade -y
Download and trust IoT Open gpg key
# Download and trust our key
curl https://pkg.iotopen.se/conf/iotopen.gpg.key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/iotopen.gpg
Add IoT Open repository
# Find current release codename
RELEASE=$(cat /etc/os-release | grep VERSION_CODENAME | cut -d '=' -f 2)
# List our repo for the release
echo "deb [arch=arm64 signed-by=/etc/apt/trusted.gpg.d/iotopen.gpg] http://pkg.iotopen.se/apt/ RELEASE main" | sed "s/RELEASE/${RELEASE}/g" | sudo tee /etc/apt/sources.list.d/iotopen.list
# Update lists
sudo apt update
Install our edge software
# Install our edge runtime:
sudo apt install -y mosquitto mosquitto-clients iotopen-rt iotopen-edge scheduler iotopen-verify
# Optionally install the zwave daemon
# sudo apt install zwaved
Create or pick an installation for the edge-client and create edge credentials by navigating to settings -> Edge-client
and click create new credentials
.
This will generate a set of settings that should be put in the /etc/iot-open/iotopen.json
file on the raspberry-pi similar to this:
{
"api": "https://lynx.iotopen.se",
"client_id": 45,
"installation_id": 45,
"mqtt_broker": "lynx.iotopen.se:8883",
"mqtt_client_id": "edge-45",
"mqtt_password": "b7f61ff2235f6568e463b75e04ff00bc",
"mqtt_username": "box:45",
"timezone": "Europe/Stockholm"
}
Verify configuration with sudo iotopen-verify
Output should be similar to
iotopen-verify[4365]: Git hash:2076315 and tag:
iotopen-verify[4365]: verified
Optionally open the broker to the local network by configuring mosquitto by appending
listener 1883
to /etc/mosquitto/mosquitto.conf
and then run sudo systemctl restart mosquitto
.
!!! Note that at the time of writing, the default version of mosquitto is 2.0.11 that, by default listens to [::]:1883
if ipv6 is present aswell.
To disable listening to any ipv6 addresses; add listener 1883 127.0.0.1
to /etc/mosquitto/mosquitto.conf
instead.
You can check which ports are open by running sudo ss -lntp | grep mosq
or sudo netstat -lntp | grep mosq
Reboot
sudo reboot
And wait for the system to come online.
Navigate the browser to the MQTT page for the installation and check that the <client-id>/box/event/status
shows up.