Thursday 29 March 2018

Webiopi upgrade from Wheezy to Jessie

DECISION: Forget WebIOPi on Jessie. Let's do the next two things:
1. Cayenne.
2. AD-Hoc Networking

----------- ------------ ---------


Webiopi was working on a card with Raspbian Wheezy, then I updated  and upgraded and I noticed that some files were labelled from Jessie.

After rebooting I couldn't get Webiopi to load. I could ssh into teh R-pi as normal, so I started the WebioPi service but I stiull could not load the web page. What follows is the log for WebIOPi. I'll look at it later to see if I can understand what to do.

2018-01-14 14:17:27 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4
2018-01-14 14:17:27 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2018-01-14 14:17:27 - WebIOPi - INFO - Loading configuration from /etc/webiopi/config
2018-01-14 14:17:28 - WebIOPi - INFO - Loading myproject from /home/pi/rc-car/python/script.py
2018-01-14 14:17:28 - WebIOPi - INFO - Access protected using /etc/webiopi/passwd
2018-01-14 14:17:28 - WebIOPi - INFO - HTTP Server binded on http://192.168.1.8:8000/
2018-01-14 14:17:28 - WebIOPi - INFO - CoAP Server binded on coap://192.168.1.8:5683/
2018-01-14 14:17:28 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST)
2018-01-14 14:17:37 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4
2018-01-14 14:17:37 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2018-01-14 14:17:37 - WebIOPi - INFO - Loading configuration from /etc/webiopi/config
2018-01-14 14:17:37 - WebIOPi - INFO - Loading myproject from /home/pi/rc-car/python/script.py
2018-01-14 14:17:37 - WebIOPi - INFO - Access protected using /etc/webiopi/passwd
2018-01-14 14:17:37 - WebIOPi - INFO - HTTP Server binded on http://192.168.1.8:8000/
2018-01-14 14:17:37 - WebIOPi - INFO - CoAP Server binded on coap://192.168.1.8:5683/
2018-01-14 14:17:37 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST)
2018-01-14 14:17:28 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4
2018-01-14 14:17:28 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2018-01-14 14:17:28 - WebIOPi - INFO - Loading configuration from /etc/webiopi/config
2018-01-14 14:17:29 - WebIOPi - INFO - Loading myproject from /home/pi/rc-car/python/script.py
2018-01-14 14:17:29 - WebIOPi - INFO - Access protected using /etc/webiopi/passwd
2018-01-14 14:17:29 - WebIOPi - INFO - HTTP Server binded on http://192.168.1.8:8000/
2018-01-14 14:17:29 - WebIOPi - INFO - CoAP Server binded on coap://192.168.1.8:5683/
2018-01-14 14:17:29 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST)
2018-03-29 15:14:21 - WebIOPi - INFO - Stopping...
2018-03-29 15:14:22 - WebIOPi - INFO - CoAP Server stopped
2018-03-29 15:14:22 - WebIOPi - INFO - HTTP Server stopped
2018-03-29 15:14:52 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4
2018-03-29 15:14:52 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2018-03-29 15:14:52 - WebIOPi - INFO - Loading configuration from /etc/webiopi/config
2018-03-29 15:14:52 - WebIOPi - ERROR - name 'GPIO' is not defined
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/__main__.py", line 75, in
    main(sys.argv)
  File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/__main__.py", line 69, in main
    server = Server(port=port, configfile=configfile, scriptfile=scriptfile)
  File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/server/__init__.py", line 52, in __init__
    self.gpio.addSetups(config.items("GPIO"))
  File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/devices/digital/gpio.py", line 62, in addSetups
    self.addGPIOSetup(gpio, params)
  File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/devices/digital/gpio.py", line 55, in addGPIOSetup
    self.addGPIO(self.gpio_setup, gpio, params)
  File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/devices/digital/gpio.py", line 45, in addGPIO
    func = GPIO.OUT
NameError: name 'GPIO' is not defined


There's one thing -->  GPIO is not defined.

things to try:
https://raspberrypi.stackexchange.com/questions/37327/global-name-gpio-is-not-defined-errors-on-webiopi

At the bottom of this is the suggestion that I start WebIOPi specifically via Python3. This gives the webIOpi menu and GPIO pin display, but doesnt operate them.  It didn't start my web page.


Commands:
 sudo /etc/init.d/webiopi stop
sudo python3 -m webiopi 8000
gives when stopped: 
pi@raspberrypi:/var/log $ sudo python3 -m webiopi 8000

2018-03-30 10:41:36 - WebIOPi - INFO - Starting WebIOPi/0.7.1/Python3.4

2018-03-30 10:41:36 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO

2018-03-30 10:41:36 - WebIOPi - WARNING - Access unprotected

2018-03-30 10:41:36 - WebIOPi - INFO - HTTP Server binded on http://192.168.1.8:8000/

2018-03-30 10:41:36 - WebIOPi - INFO - CoAP Server binded on coap://192.168.1.8:5683/

2018-03-30 10:41:36 - WebIOPi - INFO - CoAP Server binded on coap://224.0.1.123:5683/ (MULTICAST)

----------------------------------------

Exception happened during processing of request from ('::ffff:192.168.1.11', 46518, 0, 0)

Traceback (most recent call last):

  File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/protocols/http
.py", line 238, in processRequest

    result = self.server.handler.do_GET(relativePath, compact)

  File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/protocols/rest
.py", line 147, in do_GET

    return (200, self.getJSON(compact), M_JSON)

  File "/usr/local/lib/python3.4/dist-packages/WebIOPi-0.7.1-py3.4-linux-armv6l.egg/webiopi/protocols/rest
.py", line 245, in getJSON

    gpios[gpio][f] = GPIO.getFunctionString(gpio)

NameError: name 'GPIO' is not defined
And lots more repeats of this. 
???? 
Possibly this, but doesn't mention Jessie
http://webiopi.trouch.com/issues/140/

This first I think:
https://groups.google.com/forum/#!topic/webiopi/BGc-mcD3UEw
-- It won't work. My version number is the one already in the file.


No comments: