How to Connect the Revolution Pi with Cumulocity Using Thin-edge.io
Introduction
This guide provides comprehensive instructions for connecting a Revolution Pi to the Cumulocity IoT platform using Thin-edge.io. It covers installation, configuration, and data transmission.
Setting Up Your Revolution Pi
Wiring & Power Connection
Use either a 24V DC DIN rail power supply or, for desktop use, a 24V DC plug-in power adapter to power the Revolution Pi. A typical power adapter should have at least 30W. Use a barrel jack pigtail connector with open wire ends to connect it to the RevPi.
Establishing Network Connection
After powering up, connect the Revolution Pi to your network using an Ethernet cable. Access the device by navigating to http://revpi1234.local
in a web browser, where 1234 represents the serial number found on the front of the Revolution Pi.
Setting Up SSH Access
For macOS Users
- Open the Terminal application (Applications > Utilities > Terminal).
- Type the following command and press Enter:
Replace
ssh pi@revpi<SERIAL-NUMBER>.local
<SERIAL-NUMBER>
with the actual serial number of your device. - Enter the password from the sticker located on the right side of your device.
For Windows 7/10/11 Users
Windows users need an SSH client.
-
For Windows 10/11:
- Open Command Prompt or PowerShell.
- Type the following command and press Enter:
ssh pi@revpi<SERIAL-NUMBER>.local
-
For Windows 7:
- Download and install PuTTY from https://www.putty.org/.
- Enter
revpi<SERIAL-NUMBER>.local
in the 'Host Name' field. - Set the connection type to SSH and click 'Open'.
In both cases, replace <SERIAL-NUMBER>
with your device's serial number. When prompted, enter the password from the sticker on the right side of your device.
System Updates and Installing Additional Packages
Once logged in via SSH, update and upgrade your system:
sudo apt update && sudo apt upgrade && sudo apt dist-upgrade
Install the necessary packages for No-Code OPC-UA and MQTT support:
sudo apt install mqtt-revpi-client opcua-revpi-server
Installing and Configuring the Cumulocity Client
Download and Install the Thin-edge.io Client
curl -fsSL https://thin-edge.io/install.sh | sh -s
Configuring Thin-edge.io
Configure the Cumulocity IoT tenant URL:
sudo tedge config set c8y.url your-tenant.cumulocity.com
Replace your-tenant.cumulocity.com
with your actual tenant link without the https
.
Creating and Uploading Certificates
Create and upload a certificate for each device:
sudo tedge cert create --device-id revpi<SERIAL-NUMBER>
Replace <SERIAL-NUMBER>
with your device's serial number.
sudo tedge cert upload c8y --user "your_username@example.com"
Starting the Thin-edge.io Client
Start the Thin-edge client to connect to Cumulocity:
sudo tedge connect c8y
Testing - Sending Measurement Values
Send a test measurement to Cumulocity:
tedge mqtt pub 'c8y/s/us' '211,100'
Verifying Data Reception
Log into your Cumulocity account and navigate to the 'Device Management' section to view the 'Measurements' tab for your device.
Reboot your Revolution Pi
sudo reboot
Sending RevPi's IO Data to the Thin-edge Connector
Accessing RevPi's Admin Interface
Navigate to the RevPi's web interface:
http://revpi<serial>.local
Configure IOs and Fieldbus Data on the Revolution Pi Using Pictory
- Log into the admin web interface.
- Launch Pictory graphical editor.
- Drag and drop devices such as Analog IO (AIO) and Digital IO (DIO).
- Configure their settings, and ensure the 'Export' checkbox is checked if the data should be sent to Cumulocity.
Send Connected Values to the Thin-edge Client
Option 1: No-Code with Pictory
- Drag the virtual device 'MQTT' into your Revolution Pi diagram in Pictory.
- Set the server to
localhost
. - Save the configurations and reset the driver.
Option 2: NodeRed
Use NodeRed to send values to Thin-edge's MQTT broker. Configure an MQTT node to localhost
and send values as JSON.
Option 3: Codesys
Install and use Codesys to program and send measurements using its MQTT client.
Option 4: Python
Use the RevPiModIO2
library to interact with Revolution Pi IOs and send data to the Thin-edge MQTT broker.
Activate Cumulocity Device Management Features
The Revolution Pi supports various Cumulocity features, including:
- Measurements
- Warnings / Alarms
- Configuration Management
- Software Management
- Remote Access via SSH / VNC
Refer to the Cumulocity documentation for setup instructions.