Open paskovitch opened 4 years ago
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.
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
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)
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