Enabling Data Collection using OpenRemote

Your Smart Mailbox IoT project has now a real IoT sensor (PIR motion); a script programmed to print messages when motion is detected; and context-related information for both the device and the physical mailbox entity. Information related to the mailbox location, its number, and more, are now modeled using JSON-LD.

While such data is rich enough in terms of context, it is not enough to build the Smart Mailbox application. In fact, technologies for exchange, data collection and data management are required.

During this lab you will use the OpenRemote platform to enable data collection and management of your Smart Mailbox IoT project.

OpenRemote

OpenRemote is a user-friendly open source IoT platform. Developers can build a complete IoT device management solution including: device management and auto provisioning, customisation of asset types, automation via when-then, flow, javascript and groovy rules, data analytics, connectivity via several protocol agents and manager APIs.

More details about the OpenRemote platform can be found at OpenRemote.

Installation – Step-by-step Installation Guide

Step 1: Update and Upgrade Raspbian OS

Before installing any new software, it’s always a good practice to update and upgrade your existing packages:

	sudo apt update
	sudo apt upgrade -y

Step 2: Install Docker on Raspberry Pi

Docker provides an installation script that simplifies the process of getting Docker on Raspberry Pi.

	# Download and run Docker installation script
	curl -fsSL https://get.docker.com -o get-docker.sh
	sudo sh get-docker.sh

	# Add 'pi' user to the 'docker' group
	sudo usermod -aG docker pi

You can verify that Docker was installed correctly:

	docker --version

Step 3: Install Docker Compose

	sudo apt install docker-compose
	docker-compose –version

Step 4: Download OpenRemote Stack

Download the docker compose file: OpenRemote Stack (Right click ‘Save link as…’)

Step 5: Run Open Remote

In a terminal cd to where you just saved the compose file and then run:

    sudo docker-compose pull
    sudo docker-compose -p openremote up

If all goes well then you should now be able to access the OpenRemote Manager UI at https://localhost. You will need to accept the self-signed certificate, see here for details how to do this in Chrome (similar for other browsers).

Step 6: Login credentials

  • Username: admin
  • Password: secret

Create the Smart Mailbox Asset

Use the Manager UI to create the smart mailbox asset. Note that this asset has to be modeled using similar data and attributes to the ones used to define the “Smart Mailbox” JSON-LD object.

In particular:

  • Device using the JSON-LD reference ID
  • Type
  • Location (building, room) where the mailbox is located
  • ID of the mailbox
  • Smart mailbox status (e.g., new letter)
  • Letter count
  • Add other attributes you find useful

The Manager UI is the dashboard which gives you access to OpenRemote, and allows you to configure, monitor, and control your IoT platform. You can access it at https://localhost for the master realm, or at https://localhost/manager/?realm=yourrealm, for a specific realm.

You can use the guide at https://github.com/openremote/openremote/wiki/User-Guide:-Manager-UI in order to create your asset.

Previous
Next