Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why am I getting this error message? #5

Open
paskovitch opened this issue Sep 16, 2020 · 3 comments
Open

Why am I getting this error message? #5

paskovitch opened this issue Sep 16, 2020 · 3 comments

Comments

@paskovitch
Copy link

2020-09-16 23:29:46,554 INFO Starting MQTT client for 192.168.0.185:1883
2020-09-16 23:29:46,557 INFO Starting alarm server on 192.168.0.250:10001
2020-09-16 23:29:46,559 ERROR Terminated due to exception
Traceback (most recent call last):
File "alarmrx.py", line 869, in
main()
File "alarmrx.py", line 852, in main
t = ThreadedTCPServer((SERVER_HOST, SERVER_PORT), TexecomService)
File "/usr/lib/python2.7/SocketServer.py", line 417, in init
self.server_bind()
File "/usr/lib/python2.7/SocketServer.py", line 431, in server_bind
self.socket.bind(self.server_address)
File "/usr/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
error: [Errno 99] Cannot assign requested address

@mikestir
Copy link
Owner

I guess either 192.168.0.250 is not a local address (try setting SERVER_HOST to 0.0.0.0), or something is already listening on port 10001.

One thing you need to watch out for with TCP connections in general is that the port can remain busy for a while after it has been closed (while it remains in TIME_WAIT state). If this is the case then it will work if you try again after a minute or so.

@paskovitch
Copy link
Author

paskovitch commented Sep 17, 2020

Thanks for the help! Theoretically, the server is running now, but something is still wrong:

2020-09-17 12:19:32,899 INFO Starting MQTT client for 192.168.0.185:1883
2020-09-17 12:19:32,902 INFO Starting alarm server on 192.168.0.185:1010
2020-09-17 12:21:00,489 INFO Starting MQTT client for 192.168.0.185:1883
2020-09-17 12:21:00,495 INFO Starting alarm server on 192.168.0.185:1010
2020-09-17 12:22:33,389 INFO Starting MQTT client for 192.168.0.185:1883
2020-09-17 12:22:33,392 INFO Starting alarm server on 192.168.0.185:1010
2020-09-17 12:25:03,506 INFO 0829 Polling deadline missed (1/1)
2020-09-17 12:25:03,506 ERROR 0829 Polling alert
2020-09-17 12:25:03,508 DEBUG MQTT publish complete
2020-09-17 12:25:03,509 DEBUG MQTT publish complete
2020-09-17 12:27:33,634 INFO 0829 Polling deadline missed (2/1)
2020-09-17 12:30:03,754 INFO 0829 Polling deadline missed (3/1)
2020-09-17 12:32:33,895 INFO 0829 Polling deadline missed (4/1)
2020-09-17 12:35:04,035 INFO 0829 Polling deadline missed (5/1)
2020-09-17 12:37:34,175 INFO 0829 Polling deadline missed (6/1)
2020-09-17 12:38:47,175 INFO Starting MQTT client for 192.168.0.185:1883
2020-09-17 12:38:47,178 INFO Starting alarm server on 192.168.0.185:1010
2020-09-17 12:41:17,304 INFO 0829 Polling deadline missed (1/1)
2020-09-17 12:41:17,305 ERROR 0829 Polling alert
2020-09-17 12:41:17,308 DEBUG MQTT publish complete
2020-09-17 12:41:17,309 DEBUG MQTT publish complete
2020-09-17 12:43:47,450 INFO 0829 Polling deadline missed (2/1)
2020-09-17 12:46:17,567 INFO 0829 Polling deadline missed (3/1)
2020-09-17 12:48:47,713 INFO 0829 Polling deadline missed (4/1)
2020-09-17 12:51:17,844 INFO 0829 Polling deadline missed (5/1)
2020-09-17 12:53:47,984 INFO 0829 Polling deadline missed (6/1)
2020-09-17 12:56:18,124 INFO 0829 Polling deadline missed (7/1)
2020-09-17 12:58:48,269 INFO 0829 Polling deadline missed (8/1)
2020-09-17 13:01:18,400 INFO 0829 Polling deadline missed (9/1)

If i close the CLI:
^CTraceback (most recent call last):
File "alarmrx.py", line 869, in
main()
File "alarmrx.py", line 855, in main
t.serve_forever()
File "/usr/lib/python2.7/SocketServer.py", line 231, in serve_forever
poll_interval)
File "/usr/lib/python2.7/SocketServer.py", line 150, in _eintr_retry
return func(*args)
KeyboardInterrupt

@mikestir
Copy link
Owner

Doesn't look like the panel is calling in. The server port number (1010 here) needs to match what is set in the panel configuration either from a keypad or via WinTex.

If you close the CLI you quit the server unless you daemonised it, which you can do by running it like "./alarmrx.py -d". If you get an error about DaemonContext you need to "pip install python-daemon". The -d switch will run the server in the background. To shut it down you will need to kill the process e.g. with kill $(pgrep -f alarmrx.py)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants