Apollon77 / ioBroker.nut

NUT (network UPS Tools) Adapter for ioBroker
MIT License
9 stars 5 forks source link

Reconnect adapter #152

Closed igorgsh closed 1 year ago

igorgsh commented 1 year ago

Is your feature request related to a problem? Please describe. The UPS is connected to the remote server, which is sometimes unavailable. NUT driver indicates then no connection to the device. It is ok. But this driver doesn't try to reconnect the device

Describe the solution you'd like Add the possibility of reconnecting to UPS periodically

Describe alternatives you've considered Create a script that pings the device and restarts a driver.

Apollon77 commented 1 year ago

Sorry but this makes no sense. The adapter do not have a standing connection at all but polls the device in the defined interval. Please provide a debug log of such a situation where it do not poll after the device came back (in the defined interval)

igorgsh commented 1 year ago

Unfortunately, it happens again. See the log attached. Some pre-requisites. The iobroker started at 06:05, but the server, where NUT is running, started later (~06:10). The polling interval for nut is set to 300. There is 06:56 right now, but nut is not restarted yet and you can see, there are no mention of the nut in the log since 06:05. Few screenshots https://i.imgur.com/sq2Z3LV.png. The status of ups was not updated since yesterday https://i.imgur.com/aEjmYD6.png iobroker.2022-12-07.log.zip

igorgsh commented 1 year ago

I have blackouts a few times per day right now and I should mention that in sometimes nut is reconnected to the server but in the biggest number of cases it is not reconnected.

Apollon77 commented 1 year ago

oK, Hm ... good catch ... The issue only happens if the usv is unavailable on start of the adapter because then he can not initialize all details from the usv. He indeed successfully updates when it was started correctly once. I will come back here when I have a fix

Apollon77 commented 1 year ago

Please try the GitHub version if this works now and provide Feedback

igorgsh commented 1 year ago

Thank you so much. It seems like it is working. At least, I have 3 successful cases, when the adapter reconnects to the nut server.

Apollon77 commented 1 year ago

Cool thank you, will release it