Application deployment on a real board
Real board deployment
Throughout this demo, we will use Raspberry Pi board.
Refer to the main documentation for the installation of a redpesk image on a Raspberry Pi board.
Installing the packages
Before installing packages of your application, add its repository on the virtual machine. To do so, use the following command from your host system:
rp-cli projects get industrial-demo-project --repository
Then, in the virtual machine, use the curl
command given (according to the redpesk distribution running in your VM):
curl -fsSL [...] | bash
You can now install the required packages. The package anenometer-industrial-demo
installs all the other packages as dependencies, and puts the right config files in the right directories. It also installs a configuration file to be used with the Modbus simulator. The package modbus-binding-simulation
would be required to use the Modbus simulator.
sudo dnf install anemometer-industrial-demo modbus-binding-simulation
Starting the demonstration
We can check first that everything works in simulation mode. Similarly to what we have done in the previous section, we can now launch the Modbus simulator in a terminal:
modbus-simulation -a 127.0.0.1 -p 5003
And in another terminal, use the anemometer_simu.json
configuration:
CONTROL_CONFIG_PATH=/usr/redpesk/redis-tsdb-binding/etc/ /usr/bin/anemometer_industrial_demo.py -c /etc/gateway/anemometer_simu.json
If this still works, we can now try with the real hardware with the other configuration file:
CONTROL_CONFIG_PATH=/usr/redpesk/redis-tsdb-binding/etc/ /usr/bin/anemometer_industrial_demo.py -c /etc/gateway/anemometer.json
Note that the provided configuration file and Python script only cover the conversion from a sine and cosine value to the angle of the wind direction. The part that computes the wind speed out of the rotation counter is left to the reader as an exercise.