1

我从网上下载了 WebIOPi-0.6.0.tar.gz 并将其解压缩并运行 setup.sh。安装后运行sudo webiopi时显示这个..

ralph@ralph-desktop:~$ sudo webiopi
Traceback (most recent call last): 
  File "/usr/lib/python3.5/runpy.py", line 174, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.5/runpy.py", line 133, in _get_module_details return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.5/runpy.py", line 109, in _get_module_details __import__(pkg_name)
  File "/usr/local/lib/python3.5/dist-packages/WebIOPi-0.6.0-py3.5-linux-armv7l.egg/webiopi/__init__.py", line 17, in <module>
  import _webiopi.GPIO as GPIO
_webiopi.GPIO.SetupException: This module can only be run on a Raspberry Pi!

似乎有什么问题?我试图重新安装它,但问题仍然存在。

已编辑

我通过@Codino 运行代码并得到了这个结果。

ralph@ralph-desktop:~/WebIOPi-0.7.1$ sudo webiopi
2016-07-21 03:11:12 - WebIOPi - INFO - Starting WebIOPi/0.7.22/Python3.5
2016-07-21 03:11:12 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2016-07-21 03:11:12 - WebIOPi - INFO - DigitalActuator - LightSwitch mapped to REST API /devices/IJFottwtJsEzH8wF
2016-07-21 03:11:12 - WebIOPi - WARNING - Access unprotected
2016-07-21 03:11:12 - WebIOPi - ERROR - [Errno 98] Address already in use
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/WebIOPi-0.7.22-py3.5-linux-armv7l.egg/webiopi/protocols/http.py", line 45, in __init__
BaseHTTPServer.HTTPServer.__init__(self, ("", port), HTTPHandler)
  File "/usr/lib/python3.5/socketserver.py", line 440, in __init__
self.server_bind()
  File "/usr/lib/python3.5/http/server.py", line 138, in server_bind
socketserver.TCPServer.server_bind(self)
  File "/usr/lib/python3.5/socketserver.py", line 454, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/WebIOPi-0.7.22-py3.5-linux-armv7l.egg/webiopi/__main__.py", line 77, in <module>
main(sys.argv)
  File "/usr/local/lib/python3.5/dist-packages/WebIOPi-0.7.22-py3.5-linux-armv7l.egg/webiopi/__main__.py", line 70, in main
server = Server(port=port, configfile=configfile, scriptfile=scriptfile)
  File "/usr/local/lib/python3.5/dist-packages/WebIOPi-0.7.22-py3.5-linux-armv7l.egg/webiopi/server/__init__.py", line 120, in __init__
self.http_server = http.HTTPServer(self.host, http_port, self.restHandler, context, docroot, index, auth, realm)
  File "/usr/local/lib/python3.5/dist-packages/WebIOPi-0.7.22-py3.5-linux-armv7l.egg/webiopi/protocols/http.py", line 48, in __init__
BaseHTTPServer.HTTPServer.__init__(self, ("", port), HTTPHandler)
  File "/usr/lib/python3.5/socketserver.py", line 440, in __init__
self.server_bind()
  File "/usr/lib/python3.5/http/server.py", line 138, in server_bind
socketserver.TCPServer.server_bind(self)
  File "/usr/lib/python3.5/socketserver.py", line 454, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
4

1 回答 1

0

因为你使用的版本不兼容。试试这个

$ 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
于 2016-07-20T05:48:04.073 回答