kk7ds / pynx584

Python library and server for talking to NX584/NX8E interfaces
GNU General Public License v3.0
29 stars 26 forks source link

config.ini does not get created #11

Closed Pre10der closed 6 years ago

Pre10der commented 6 years ago

I have been deciphering code trying to understand a few things and am up to the config.ini file. I understand that this gets created on first run, however that is not happening for me. I began troubleshooting this as every time I run pynx584 it returns blank zones until every zone is triggerd at least once....and the zone names are returned as 'Unknown'

My assumption is that config.ini keeps the state for the zones, and in turn the zone names?

The issue however is that config.ini never gets created.

I am executing pynx584 using this command on a raspberry pi (Model 1): sudo su - pi -c '/usr/local/bin/nx584_server --serial /dev/ttyUSB0 --baud 9600 --listen 192.168.x.x --port 5007 --log /home/pi/nx584.log --config /home/pi/config.ini --debug' Any insight into why the config.ini is not created? The logs don't speak to it either.

Here is an example output of my debug logs:

2017-12-08 12:22:34,171 main INFO Ready 2017-12-08 12:22:34,331 controller INFO Loaded extensions [] 2017-12-08 12:22:34,684 _internal INFO * Running on http://192.168.1.57:5007/ (Press CTRL+C to quit) 2017-12-08 12:22:35,639 controller DEBUG Sending queued [59, 17, 12, 8, 12, 22, 6] 2017-12-08 12:22:36,065 controller DEBUG Parsing raw ASCII line b'011D1E1F' 2017-12-08 12:22:36,071 controller DEBUG Received: 29 Positive Acknowledge (data []) 2017-12-08 12:22:36,345 controller DEBUG Parsing raw ASCII line b'0C880A001000008200000001568869' 2017-12-08 12:22:36,350 controller DEBUG Received: 8 System Status (data [10, 0, 16, 0, 0, 130, 0, 0, 0, 1, 86]) 2017-12-08 12:22:36,357 controller DEBUG System status received (panel id 0x0a) 2017-12-08 12:22:36,361 controller INFO System asserts Valid partition 1 2017-12-08 12:22:36,531 controller INFO System asserts Timing a high voltage battery change 2017-12-08 12:22:36,538 controller ERROR System asserts Box tamper 2017-12-08 12:22:36,547 controller INFO System asserts AC power on 2017-12-08 12:22:36,556 controller DEBUG Requesting partition status for 1 2017-12-08 12:22:36,849 controller DEBUG Parsing raw ASCII line b'0A8A56B9F700000C080C16D2EC' 2017-12-08 12:22:36,854 controller DEBUG Received: 10 Log Event (data [86, 185, 247, 0, 0, 12, 8, 12, 22]) 2017-12-08 12:22:36,860 controller INFO Log event: Time set at 2017-12-08 12:22:00 2017-12-08 12:22:38,124 controller DEBUG Sending queued [35, 0] 2017-12-08 12:22:38,847 controller DEBUG Parsing raw ASCII line b'011F2021' 2017-12-08 12:22:38,852 controller DEBUG Received: 31 Message Rejected (data []) 2017-12-08 12:22:40,110 controller DEBUG Sending queued [35, 1] 2017-12-08 12:22:40,604 controller DEBUG Parsing raw ASCII line b'011F2021' 2017-12-08 12:22:40,609 controller DEBUG Received: 31 Message Rejected (data []) 2017-12-08 12:22:41,867 controller DEBUG Sending queued [35, 2] 2017-12-08 12:22:42,302 controller DEBUG Parsing raw ASCII line b'011F2021' 2017-12-08 12:22:42,307 controller DEBUG Received: 31 Message Rejected (data []) 2017-12-08 12:22:43,566 controller DEBUG Sending queued [35, 3] 2017-12-08 12:22:43,961 controller DEBUG Parsing raw ASCII line b'011F2021' 2017-12-08 12:22:43,965 controller DEBUG Received: 31 Message Rejected (data []) 2017-12-08 12:22:45,225 controller DEBUG Sending queued [35, 4] 2017-12-08 12:22:45,658 controller DEBUG Parsing raw ASCII line b'011F2021' 2017-12-08 12:22:45,663 controller DEBUG Received: 31 Message Rejected (data []) 2017-12-08 12:22:46,921 controller DEBUG Sending queued [35, 5] 2017-12-08 12:22:47,296 controller DEBUG Parsing raw ASCII line b'011F2021' 2017-12-08 12:22:47,300 controller DEBUG Received: 31 Message Rejected (data []) 2017-12-08 12:22:48,559 controller DEBUG Sending queued [35, 6] 2017-12-08 12:22:49,818 controller DEBUG Sending queued [35, 7] 2017-12-08 12:22:50,510 controller DEBUG Parsing raw ASCII line b'011F2021' 2017-12-08 12:22:50,514 controller DEBUG Received: 31 Message Rejected (data []) 2017-12-08 12:22:51,773 controller DEBUG Sending queued [38, 0] 2017-12-08 12:22:52,091 controller DEBUG Parsing raw ASCII line b'09060020000000FF0482B5FB' 2017-12-08 12:22:52,095 controller DEBUG Received: 6 Partition Status (data [0, 32, 0, 0, 0, 255, 4, 130]) 2017-12-08 12:22:52,100 controller DEBUG Partition 1 ['reserved', 'Ready to arm', 'Open period', 'Delay trip in progress (common zone)']

Any way I can force the initial config.ini to create itself?

kk7ds commented 6 years ago

For posterity,

The config only gets created if and as necessary to persist zone names reported by the controller. With a couple exceptions, there's really not much point in generating the config otherwise. I put a sample of the config in be546d46d9ac5651ac7c7531016ac3d1cc46232e so that one can be created manually if necessary.

So, I'm going to close this for now.