Open KennethEgholm opened 4 years ago
How do you mean stop working? Does it fail when starting, or does it suddenly stop working while running? Are there any errors?
It fails after running in several days. I can monitor it the next time it happens. How/where do I look for logs of errors?
I guess something like this? systemctl status pellmonMQTT -n20
I don't know much about systemd, but I think it can collect things written to stderr and put it somewhere (when used to daemonize something that doesn't know it has been deamonized). Otherwise you could run pellmonMQTT in the foreground (started from a terminal I mean). Then you can see if there is a python exception at least. It's also easy to add print statements here and there to see what happens.
You could verify that pellmon is still working (try changing settings from the pellmon webinterface, and from the pellmoncli command line client). If that works then it must be something with the broker->pellmonmqtt that isn't working anymore.
Doing some googling... The subscription should probably be in the on_connect method, otherwise it doesn't resubscribe when autoconnecting to the broker after a lost connection.
Yeah, firstæy - it is the MQTT that stops working - as I have tried manipulating the parameters directly from the webinterface - and that worked perfectly.
And yes- that would fit the bill perfectly - I have had some outages in the wifi connections.
Can you check with the latest master? At least it now tries to resubscribe after reconnected...
I will try it out today - thanks for your fast action..
FYI: I ran it in the foreground for a while and it seems to work af before at least :) :) (I saw that you changed the topic to "pellmon2" so I have changed my sensors to listen to that as well :) It is now running as a service, so will let you know how it goes ..
Oh, sorry about the pellmon2... I changed it for debugging on my laptop when I remembered I probably have another instance already running on an raspberry somewhere... Easier to debug on a laptop but I didn't mean to commit that. If this works then maybe it would be a good time soon to try to make this into something real with a config file to control what gets published and subscribed. I suppose it would be good to have encryption also, but I haven't looked into how to enable it.
No worries at all. If I can help with testing and such, I will be happy to do so. I think it will be solid now. Yes, config would be great, and encryption as an option would also be great. Thanks for your effort!
I have seen a few times now that the PellMonMQTT service stops working in the "Subscribe and resend to PellMon" part - but the "Publish on MQTT" works just fine still. After a restart of the service operation is back to normal.