WebIOPi is an absolutely great freeware web interface for the Raspberry Pi, a tribute to the developers!
This let Raspberry Pis GPIO to be controlled with just a few lines of code over internet with python programming.
When you are reading this, it is not the official version of webiopi as it has been discontinued before rpi3.
But, patches provided by developers still works on Raspberry pi 4.
Before getting into WebIOPi we need to provide access for Remote GPIO control via Raspberry Pi configuration.
for doing it, run
sudo raspi-config -> Interfacing Options -> Remote GPIO
The following commands will install WebIOPi on raspberry pi 4 in just 10 minutes.
$ wget http://sourceforge.net/projects/webiopi/files/WebIOPi-0.7.1.tar.gz
$ tar xvzf WebIOPi-0.7.1.tar.gz
$ cd WebIOPi-0.7.1
$ wget https://raw.githubusercontent.com/doublebind/raspi/master/webiopi-pi2bplus.patch
$ patch -p1 -i webiopi-pi2bplus.patch
$ sudo ./setup.sh
To start in the background, run sudo /etc/init.d/webiopi start
To start on boot, run sudo update-rc.d webiopi defaults
As the process gets completed, now you can get into WebIOpi page via https://raspi-ip:8000 inside your network.
Username : webiopi
Password: raspberry
You will end up check the GPIO remotely, also it can be used as API for GPIO in programming.
For more see here: http://webiopi.trouch.com/
Getting th following error:
ReplyDeleteOct 23 21:00:12 raspberrypi python3[1198]: self.serveFile(relativePath)
Oct 23 21:00:12 raspberrypi python3[1198]: File "/usr/local/lib/python3.7/dist-packages/WebIOPi-0.7.1-py3.7-linux-armv7l.egg/webiopi/protocols/http.py", li⦠in serveFile
Oct 23 21:00:12 raspberrypi python3[1198]: if not (realPath.startswith(os.getcwd())
Oct 23 21:00:12 raspberrypi python3[1198]: FileNotFoundError: [Errno 2] No such file or directory
Oct 23 21:00:12 raspberrypi python3[1198]: During handling of the above exception, another exception occurred:
Oct 23 21:00:12 raspberrypi python3[1198]: Traceback (most recent call last):
Oct 23 21:00:12 raspberrypi python3[1198]: File "/usr/lib/python3.7/socketserver.py", line 316, in _handle_request_noblock
Oct 23 21:00:12 raspberrypi python3[1198]: self.process_request(request, client_address)
Oct 23 21:00:12 raspberrypi python3[1198]: File "/usr/lib/python3.7/socketserver.py", line 347, in process_request
Oct 23 21:00:12 raspberrypi python3[1198]: self.finish_request(request, client_address)
H
your raspberry -? 3 or 4
Delete4
DeleteI dont see the teskt IN/OUT on the buttons and the buttons dont switch the outputs on the PI4
ReplyDeleteHi, am having some issue with my PI4, le me explain, ive bought a RPi Relay module (3 module)
ReplyDeleteHere are what am having (Have tried usuing python 2 & 3) and having the same issue:
[email protected]:~ $ sudo python3 -m webiopi 8000
2020-11-29 12:07:24 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.7
2020-11-29 12:07:24 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2020-11-29 12:07:24 - WebIOPi - WARNING - Access unprotected
2020-11-29 12:07:24 - WebIOPi - INFO - HTTP Server binded on http://192.168.1.19:8000/
2020-11-29 12:07:24 - WebIOPi - INFO - CoAP Server binded on coap://192.168.1.19:5683/
2020-11-29 12:07:24 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST)
----------------------------------------
Exception happened during processing of request from ('::ffff:192.168.1.19', 54512, 0, 0)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/WebIOPi-0.7.1-py3.7-linux-armv7l.egg/webiopi/protocols/http.py", line 248, in processRequest
result = self.server.handler.do_GET(relativePath, compact)
File "/usr/local/lib/python3.7/dist-packages/WebIOPi-0.7.1-py3.7-linux-armv7l.egg/webiopi/protocols/rest.py", line 147, in do_GET
return (200, self.getJSON(compact), M_JSON)
File "/usr/local/lib/python3.7/dist-packages/WebIOPi-0.7.1-py3.7-linux-armv7l.egg/webiopi/protocols/rest.py", line 245, in getJSON
gpios[gpio][f] = GPIO.getFunctionString(gpio)
NameError: name 'GPIO' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.7/socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.7/socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.7/socketserver.py", line 720, in __init__
self.handle()
File "/usr/lib/python3.7/http/server.py", line 426, in handle
self.handle_one_request()
File "/usr/lib/python3.7/http/server.py", line 414, in handle_one_request
method()
File "/usr/local/lib/python3.7/dist-packages/WebIOPi-0.7.1-py3.7-linux-armv7l.egg/webiopi/protocols/http.py", line 277, in do_GET
self.processRequest()
File "/usr/local/lib/python3.7/dist-packages/WebIOPi-0.7.1-py3.7-linux-armv7l.egg/webiopi/protocols/http.py", line 268, in processRequest
except (GPIO.InvalidDirectionException, GPIO.InvalidChannelException, GPIO.SetupException) as e:
NameError: name 'GPIO' is not defined
enable GPIO in raspi-config
Deleteits enable, and am having the same issue :
Delete[email protected]:~ $ sudo python3 -m webiopi 8000
2020-11-30 11:49:01 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.7
2020-11-30 11:49:01 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2020-11-30 11:49:01 - WebIOPi - WARNING - Access unprotected
2020-11-30 11:49:01 - WebIOPi - INFO - HTTP Server binded on http://192.168.1.19:8000/
2020-11-30 11:49:01 - WebIOPi - INFO - CoAP Server binded on coap://192.168.1.19:5683/
2020-11-30 11:49:01 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST)
----------------------------------------
Exception happened during processing of request from ('::ffff:192.168.1.32', 54257, 0, 0)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/WebIOPi-0.7.1-py3.7-linux-armv7l.egg/webiopi/protocols/http.py", line 249, in processRequest
result = self.server.handler.do_GET(relativePath, compact)
File "/usr/local/lib/python3.7/dist-packages/WebIOPi-0.7.1-py3.7-linux-armv7l.egg/webiopi/protocols/rest.py", line 147, in do_GET
return (200, self.getJSON(compact), M_JSON)
File "/usr/local/lib/python3.7/dist-packages/WebIOPi-0.7.1-py3.7-linux-armv7l.egg/webiopi/protocols/rest.py", line 245, in getJSON
gpios[gpio][f] = GPIO.getFunctionString(gpio)
NameError: name 'GPIO' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.7/socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.7/socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.7/socketserver.py", line 720, in __init__
self.handle()
File "/usr/lib/python3.7/http/server.py", line 426, in handle
self.handle_one_request()
File "/usr/lib/python3.7/http/server.py", line 414, in handle_one_request
method()
File "/usr/local/lib/python3.7/dist-packages/WebIOPi-0.7.1-py3.7-linux-armv7l.egg/webiopi/protocols/http.py", line 278, in do_GET
self.processRequest()
File "/usr/local/lib/python3.7/dist-packages/WebIOPi-0.7.1-py3.7-linux-armv7l.egg/webiopi/protocols/http.py", line 269, in processRequest
except (GPIO.InvalidDirectionException, GPIO.InvalidChannelException, GPIO.SetupException) as e:
NameError: name 'GPIO' is not defined
Thanks for your help
ReplyDelete