iobroker-community-adapters / ioBroker.shelly

Integrate your Shelly devices into ioBroker via MQTT or CoIoT
Other
158 stars 64 forks source link

Shelly adapter restarts - unknown system error -126 #664

Closed Rookiestyle closed 1 year ago

Rookiestyle commented 2 years ago

Shelly device

Shelly 2.5

Protocol (CoAP / MQTT)

CoAP

The problem

Shelly adapter restarts all the time, in objects no Shelly is listed

Version of nodejs

v18.8.0

Version of ioBroker js-controller

4.0.23

Version of Adapter

6.0.0

Operating system running ioBroker

Raspbian GNU/Linux 11 (bullseye)

Checklist of files to include below

Additional information & file uploads

iobroker.log:

2022-09-12 07:16:21.041 - info: host.mpi instance system.adapter.shelly.0 started with pid 14874
2022-09-12 07:16:23.080 - debug: shelly.0 (14874) Redis Objects: Use Redis connection: 127.0.0.1:9001
2022-09-12 07:16:23.175 - debug: shelly.0 (14874) Objects client ready ... initialize now
2022-09-12 07:16:23.229 - debug: shelly.0 (14874) Objects create System PubSub Client
2022-09-12 07:16:23.231 - debug: shelly.0 (14874) Objects create User PubSub Client
2022-09-12 07:16:23.318 - debug: shelly.0 (14874) Objects client initialize lua scripts
2022-09-12 07:16:23.484 - debug: shelly.0 (14874) Objects connected to redis: 127.0.0.1:9001
2022-09-12 07:16:23.488 - silly: shelly.0 (14874) redis psubscribe cfg.o.system.user.*
2022-09-12 07:16:23.533 - silly: shelly.0 (14874) redis psubscribe cfg.o.enum.*
2022-09-12 07:16:23.541 - silly: shelly.0 (14874) objectDB connected
2022-09-12 07:16:23.545 - debug: shelly.0 (14874) Redis States: Use Redis connection: 127.0.0.1:9000
2022-09-12 07:16:23.579 - debug: shelly.0 (14874) States create System PubSub Client
2022-09-12 07:16:23.582 - debug: shelly.0 (14874) States create User PubSub Client
2022-09-12 07:16:23.681 - debug: shelly.0 (14874) States connected to redis: 127.0.0.1:9000
2022-09-12 07:16:23.683 - silly: shelly.0 (14874) statesDB connected
2022-09-12 07:16:23.896 - debug: shelly.0 (14874) Plugin sentry Initialize Plugin (enabled=true)
2022-09-12 07:16:24.483 - info: shelly.0 (14874) starting. Version 6.0.0 in /opt/iobroker/node_modules/iobroker.shelly, node: v18.8.0, js-controller: 4.0.23
2022-09-12 07:16:24.543 - silly: shelly.0 (14874) States system redis pmessage system.adapter.shelly.0.logLevel/system.adapter.shelly.0.logLevel:{"val":"silly","ack":true,"ts":1662959784526,"q":0,"from":"system.adapter.shelly.0","lc":1662957760401}
2022-09-12 07:16:24.643 - info: shelly.0 (14874) Starting in CoAP mode.
2022-09-12 07:16:24.644 - debug: shelly.0 (14874) [CoAP Server] Starting shelly listener with options: {"user":"MShellyAdmin","password":"my_password","multicastInterface":null}
2022-09-12 07:16:24.746 - info: shelly.0 (14874) [CoAP Server] Listening for packets in the network
2022-09-12 07:16:24.869 - silly: shelly.0 (14874) States user redis pmessage shelly.0.*/shelly.0.info.connection:{"val":false,"ack":true,"ts":1662959784829,"q":0,"from":"system.adapter.shelly.0","user":"system.user.admin","lc":1662957546246}
2022-09-12 07:16:35.791 - debug: shelly.0 (14874) CoAP status package received: {"3332":"SHSW-25#4C7525331880#2","3412":38400,"3420":2560,"Uri-Path":"cit/s"} / {"G":[[0,9103,2],[0,1102,"stop"],[0,1103,100],[0,2101,0],[0,2102,""],[0,2103,0],[0,2201,0],[0,2202,""],[0,2203,0],[0,4102,0],[0,4104,137],[0,6103,"normal"],[0,3104,38.98],[0,6101,0],[0,9101,"roller"],[0,4108,238.02]]}
2022-09-12 07:16:35.794 - debug: shelly.0 (14874) [CoAP Server] Status update received for SHSW-25#4C7525331880#2: {"G":[[0,9103,2],[0,1102,"stop"],[0,1103,100],[0,2101,0],[0,2102,""],[0,2103,0],[0,2201,0],[0,2202,""],[0,2203,0],[0,4102,0],[0,4104,137],[0,6103,"normal"],[0,3104,38.98],[0,6101,0],[0,9101,"roller"],[0,4108,238.02]]}
2022-09-12 07:16:35.796 - debug: shelly.0 (14874) CoAP device description request for SHSW-25#4C7525331880#2 to 192.168.179.112(0)
2022-09-12 07:16:35.839 - error: shelly.0 (14874) uncaught exception: send Unknown system error -126 192.168.179.112:5683
2022-09-12 07:16:35.840 - error: shelly.0 (14874) Error: send Unknown system error -126 192.168.179.112:5683
at doSend (node:dgram:713:16)
at defaultTriggerAsyncIdScope (node:internal/async_hooks:464:18)
at afterDns (node:dgram:659:5)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
2022-09-12 07:16:35.842 - error: shelly.0 (14874) Exception-Code: Unknown system error -126: send Unknown system error -126 192.168.179.112:5683
2022-09-12 07:16:35.880 - debug: shelly.0 (14874) [CoAP Server] Error - handling data: Error: send Unknown system error -126 192.168.179.112:5683
2022-09-12 07:16:35.894 - debug: shelly.0 (14874) [onUnload] Closing adapter
2022-09-12 07:16:35.894 - debug: shelly.0 (14874) [onUnload] Stopping CoAP server
2022-09-12 07:16:35.895 - debug: shelly.0 (14874) [BaseServer] Destroying
2022-09-12 07:16:35.895 - debug: shelly.0 (14874) [CoAP Server] Destroying
2022-09-12 07:16:35.896 - info: shelly.0 (14874) terminating
2022-09-12 07:16:35.897 - debug: shelly.0 (14874) Plugin sentry destroyed
2022-09-12 07:16:35.897 - warn: shelly.0 (14874) Terminated (UNCAUGHT_EXCEPTION): Without reason
2022-09-12 07:16:36.001 - error: host.mpi Caught by controller[0]: Error: send Unknown system error -126 192.168.179.112:5683
2022-09-12 07:16:36.001 - error: host.mpi Caught by controller[0]: at doSend (node:dgram:713:16)
2022-09-12 07:16:36.001 - error: host.mpi Caught by controller[0]: at defaultTriggerAsyncIdScope (node:internal/async_hooks:464:18)
2022-09-12 07:16:36.001 - error: host.mpi Caught by controller[0]: at afterDns (node:dgram:659:5)
2022-09-12 07:16:36.001 - error: host.mpi Caught by controller[0]: at processTicksAndRejections (node:internal/process/task_queues:83:21)
2022-09-12 07:16:36.002 - error: host.mpi instance system.adapter.shelly.0 terminated with code 1 (JS_CONTROLLER_STOPPED)
2022-09-12 07:16:36.002 - info: host.mpi Restart adapter system.adapter.shelly.0 because enabled
klein0r commented 2 years ago

nodejs 18 is untested right now (recommended version is 16)

Rookiestyle commented 2 years ago

Installed nodejs v16.17.0 No change in system behaviour, no change in logs

klein0r commented 2 years ago

Is port 5683 already in use on your system?

Rookiestyle commented 2 years ago

192.168.179.112:5683 That's the shelly's IP, how to check whether it is in use or not?

On my raspberry the port is not used

Rookiestyle commented 2 years ago

I removed interface wg0 which was set up when installing and customizing wireguard. Afterwards the shelly adapter could connect to the shelly and controling it is possible again.

Will need to investigate more on my side. Do you by chance have an idea what could interfere here?

Current setup overall: Fritzbox as router with ip 192.168.178.1, subnet 255.255.254.0 All devices like smartphones, ... are in 192.1168.178.xxx including my raspi All smarthome devices like shellys are in 192.168.179.xxxx Wireguard server was set up as 192.168.178.250 and listen on port 55763 (interface wg0)

Rookiestyle commented 1 year ago

I changed my wireguard setup, no issues any longer