WebioOP: the equivalent of WebioPi on Raspberry Pi for Orange Pi

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.

Install flask

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

Then flask

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

Installing webioOP

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

http://192.168.1.79:8000

And now you can control the GPIO from this small web interface.

orangepi armbian webioop wiringop wiringpi

Subscribe to the weekly newsletter

No spam and no other use will be made of your email. You can unsubscribe anytime.

We will be happy to hear your thoughts

Leave a Reply

DIY Projects
%d bloggers like this: