TJForc / risco-lan-bridge

risco-lan-bridge is a "bridge" between a node.js application and a Risco Panel
Other
21 stars 12 forks source link

On shutdown of bridge (SIGTERM), Discovery mode suddenly activated. #11

Open Monofin opened 2 years ago

Monofin commented 2 years ago

Hi there - when SIGTERM is received and the bridge is trying to connect to the panel, then the bridge seems to do something like erroneously associate the N05 from the DCN with the SendCommand from the previous attempt to connect, and it jumps into Discovery mode:

Interestingly this actually demonstrates that the panel is refusing to talk to the Configuration Software when the access code is correct in #10 - incorrect access codes are met with 'invalid Value' whilst the correct (default) code results in a timeout. (this reinforces my thoughts that in #10 then the problem lies in some form of incomplete disconnect from the panel)

This is probably harmless, but is very noisy in the logs.

(Logs from HomeKit RiscoLocalAlarm, but the problem is clearly shown) [23/11/2021, 16:04:46] [HB Supervisor] Stopping services... [23/11/2021, 16:04:46] Got SIGTERM, shutting down Homebridge... [23/11/2021, 16:04:46] [RiscoLocalAlarm] Received SIGTERM, Disconnecting [23/11/2021, 16:04:46] [RiscoLocalAlarm] Disconnecting from Panel. [23/11/2021, 16:04:46] [RiscoLocalAlarm] Sending Command : DCN [23/11/2021, 16:04:46] [RiscoLocalAlarm] TCP Socket Disconnected [23/11/2021, 16:04:46] [RiscoLocalAlarm] Command CRC Value : A5AC [23/11/2021, 16:04:46] [RiscoLocalAlarm] Command Sent. [23/11/2021, 16:04:46] [RiscoLocalAlarm] Sequence : 2 - Data Sent : DCN [23/11/2021, 16:04:46] [RiscoLocalAlarm] Received data Buffer : [2,48,50,78,48,53,23,53,54,55,67,3] [23/11/2021, 16:04:46] [RiscoLocalAlarm] Command CRC Value : 567C [23/11/2021, 16:04:46] [RiscoLocalAlarm] CRC Ok [23/11/2021, 16:04:46] [RiscoLocalAlarm] Response from Panel. [23/11/2021, 16:04:46] [RiscoLocalAlarm] Expected response for Command Id : 02. [23/11/2021, 16:04:46] [RiscoLocalAlarm] Received From Panel : N05 [23/11/2021, 16:04:46] [RiscoLocalAlarm] Receipt of an error code: Invalid parameter [23/11/2021, 16:04:46] [RiscoLocalAlarm] SendCommand receive this response : N05 [23/11/2021, 16:04:46] [RiscoLocalAlarm] Discovery Mode Enabled. [23/11/2021, 16:04:46] [RiscoLocalAlarm] Bad Access Code : 5678 [23/11/2021, 16:04:46] [RiscoLocalAlarm] Sending Command : RMT=0 [23/11/2021, 16:04:46] [RiscoLocalAlarm] Command CRC Value : 9297 [23/11/2021, 16:04:46] [RiscoLocalAlarm] Command Sent. [23/11/2021, 16:04:46] [RiscoLocalAlarm] Sequence : 1 - Data Sent : RMT=0 [23/11/2021, 16:04:46] [RiscoLocalAlarm] Received data Buffer : [2,48,49,78,48,54,23,65,54,51,56,3] [23/11/2021, 16:04:46] [RiscoLocalAlarm] Command CRC Value : A638 [23/11/2021, 16:04:46] [RiscoLocalAlarm] CRC Ok [23/11/2021, 16:04:46] [RiscoLocalAlarm] Response from Panel. [23/11/2021, 16:04:46] [RiscoLocalAlarm] Expected response for Command Id : 01. [23/11/2021, 16:04:46] [RiscoLocalAlarm] Received From Panel : N06 [23/11/2021, 16:04:46] [RiscoLocalAlarm] Receipt of an error code: Invalid Value

TJForc commented 2 years ago

Can you try this commit and tell me if you are still having this problem: https://github.com/TJForc/risco-lan-bridge/commit/b7ac65818abe0187ffdbfc8c8d919487dbe0d183

Monofin commented 2 years ago

Will do, asap - thanks for looking at it :-) Cheers, Monofin

On 28 Nov 2021, at 16:09, TJForc @.***> wrote:

 Can you try this commit and tell me if you are still having this problem: b7ac658

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.