b3nn0 / hassio-addon-ism7mqtt

HomeAssistant Addon for running ism7mqtt to fetch data from Wolf heaters
Apache License 2.0
22 stars 3 forks source link

Addon quite regularly stops running #3

Closed infocfc closed 1 year ago

infocfc commented 1 year ago

Hi.

Every once in a while, every few days, I notice that the values I get from ism7mqtt stop changing in HA, and when I look, I realize the addon has just stopped running, despite the addon settings "Start on Boot" and "Watchdog" in HA are both enabled. I can just restart it manually and then it runs fine again for a few days when that happens.

This happens just during normal operation, without any activity like updating or restarting HA itself. I've tried to find a hint in the logs, but didn't see anything.

Currently running HASSOS 9.3 /Core 2023.1.5 on VMWare.

b3nn0 commented 1 year ago

Hmm cannot reproduce unfortunately, it's running rock solid for me. If the Add-on stops, that would mean that ism7mqtt itself stopped (crashed?), and then the Add-on will quit. Can you post the Add-on log output to confirm that? Maybe I could restart it automatically if it quits, instead of quitting the add-on...

infocfc commented 1 year ago

Is there a way to get to prevoius logs via the filesystem maybe? Otherwise I'll have to wait 'til it happens next time.

b3nn0 commented 1 year ago

if you have the ssh add-on installed and given admin privileges, you can connect via SSH and run docker logs -f addon_bf7963f0_ism7mqtt But it's the same as in the web interface.

infocfc commented 1 year ago

In the webinterface, the logs only cover the currently running instance, nothing that happened before, so I have to wait for the next time.

b3nn0 commented 1 year ago

FYI: I now implemented auto-restarting of ism7mqtt if it ever quits by itself. Feel free to try it, and check the log from time to time - it will tell you if ism7mqtt exited unexpectedly and was restarted.

Please report back if that solves the issue for you.

infocfc commented 1 year ago

Ok, I'll try it and report. Thanks.

infocfc commented 1 year ago

And while chekcing for the update, I realized it's stopped again. Here's the log:

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started ++ echo '{' '"Devices":' '[' '{' '"ReadBusAddress":' '"0x8",' '"DeviceTemplateId":' 18000, '"Parameter":' '[' 18150, 18149, 18140, 18123, 18156, 18157, 18032, 18161, 18122, 18005, 18006, 18008, 18012, 18016, 18025, 18026, 18027, 18033, 18034, 18035, 18051, 18054, 18068, 18102, 18110, 18113, 18114, 18115, 18116, 18117, 18118, 18119, 18120, 18121, 18124, 18125, 18126, 18127, 18128, 18129, 18130, 18131, 18132, 18133, 18134, 18135, 18136, 18137, 18138, 18139, 18141, 18142, 18143, 18145, 18148, 18152, 18154, 18155, 18158, 18159, 18160, 18162, 18163, 18164, 18165, 18166, 18167, 18168, 18169, 18170, 18171, 18172 ']' '},' '{' '"ReadBusAddress":' '"0x35",' '"DeviceTemplateId":' 22000, '"Parameter":' '[' 22043, 22044, 22045, 22046, 22091, 22107, 22108, 22104, 22001, 22019, 22021, 22022, 22023, 22025, 22026, 22027, 22028, 22029, 22030, 22031, 22032, 22033, 22034, 22035, 22042, 22095, 22103, 22117, 22126, 22127, 22134, 32042, 32043, 32044, 32045, 32046, 32047, 32048, 32049, 32050, 32051, 32052, 32053, 32054, 32055, 32056, 32057, 32058, 32059, 32060, 32061, 32062, 33000, 33001, 33002, 33003, 33004, 33005, 33006, 33007, 33008, 33009, 33010, 33011 ']' '},' '{' '"ReadBusAddress":' '"0x76",' '"DeviceTemplateId":' 6000, '"Parameter":' '[' 6000, 6008, 6039, 6044, 6001, 6002, 6003, 6004, 6005, 6006, 6007, 6012, 6013, 6014, 6015, 6016, 6018, 6019, 6020, 6021, 6022, 6023, 6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 6035, 6038, 6045, 6046, 6050, 6051, 6052, 6053, 6058, 6059, 6060, 6063 ']' '},' '{' '"ReadBusAddress":' '"0x35",' '"DeviceTemplateId":' 34000, '"Parameter":' '[' 34033, 34004, 32000, 32001, 32002, 32003, 32004, 32005, 32006, 32007, 32008, 32009, 32010, 32011, 32012, 32013, 32014, 32015, 32016, 32017, 32018, 32019, 32020, 34000, 34001, 34005, 34006, 34007, 34008, 34009, 34010, 34011, 34012, 34013, 34014, 34015, 34016, 34026, 34029, 34031, 34032, 34035, 34040, 34041, 34043 ']' '},' '{' '"ReadBusAddress":' '"0x00",' '"DeviceTemplateId":' 19000, '"Parameter":' '[' 19000, 19001, 19002, 19003, 19004, 19007, 19011, 19012, 19014, 19015, 19016, 19019, 19020, 19021 ']' '},' '{' '"ReadBusAddress":' '"0x35",' '"DeviceTemplateId":' 35000, '"Parameter":' '[' 32021, 32022, 32023, 32024, 32025, 32026, 32027, 32028, 32029, 32030, 32031, 32032, 32033, 32034, 32035, 32036, 32037, 32038, 32039, 32040, 32041, 35001, 35004, 35009, 35012, 35014, 35015, 35016 ']' '}' ']' '}' ++ ISM_ARGS='--hass-id=Wolf-CGB2 --interval=60 -t /parameter.json' ++ [[ false == \t\r\u\e ]] ++ echo 'Starting ism7mqtt --hass-id=Wolf-CGB2 --interval=60 -t /parameter.json' ++ cd /app ++ /app/ism7mqtt --hass-id=Wolf-CGB2 --interval=60 -t /parameter.json Starting ism7mqtt --hass-id=Wolf-CGB2 --interval=60 -t /parameter.json System.IO.IOException: Unable to read data from the transport connection: Connection reset by peer. ---> System.Net.Sockets.SocketException (104): Connection reset by peer --- End of inner exception stack trace --- at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 ) at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](TIOAdapter ) at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](TIOAdapter , Memory1 ) at ism7mqtt.Ism7Client.FillPipeAsync(PipeWriter target, CancellationToken cancellationToken) in /app/ISM7/Ism7Client.cs:line 167 s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped`

So this looks like a (temporary) communication issue with the my heating. Which of course can happen, although it's all wired in my case (no Wifi). But the network of the wolflink is flaky, I've noticed that before.

b3nn0 commented 1 year ago

So yes, ism7mqtt is just quitting in that case it seems. For me, the ism7 Wifi was extremely unstable, but since I switched to cable, I had no connection issues.

Anyway, the latest version should help with that and just restart ism7mqtt 10 seconds later whenever it exits. Feel free to check the logs from time to time to see if it works correctly.

You might want to report this to zivilian/ism7mqtt anyway, because I think exiting is not really desirable?