Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
socket.error...but changing port didn't help, nor did reboot
#1
I installed and played with SIP for a while (I like it) but now I cannot get it to run, with this error (full terminal text below):

socket.error: No socket could be created -- (('::192.168.1.15', 8666, 0, 0): [Errno 99] Cannot assign requested address)

As you can see I changed the port (tried several). Also tried stopping the service and status with systemctl:

pi@192.168.1.15:~/SIP$ sudo service sip stop
Failed to stop sip.service: Unit sip.service not loaded.


pi@192.168.1.15:~/SIP$ systemctl status sip
Unit sip.service could not be found.


Thanks for any thoughts!
Gary

pi@192.168.1.15:~/SIP$ sudo python sip.py
Messge from Signaling plugin!: Just an example!
plugins loaded:
  mobile_app
  plugin_manager
  signaling_examples
  system_update
zones changed
Starting timing loop

[0, 0, 0, 0, 0, 0, 0, 0]
http://::192.168.1.15:8666/
Traceback (most recent call last):
  File "sip.py", line 291, in <module>
    app.run()
  File "sip.py", line 219, in run
    return web.httpserver.runsimple(func, (ip, port))
  File "/home/pi/SIP/web/httpserver.py", line 178, in runsimple
    server.start()
  File "/home/pi/SIP/cheroot/server.py", line 1820, in start
    self.prepare()
  File "/home/pi/SIP/cheroot/server.py", line 1779, in prepare
    raise socket.error(msg)
socket.error: No socket could be created -- (('::192.168.1.15', 8666, 0, 0): [Errno 99] Cannot assign requested address)
Reply
#2
Hi Gary,
Usually the "No socket could be created" error indicates that something else is using the port.

Have you tried rebooting the Pi?

The "Unit sip.service could not be found" error sounds like the service is not enabled.
did you follow the instructions on the SIP wiki under
Installation and Set UP > Starting the program automatically > [url=https://github.com/Dan-in-CA/SIP/wiki/Installation#the-recommended-method][/url]The recommended method :


  1. Copy the script file to /etc/systemd/system. Run the command:
    sudo cp SIP/sip.service /etc/systemd/system/
  2. Enable sip service:
    sudo systemctl enable sip.service
  3. Reboot the Pi:
    sudo reboo
  4. t


Or if you want to run SIP under Python3 use sip3.service with the above instructions.

Then try:
Code:
systemctl status sip (or sip3)
to stop, use
Code:
systemctl stop sip

to start use
Code:
systemctl start sip


How did you change the port number if SIP was not running?

It can be done by editing SIP/data/sd.json and changing the line "htp": 80,
Be sure to keep the comma after the port number.
<p><br></p>
Reply
#3
(2020 Jul 12, 08:05 PM)dan Wrote: Usually the "No socket could be created" error indicates that something else is using the port.

"Cannot assign requested address" could also be that not only the port is configured but also the IP address. When the IP of the PI changes e.g. by DHCP than there is trouble. Unless you have multiple interfaces you would configure the ip as 0.0.0.0

--Gerard
Reply
#4
Hi Dan:



Now upgrading from buster to bullseye and having exactly the same problem as I did two years ago (in this thread: OSError: No socket could be created). It appears regardless of what port I use. Unfortunately, no idea how it was fixed!




In this case I just now enabled SIP as a service hoping that would help but it didn't solve the problem (it is active and running). Prior to that I could successfully run SIP from the command line but not as a @reboot line in crontab (that's how it was in buster). Here's the crontab line I used with the result below. 




@reboot sudo python3 /home/pi/SIP/sip.py  >> /home/pi/SIP-OUT.txt 2>&1




Not sure how to run SIP from the command line when running as a service...can't do that now; suggestions welcome.



Messge from Signaling plugin!: Just an example!

plugins loaded:

  mobile_app

  plugin_manager

  signaling_examples

  system_update

Starting timing loop



A new day has started.

zones changed

[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

http://192.168.1.10:8099/

Traceback (most recent call last):

  File "/home/pi/SIP/sip.py", line 342, in <module>

    app.run()

  File "/home/pi/SIP/sip.py", line 260, in run

    return web.httpserver.runsimple(func, (ip, port))

  File "/home/pi/SIP/web/httpserver.py", line 178, in runsimple

    server.start()

  File "/home/pi/SIP/cheroot/server.py", line 1820, in start

    self.prepare()

  File "/home/pi/SIP/cheroot/server.py", line 1779, in prepare

    raise socket.error(msg)

OSError: No socket could be created -- (('192.168.1.10', 8099): [Errno 99] Cannot assign requested address)
Reply
#5
Be sure you have on Options->System->HTTP IP addr no ip address entered. Only :: is enough.
You can also check the config file:  SIP/data/sd.json  

In there it should be: 
Code:
"htip": "::",

--Gerard
Reply
#6
(2022 Aug 14, 06:35 PM)astrogerard Wrote: Be sure you have on Options->System->HTTP IP addr no ip address entered. Only :: is enough.
You can also check the config file:  SIP/data/sd.json  

In there it should be: 
Code:
"htip": "::",

--Gerard

Gerard:

That was it--thank you so much--really appreciate it! All seems good now (at least with SIP...).

Best wishes,
Gary
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)