Interfacing

Webio-lemaker: webiopi library for Banana Pro

7 2052
Hello everyone,
We have hacked the original webiopi library to make it work on Banana Pro. Most the functions can be work well on Banana Pro (except the two special "sequence" and "pluse" for PWM).
You can download it from https://github.com/LeMaker/webio-lemaker :
  1. git clone https://github.com/LeMaker/webio-lemaker
Copy the Code
And follow the INSTALL file under "docs" directory to finish the INSTALL .
The default user/password is webiopi/bananapi .

More information can been see from the LeMaker Github page.

If you encounter the bugs, please post it here.
Nice work Tony!

Can you take a peek to see if you can make a BPi version of servo blaster or some other software PWM driver?

cyryllo  
+
now I wait on Pgpio lib

mikronauts replied at Mon Apr 20, 2015 08:17
Nice work Tony!

Can you take a peek to see if you can make a BPi version of servo blaster or some o ...

I have evaluated the piblaster before, but it is really not a good choice to hack it.

cyryllo replied at Mon Apr 20, 2015 08:33
+
now I wait on Pgpio lib

God... I need to see it

tony_zhang replied at Tue Apr 21, 2015 04:42
I have evaluated the piblaster before, but it is really not a good choice to hack it.

ok, thanks Tony.

serobb  
Hello Tony,

Looks like I have problem to install it on Linux... Its looking for the python dev headers, but I cant install them.
I even tried manually, but the apt say cannot install...

Any idea?

Thanks,
Rob

Karlak  
Edited by Karlak at May 02, 2017 10:56

Hi everyone,
I try to test the example for webiopi on Banana Pro, but it takes me a lot of time searching on the web without finding useful answer or make in it works.

when I start webio by:
  1. sudo webiopi -d -c /etc/webiopi/config
Copy the Code

it seems working (and stopping it also without problem), but when I open the test page on my browser I get the error:
  1. HTTP/1.0 500 Internal Server Error Server: WebIOPi/0.7.0/Python3.4 Date: Mon, 01 May 2017 22:06:20 GMT Content-Type: text/html;charset=utf-8 Connection: close Content-Length: 458
  2. Error response

  3. Error code: 500

  4. Message: Internal Server Error.

  5. Error code explanation: 500 - Server got itself in trouble.
Copy the Code

and from the terminal this errors:
  1. Exception happened during processing of request from ('::ffff:192.168.1.48', 43552, 0, 0)
  2. Traceback (most recent call last):
  3.   File "/usr/lib/python3.4/socketserver.py", line 305, in _handle_request_noblock
  4.     self.process_request(request, client_address)
  5.   File "/usr/lib/python3.4/socketserver.py", line 331, in process_request
  6.     self.finish_request(request, client_address)
  7.   File "/usr/lib/python3.4/socketserver.py", line 344, in finish_request
  8.     self.RequestHandlerClass(request, client_address, self)
  9.   File "/usr/lib/python3.4/socketserver.py", line 673, in __init__
  10.     self.handle()
  11.   File "/usr/lib/python3.4/http/server.py", line 398, in handle
  12.     self.handle_one_request()
  13.   File "/usr/lib/python3.4/http/server.py", line 386, in handle_one_request
  14.     method()
  15.   File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.0-py3.4-linux-armv7l.egg/webiopi/protocols/http.py", line 267, in do_GET
  16.     self.processRequest()
  17.   File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.0-py3.4-linux-armv7l.egg/webiopi/protocols/http.py", line 264, in processRequest
  18.     raise e
  19.   File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.0-py3.4-linux-armv7l.egg/webiopi/protocols/http.py", line 254, in processRequest
  20.     self.serveFile(relativePath)
  21.   File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.0-py3.4-linux-armv7l.egg/webiopi/protocols/http.py", line 203, in serveFile
  22.     self.wfile.write(data)
  23.   File "/usr/lib/python3.4/socket.py", line 394, in write
  24.     return self._sock.send(b)
  25. TypeError: 'str' does not support the buffer interface
Copy the Code

Any help for this errors?

EDIT:

Ok finally I found the solution at least the error disappeared now and I can see the button to switch light in the example without error.
The error come from here
  1. File
  2. "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.0-py3.4-linux-armv7l.egg/webiopi/protocols/http.py",
  3. line 203, in serveFile
  4.     self.wfile.write(data)
Copy the Code
I replaced  
  1. self.wfile.write(data)
Copy the Code
by
  1. self.wfile.write(bytes(data, 'UTF-8'))
Copy the Code

The answer I found it here http://stackoverflow.com/questions/5471158/typeerror-str-does-not-support-the-buffer-interface
thanks to Michał Niklas:
"If you use Python3x then string is not the same type as for Python 2.x, you must cast it to bytes (encode it)."
I'm using python3.4 so yes that's it!
I hope this will save someone's time.

You have to log in before you can reply Login | Sign Up

Points Rules