Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
123Next
Return to list New
View: 10474|Reply: 22

webioOP (the defective clone of webiopi)

[Copy link]

10

Threads

220

Posts

2000

Credits

Gold member

Rank: 6Rank: 6

Credits
2000
Post time 2016-6-13 21:22:39 | Show all posts |Read mode
Edited by nopnop2002 at 2016-7-12 02:56

I have developed webioOP (the defective clone of webiopi).
It can control GPIO via web browser.

1.Install flask with this page.
http://mattrichardson.com/Raspberry-Pi-Flask/

2.Install WiringPi-Python-OP Library from here.
https://github.com/lanefu/WiringPi-Python-OP

3.Download webioOP.tar and put it in your OPI.
cd $HOME/flask
tar xvf webioOP.tar

These files is made.
$HOME/flask/webioOP.py
$HOME/flask/templates/webioOP.html
$HOME/flask/templates/webioOP.html.std
$HOME/flask/templates/webioOP.html.btn
$HOME/flask/static/style.css

4.Start Python.
$cd $HOME/flask
$sudo python ./webioOP.py

5.Start browser by a different PC.
and Put it in an address bar.
http://OrangePi'sIP/


The following page shows.
You can change the form design.
cd $HOME/flask/templates/
cp webioOP.html.btn webioOP.html

When editing style.css, you can change it to the favorite design.








This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x

10

Threads

220

Posts

2000

Credits

Gold member

Rank: 6Rank: 6

Credits
2000
 Author| Post time 2017-10-11 06:23:56 | Show all posts
@alexp1

$ sudo apt-get install python-dev python-setuptools swig
$ cd WiringPi-Python-OP
$ swig2.0 -python wiringpi.i
$ sudo python setup.py install
$ cd tests
$ sudo python test.py

0

Threads

9

Posts

62

Credits

Registered member

Rank: 2

Credits
62
Post time 2016-7-11 15:27:46 | Show all posts
Thank you for the nice tool. But your  link for wiringpi-python-ob is wrong or have i made a mistake.  I use  https://github.com/lanefu/WiringPi-Python-OP and everythink work.

10

Threads

220

Posts

2000

Credits

Gold member

Rank: 6Rank: 6

Credits
2000
 Author| Post time 2016-7-11 20:45:56 | Show all posts
rom3 replied at 2016-7-11 15:27
Thank you for the nice tool. But your  link for wiringpi-python-ob is wrong or have i made a mistake ...

Thank you very much for your comment.

1

Threads

7

Posts

31

Credits

Novice

Rank: 1

Credits
31
Post time 2016-9-6 05:29:02 | Show all posts
thank you so much for your sharing this wonderful project ...

0

Threads

1

Posts

6

Credits

Novice

Rank: 1

Credits
6
Post time 2016-9-21 05:12:35 | Show all posts
thanks a lot ! working like a charm

1

Threads

14

Posts

84

Credits

Registered member

Rank: 2

Credits
84
Post time 2016-10-15 02:46:51 | Show all posts
I get this error when I run the script
  1. Traceback (most recent call last):
  2.   File "webioOP.py", line 3, in <module>
  3.     from flask import Flask, render_template, request
  4.   File "/usr/local/lib/python2.7/dist-packages/flask/__init__.py", line 21, in <module>
  5.     from .app import Flask, Request, Response
  6.   File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 27, in <module>
  7.     from . import json, cli
  8.   File "/usr/local/lib/python2.7/dist-packages/flask/json.py", line 23, in <module>
  9.     from itsdangerous import simplejson as _json
  10.   File "/usr/local/lib/python2.7/dist-packages/itsdangerous.py", line 40, in <module>
  11.     import json
  12.   File "/usr/local/lib/python2.7/dist-packages/flask/json.py", line 14, in <module>
  13.     from .globals import current_app, request
  14. ValueError: Attempted relative import in non-package
Copy the Code

What am I doing wrong?

10

Threads

220

Posts

2000

Credits

Gold member

Rank: 6Rank: 6

Credits
2000
 Author| Post time 2016-10-15 22:39:42 | Show all posts
oggstar replied at 2016-10-15 02:46
I get this error when I run the script

What am I doing wrong?

I think that flask not installed.


1

Threads

14

Posts

84

Credits

Registered member

Rank: 2

Credits
84
Post time 2016-10-16 07:35:48 | Show all posts
No, I was being stupid. It works great now

0

Threads

2

Posts

14

Credits

Novice

Rank: 1

Credits
14
Post time 2016-12-5 08:58:33 From the mobile phone | Show all posts
Excelente tutorial, Alguien sabrá por qué al momento de correr flask me manda error diciendo que no puede importar flask from Flask?

0

Threads

2

Posts

14

Credits

Novice

Rank: 1

Credits
14
Post time 2016-12-6 03:00:49 | Show all posts
luferagon replied at 2016-12-5 08:58
Excelente tutorial, Alguien sabrá por qué al momento de correr flask me manda error diciendo que n ...

my problem was resolved changing the distribution for lubuntu

You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2019-11-17 07:47 GMT+8 , Processed in 0.046305 second(s), 24 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list