Revolution Pi is an open, modular, and durable industrial PC based on the established Raspberry Pi while meeting the EN61131-2 standard. Equipped with the Raspberry Pi Compute Module, the RevPi Core base can be expanded seamlessly using appropriate I/O modules and fieldbus gateways for energy management, process monitoring, machine health and more.
The Rev Pi Core is the foundation to any application and depending on your I/O requirements expansion modules such as RevPi DIO, RevPi AIO, RevPi Gates can be attached as digital, analog, or gateway modules.
In this tutorial we detail the integration of a the RevPI DIO to visualize and control output signals to your machines or applications with Ubidots. The RevPi DIO digital I/O module comes with 14 digital inputs and 14 outputs, PWM (puls width modulation), and counter inputs. For a detailed list of functionalities for the RevPI DIO, check out the Revolution Pi product brochure.
As per any new device setup, we recommend becoming familiar with the RevPi Core + RevPi DIO official quick start guide by Revolution Pi. Then be sure your to assemble the RevPi Core + DIO correctly referencing the below articles for additional details, as needed.
Once your RevPi Core + RevPi DIO are configured, powered correctly, and connected to the Internet, we can continue with Firmware uploads.
1. First we must have access to the inputs and outputs of the Revolution Pi. The "python3-revpimodio” module provides all access to the IOs of the Revolution Pis, and can be programmed very easy with Python3.
Based on the image installed in your RevPi Core reference this guide to make the installation properly. If you have the Jessie Image on your core, simply install the module from the Kunbus repository running the commands below in the RevPi Terminal:
Update system packages:
sudo apt-get update
sudo apt-get install python3-revpimodio2
Update Distribution (all):
sudo apt-get dist-upgrade
2. Next, install the requests module for python3 by running the command below in the RevPi Core terminal:
sudo apt-get install python3-requests
3. Once each of the commands above have finished, verify everything as accurate by opening Python3 into your RevPi Core terminal and importing the module previously installed.
Open the Python3 by running the command below into the RevPi Core terminal:
Once you have access to Python3, import the modules ''revpimodio2" and "requests" as is shown below:
import revpimodio2 import requests
If receive and error messages after importing the module, verify the issue shown and try again.