dorgelesnzi / webiopi

Web IO Pi
0 stars 0 forks source link

[Errno 98] Address already in use with webiopi 0.7.0 #109

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. raspberry pi connected to a network using ipv6
2. running the following command: $ sudo webiopi -d -c /etc/webiopi/config
3. get 2 errors: WebIOPi - ERROR - [Errno 98] Address already in use
...

WebIOPi version used?
=> 0.7.0

Python version used?
=> 3.2 (provided with webiopi)

Distro used? (WebIOPi has only been tested on Raspbian Wheezy)
=>RASPBIAN Debian Wheezy 

Raspberry Pi board revision? (1 or 2)
=> rev 2

For Javascript side bugs, Browser?
=>

Please provide any additional information below.

the error log:

pi@raspberrypi ~ $ sudo webiopi -d -c /etc/webiopi/config
2014-06-26 12:53:53 - WebIOPi - INFO - Starting WebIOPi/0.7.0/Python3.2
2014-06-26 12:53:53 - WebIOPi - DEBUG - Mapping GPIO.digitalCount to REST GET 
/GPIO/count
2014-06-26 12:53:53 - WebIOPi - DEBUG - Mapping GPIO.digitalRead to REST GET 
/GPIO/%(channel)d/value
2014-06-26 12:53:53 - WebIOPi - DEBUG - Mapping GPIO.digitalWrite to REST POST 
/GPIO/%(channel)d/value/%(value)d
2014-06-26 12:53:53 - WebIOPi - DEBUG - Mapping GPIO.getFunctionString to REST 
GET /GPIO/%(channel)d/function
2014-06-26 12:53:53 - WebIOPi - DEBUG - Mapping GPIO.getPulse to REST GET 
/GPIO/%(channel)d/pulse
2014-06-26 12:53:53 - WebIOPi - DEBUG - Mapping GPIO.outputSequence to REST 
POST/GPIO/%(channel)d/sequence/%(args)s
2014-06-26 12:53:53 - WebIOPi - DEBUG - Mapping GPIO.portRead to REST GET 
/GPIO/*/integer
2014-06-26 12:53:53 - WebIOPi - DEBUG - Mapping GPIO.portWrite to REST POST 
/GPIO/*/integer/%(value)d
2014-06-26 12:53:53 - WebIOPi - DEBUG - Mapping GPIO.pulse to REST POST 
/GPIO/%(channel)d/pulse/
2014-06-26 12:53:53 - WebIOPi - DEBUG - Mapping GPIO.pulseAngle to REST POST 
/GPIO/%(channel)d/pulseAngle/%(value)f
2014-06-26 12:53:53 - WebIOPi - DEBUG - Mapping GPIO.pulseRatio to REST POST 
/GPIO/%(channel)d/pulseRatio/%(value)f
2014-06-26 12:53:53 - WebIOPi - DEBUG - Mapping GPIO.setFunctionString to REST 
POST /GPIO/%(channel)d/function/%(value)s
2014-06-26 12:53:53 - WebIOPi - DEBUG - Mapping GPIO.wildcard to REST GET 
/GPIO/*
2014-06-26 12:53:53 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2014-06-26 12:53:53 - WebIOPi - INFO - Loading configuration from 
/etc/webiopi/config
2014-06-26 12:53:53 - WebIOPi - INFO - Loading myscript from 
/home/pi/mytestproject/python/script.py
2014-06-26 12:53:53 - WebIOPi - INFO - Access protected using 
/etc/webiopi/passwd
2014-06-26 12:53:53 - WebIOPi - ERROR - [Errno 98] Address already in use
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.7.0-py3.2-linux-armv6l.egg/webiopi/protocols/http.py", line 45, in __init__
    BaseHTTPServer.HTTPServer.__init__(self, ("", port), HTTPHandler)
  File "/usr/lib/python3.2/socketserver.py", line 419, in __init__
    self.server_bind()
  File "/usr/lib/python3.2/http/server.py", line 132, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/usr/lib/python3.2/socketserver.py", line 430, in server_bind
    self.socket.bind(self.server_address)
socket.error: [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.2/dist-packages/WebIOPi-0.7.0-py3.2-linux-armv6l.egg/webiopi/__main__.py", line 75, in <module>
    main(sys.argv)
  File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.7.0-py3.2-linux-armv6l.egg/webiopi/__main__.py", line 69, in main
    server = Server(port=port, configfile=configfile, scriptfile=scriptfile)
  File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.7.0-py3.2-linux-armv6l.egg/webiopi/server/__init__.py", line 123, in __init__
    self.http_server = http.HTTPServer(self.host, http_port, self.restHandler, context, docroot, index, auth, realm)
  File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.7.0-py3.2-linux-armv6l.egg/webiopi/protocols/http.py", line 48, in __init__
    BaseHTTPServer.HTTPServer.__init__(self, ("", port), HTTPHandler)
  File "/usr/lib/python3.2/socketserver.py", line 419, in __init__
    self.server_bind()
  File "/usr/lib/python3.2/http/server.py", line 132, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/usr/lib/python3.2/socketserver.py", line 430, in server_bind
    self.socket.bind(self.server_address)
socket.error: [Errno 98] Address already in use
2014-06-26 12:53:53 - WebIOPi - INFO - Stopping...

I've tried to activate ipv6 module but it doesn't change anything.
I'm not sure it's because of the ipv6 adressing on the network router, but at 
home connected to my internet provider internet box, the adressing mode is 
ipv4, and ther is no problem.
I've tried to trace connection to the port used bby webiopi (8000) with 
netstat, but it's not used. I've also tried to change the default port number 
(switching it to 8001), but it doesn't make any change to the error.

Any help is appreciated.

Thanks!

olivier

Original issue reported on code.google.com by orossini...@gmail.com on 26 Jun 2014 at 6:39

GoogleCodeExporter commented 9 years ago
Same problem, would love to get some feedback, 
Thanks

Original comment by stephen....@cim.ie on 14 Aug 2014 at 10:50

GoogleCodeExporter commented 9 years ago
Try this :
sudo update-rc.d webiopi remove
sudo reboot

sudo /etc/init.d/webiopi start

Original comment by damig...@gmail.com on 15 Aug 2014 at 5:09

GoogleCodeExporter commented 9 years ago
Thanks that fix worked straight away....much appreciated, have a good weekend

Original comment by stephen....@cim.ie on 15 Aug 2014 at 6:47