hxmelab / node-red-contrib-bosch-shc

Bosch Smart Home Controller (SHC) nodes for Node-Red
https://flows.nodered.org/node/node-red-contrib-bosch-shc
MIT License
20 stars 6 forks source link

Nodes go offline after time #9

Closed danielstroehmann closed 4 years ago

danielstroehmann commented 4 years ago

Nodes go offline (status: "disconnected") after hours/days of usage.

Might be because to receiving an upload on the smart home controller? Nodes never recovered even BOSCH system ist working fine. Restart or re-deploy without any other changes successfully reconnected the nodes.

12 Jan 17:42:52 - [info] [shc-config:36aa8089.711ec8] Long polling SHC: XXX.XX.XXX.XX with poll Id: e7ejd3chh-342
15 Jan 07:44:47 - [error] [shc-config:36aa8089.711ec8] Error: connect EHOSTUNREACH XXX.XX.XXX.XX:8444
15 Jan 07:45:10 - [error] [shc-config:36aa8089.711ec8] Error: connect EHOSTUNREACH XXX.XX.XXX.XX:8444
15 Jan 07:45:33 - [error] [shc-config:36aa8089.711ec8] Error: connect EHOSTUNREACH XXX.XX.XXX.XX:8444
15 Jan 07:45:56 - [error] [shc-config:36aa8089.711ec8] Error: connect EHOSTUNREACH XXX.XX.XXX.XX:8444
15 Jan 07:46:19 - [error] [shc-config:36aa8089.711ec8] Error: connect EHOSTUNREACH XXX.XX.XXX.XX:8444
15 Jan 07:46:43 - [error] [shc-config:36aa8089.711ec8] Error: connect EHOSTUNREACH XXX.XX.XXX.XX:8444
holomekc commented 4 years ago

Maybe related to the issue of bosch-smart-home-bridge. My problem is that it looks like node https does not recognize the connection loss. I do not get any feedback from the library when bshc restarts. I tried to workaround this issue with setting the connection timeout to the long polling interval: https://github.com/holomekc/bosch-smart-home-bridge/blob/master/CHANGELOG.md#024---2020-01-06

So what i want to say. Maybe updating to newer version might help.

hxmelab commented 4 years ago

Thanks holomekc, I updated the bshb lib. The connection handling now seems to work properly.

@danielstroehmann With an update to version 0.1.12 the problem should be solved.

MrDj200 commented 4 years ago

I updated a few day ago, but this night the nodes went offline again for no reason. I am running version 0.1.12 of this.

So unfortunately the update did not fix it (atleast for me)

hxmelab commented 4 years ago

Did you receive an update of the SHC last night? Could you please check the Node-RED logs and post the output here. If the logs are outdated, can you please try it again, by just disconnecting the SHC for a while and reconnect it again, by simply removing the network cable.

MrDj200 commented 4 years ago

I saw your answer too late. I paired this module again to my shc, since I was getting this in the console: [shc-config:1d1a2724.731b49] Please create a new SHC Configuration (shc-config) with IP 192.168.178.43 and delete this one. The version of this Configuration will expire soon.

Does this have any chance of fixing it, or should I still expect disconnects?

Also, someone else made changes in the app, which broke my node-red flow without me knowing, that could've been the culprit aswell.

hxmelab commented 4 years ago

The nodes work the same way with the old configuration. There shouldn't be any difference in the connection stability.

I am not sure what you mean with the following:

Also, someone else made changes in the app, which broke my node-red flow without me knowing, that could've been the culprit aswell.

What changes and which app do you mean? Is this related to the problem described here?

MrDj200 commented 4 years ago

They changed some settings in the SmartHome app from Bosch. That also broke some other things and unfortunately I don't know, and neither do they, what exactly they changed, so I don't know if it's related.

If I notice that the disconnects keep happening, I'll post the logs here, assuming I can find them.

hxmelab commented 4 years ago

Ok, just open the console where your Node-RED instance is running on and type: node-red-log

hxmelab commented 4 years ago

I could reproduce the error. The reconnection should be fixed with version 0.1.13.

danielstroehmann commented 4 years ago

Thanks for the fix. Seems to be stable now.