WebioOP is the equivalent of WebioPi for Orange PI. This project dates from the beginnings of Raspberry Pi. Its objective is to pilot the GPIO of Raspberry Pi from a small web interface. It is even possible to control the GPIO of the Raspberry Pi remotely by exposing the Raspberry on the internet. It is also this project that serves as a basis for piloting the GPIO from the Cayenne application. As usual we must redo the work on Orange Pi to have the equivalent. This time it was nopnop2002 that stuck to it. He explained how to go about the Orange Forum Pi http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=1634&page=1&extra=#pid13613.
Begin by installing Flask, a Python library that allows you to create a web server entirely in Python. The official page of the project can be found here.
We install pip, the package manager for Python
sudo apt-get install python-pip
sudo pip install flask
Install WiringPi and WiringOP
Then install the WiringOP library already presented in this tutorial. The GitHub project can be found here. Local sources are retrieved
cd ~ git clone --recursive https://github.com/lanefu/WiringPi-Python-OP.git cd WiringPi-Python-OP
It is also necessary to install some tools necessary to the compilation of the source code
sudo apt-get install python-dev python-setuptools swig
First, we build the WiringPi library
cd WiringPi sudo ./build
Before linking the 2 libraries together
cd.. swig2.0 -python wiringpi.i
All you have to do is install WiringOP
sudo python setup.py install
All you have to do is install the webioOP project. The source code does not seem to have been published on GitHub, I found it on the site of nopnop2002 (in Japanese).
cd ~/WiringPi-Python-OP wget http://nopnop2002.webcrow.jp/OrangePiPC/flask/webioOP.tar
Decompress the archive
root@orangepilite:~/WiringPi-Python-OP# tar xvf webioOP.tar webioOP.py static/ static/style2.css static/style-std.css static/style.css static/images/ static/images/Button-Turn-On-icon.png static/images/smile-icon.png static/images/box-in-icon.png static/images/Industry-Feed-Out-icon.png static/images/Industry-Feed-In-icon.png static/images/switch-off-icon.png static/images/switch-on-icon.png static/images/box-out-icon.png static/images/Button-Turn-Off-icon.png static/style3.css templates/webioOP.html templates/webioOP.html.btn templates/webioOP.html.icon templates/webioOP.html.std
By default, webioOP starts a web server on port 80. If you already have another server that uses port (a home automation server for example), edit the last lines of the webioOP.py script. For example, the server will be opened on port 8000.
if __name__ == "__main__": if DEBUG == 1: app.run(host='0.0.0.0', port=8000, debug=True) if DEBUG == 0: app.run(host='0.0.0.0', port=8000, debug=False)
Drive the GPIO of the Orange Pi from the web interface of webioOP
Start webioOP by running this command
sudo python webioOP.py
Open a browser on a computer connected to the same local network as Orange Pi and enter the ip address followed by the configured port. for example
And now you can control the GPIO from this small web interface.
- Install Home Assistant (HASS) on an Orange Pi running under Armbian
- IoT development based on Orange Pi, Arduino (Firmata), Nodejs, Blynk and Johnny-Five
- Blynk + Node.js + Johnny-Five: drive a Pan-Tilt PTZ SG90 kit on Orange Pi with an Arduino / Firmata
- Start programming with Node Js and Johnny-Five: IoT and robotics based on Arduino, Raspberry Pi, Orange Pi
- Orange Pi: test of the OPI.GPIO package for Node-Red (node-red-contrib-opi-gpio)
- Orange Pi (Armbian): replace the GPIO by an Arduino/Firmata, Node-RED and Johnny-Five