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

Connection reset RW432MP panel #61

Open
maartenweyns opened this issue Jan 25, 2024 · 13 comments
Open

Connection reset RW432MP panel #61

maartenweyns opened this issue Jan 25, 2024 · 13 comments

Comments

@maartenweyns
Copy link

Describe the bug
The HomeAssistant addon is unable to connect to my RW432MP panel (connection is being reset)

Configuration

  • Environment: HA Addon
  • Version: v0.5.0-beta.2
  • Mode: direct
  • Risco Panel model: RW432MP (I think that's Lightsys+)
  • Risco Panel firmware version: Unknown

Logs

Debug logs:

Loading config from: /config/risco-mqtt.json
1/25/2024, 12:42:17 PM [debug] User config:
{
  "log": "debug",
  "panel": {
    "panelIp": “RISCO_IP”,
    "panelPort": 1000,
    "panelPassword": “RISCO_PIN,
    "watchDogInterval": 10000,
    "commandsLog": true
  },
  "panel_name": "alarm",
  "mqtt": {
    "url": "mqtt://HA_IP:1883",
    "username": "MQTT_USER",
    "password": "MQTT_PASS"
  },
  "zones": {}
}
1/25/2024, 12:42:18 PM [debug] Merged config:
{
  "log": "debug",
  "logColorize": false,
  "ha_discovery_prefix_topic": "homeassistant",
  "panel_name": "alarm",
  "panel_node_id": "alarm",
  "panel": {
    "panelIp": "RISCO_IP",
    "panelPort": 1000,
    "panelPassword": "RISCO_PW",
    "watchDogInterval": 10000,
    "commandsLog": true
  },
  "zones": {
    "default": {
      "off_delay": 0,
      "device_class": "motion",
      "name_prefix": ""
    }
  },
  "mqtt": {
    "url": "mqtt://HA_IP:1883",
    "username": "MQTT_USER",
    "password": "MQTT_PASS",
    "reconnectPeriod": 5000,
    "clientId": null,
    "will": {
      "topic": null,
      "payload": "offline",
      "qos": 1,
      "retain": true,
      "properties": {
        "willDelayInterval": 30
      }
    }
  }
}
1/25/2024, 12:42:18 PM [info] Logging commands to risco-commands-2024-01-25T11:42:18.033Z.csv
1/25/2024, 12:42:18 PM [debug] Local GMT Timezone is : +01:00
1/25/2024, 12:42:18 PM [info] autoConnect enabled, starting communication
1/25/2024, 12:42:18 PM [verbose] Start Connection to Panel
1/25/2024, 12:42:18 PM [debug] Pseudo Buffer Created for Panel Id(1)
1/25/2024, 12:42:18 PM [debug] TCP Socket created
1/25/2024, 12:42:18 PM [info] Connecting to mqtt server: mqtt://HA_IP:1883
1/25/2024, 12:42:18 PM [error] Socket Error : Error: connect ECONNRESET RISCO_IP:1000
1/25/2024, 12:42:18 PM [info] TCP Socket Disconnected
1/25/2024, 12:42:18 PM [info] Automatic reconnection will be attempted in 10000 ms
1/25/2024, 12:42:18 PM [debug] Socket Disconnected.
1/25/2024, 12:42:18 PM [error] Socket Closed.
1/25/2024, 12:42:18 PM [info] Connected on mqtt server: mqtt://HA_IP:1883
1/25/2024, 12:42:18 PM [info] Panel is not connected, waiting
1/25/2024, 12:42:28 PM [verbose] Start Connection to Panel
1/25/2024, 12:42:28 PM [debug] A TCP Socket already exists, clearing its listeners before creating a new one
1/25/2024, 12:42:28 PM [debug] Pseudo Buffer Created for Panel Id(1)
1/25/2024, 12:42:28 PM [debug] TCP Socket created
1/25/2024, 12:42:28 PM [verbose] Socket Connected, log in to panel
1/25/2024, 12:42:28 PM [verbose] Authenticating to the panel
1/25/2024, 12:42:28 PM [verbose] Command[1] Sending Command: RMT=RISCO_PW
1/25/2024, 12:42:28 PM [debug] Command[1] Writing command buffer to socket: [INT_ARRAY]
1/25/2024, 12:42:28 PM [debug] Command[1] Data Sent : RMT=RISCO_PW
1/25/2024, 12:42:28 PM [error] Socket Error : Error: write ECONNRESET
1/25/2024, 12:42:28 PM [info] TCP Socket Disconnected
1/25/2024, 12:42:28 PM [info] Automatic reconnection will be attempted in 10000 ms
1/25/2024, 12:42:28 PM [debug] Socket Disconnected.
1/25/2024, 12:42:28 PM [error] Command[1] error: Error: write ECONNRESET
1/25/2024, 12:42:28 PM [error] Socket Closed.
1/25/2024, 12:42:28 PM [debug] Command[1] command response : undefined
1/25/2024, 12:42:28 PM [error] Risco command error: TIMEOUT. Command: {"panelId":1,"commandId":1,"attempts":1,"crcOk":false,"commandStr":"RMT=RISCO_PW","sentBuffer":{"type":"Buffer","data":[INT_ARRAY]}}

where INT_ARRAY is an arbitrary-looking array of integers (removed because unsure if it's sensitive data).

Command log:

Unable to find the command log file.

Additional context
No additional context

@markxroberts
Copy link
Contributor

This version of the library doesn’t support Lightsys+. Try @markxroberts library (sorry - self promotion).

@vanackej
Copy link
Owner

vanackej commented Jan 25, 2024 via email

@maartenweyns
Copy link
Author

This version of the library doesn’t support Lightsys+. Try @markxroberts library (sorry - self promotion).

I am getting the same error in your risco-mqtt-local fork. Should I be changing my configuration?

consider using the official home assistant integration with local mode

I have been using that recently but it stopped working and has been quite flaky for me. Wanted to try something different :)

@vanackej
Copy link
Owner

vanackej commented Jan 25, 2024 via email

@maartenweyns
Copy link
Author

In that case I am unsure what is causing the error. Have you ever seen this before? Is it possible the pin changed out of itself? 🤷🏼‍♂️

@vanackej
Copy link
Owner

vanackej commented Jan 25, 2024 via email

@needles77
Copy link

Hello @vanackej , @maartenweyns :

For the 432mp lightsys+ , I add some code on the risco-lan-bridge :

https://github.com/needles77/risco-lan-bridge .

I will continue to work on it next week.

Bye

@markxroberts
Copy link
Contributor

If you have working code to fix this issue I’m happy to try to include in my fork of the library if you open a pull request.

@needles77
Copy link

needles77 commented Jul 14, 2024

sorry @markxroberts I hadn't read your comment.
I just tried your risco-mqtt-local fork with my lightsys+ (WIFI), and it works well (thank you for this). I have the same error as @maartenweyns on first login, but works the second time.

When I worked and try to debug de risco-lan-bridge last years with home bridge, I had some error with CRC and the delay of reconnection. I fixed this with :

  • this.ReconnectDelay = (Options.ReconnectDelay || 30000); // @needles77 : 10s --> 30s LightSys + refused connection with 10 s
  • this.BadCRCLimit = 0; // @needles77 : If CRC present from starting, somes accessoires can be not work

Now, I will try your fork for the next days, and I'll keep you informed.
I used the native risco integration in HA, it work but sometimes (1 time for 24/48h) the connection crashes and I need to restart integration.

Bye

@markxroberts
Copy link
Contributor

I've published a new version with both of these configurable.

@maartenweyns
Copy link
Author

Good to see some developments in this issue! I have tried the new version @markxroberts released, with the adapted configuration from @needles77. It however did not resolve the issue I am having. I took a gander at the traffic between my host and the alarm panel in Wireshark and I do indeed see that the alarm panel replies with the reset bit set after the RMT command. No idea why that is happening

I attached the new logs below (they look slightly different this time):

11:40:21 AM [debug] Local GMT Timezone is : +00:00
11:40:21 AM [info] autoConnect enabled, starting communication
11:40:21 AM [verbose] Start Connection to Panel
11:40:21 AM [debug] Pseudo Buffer Created for Panel Id(1)
11:40:21 AM [debug] TCP Socket created
11:40:21 AM [info] [RML] Connecting to mqtt server: mqtt://10.0.1.10:1883
11:40:21 AM [verbose] Socket Connected, log in to panel
11:40:21 AM [verbose] Authenticating to the panel
11:40:21 AM [verbose] Command[1] Sending Command: RMT=xxxx
11:40:21 AM [debug] Command[1] Writing command buffer to socket: [xxxx]
11:40:21 AM [debug] Command[1] Data Sent : RMT=xxxx
11:40:21 AM [error] Socket Closed.
11:40:21 AM [info] TCP Socket Disconnected
11:40:21 AM [info] Automatic reconnection will be attempted in 30000 ms
11:40:21 AM [debug] Socket Disconnected.
11:40:21 AM [info] [RML] Connected on mqtt server: mqtt://10.0.1.10:1883
11:40:21 AM [info] [RML] Panel is not connected, waiting
11:40:26 AM [warn] Command[1] 'RMT=xxxx' Timeout
11:40:26 AM [debug] Command[1] command response : undefined
11:40:26 AM [error] Risco command error: TIMEOUT. Command: {"panelId":1,"commandId":1,"attempts":1,"crcOk":false,"commandStr":"RMT=xxxx","sentBuffer":{"type":"Buffer","data":[xxxx]}}

@markxroberts
Copy link
Contributor

What happens if you set "autoDiscover": true and don't set panelPassword?

@maartenweyns
Copy link
Author

I am seeing the same behavior with that configuration

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

4 participants