Clon1998 / mobileraker_companion

Companion for mobileraker, enabling push notification.
MIT License
209 stars 12 forks source link

Docker companion on separate host - no notifications after klipper host boot #78

Closed pwlgrzs closed 2 months ago

pwlgrzs commented 9 months ago

Hello,

I am running mobileraker_companion in docker on a separate host. Klipper host is a separate machine that I turn off during night time. I noticed that I will receive no notifications from companion until I restart the container, however in the logs I can see it's picking up the printer once klipper host is started.

Here's the last log from the container, as expected there's a good number of failed to connect errors ending with the companion reaching out to klipper host once I powered it on. I've done several prints since then and got 0 notifications. Then I restarted container and as visible in the logs I am getting notifications again.

mobileraker_logs.txt

Clon1998 commented 8 months ago

Hey, Sorry for my late reply.

At the very bottom of the log, I can see that notifications are issued. If I understood your description correctly, after the logged notifcations, you started several other prints, and the container/companion did not issue any additional notifications until you restarted it?

Johnnytk36 commented 7 months ago

Just letting you know, I am having the same issue. I have had to restart the docker container for mobileraker on my Synology NAS after restarting my sonic pad, or i don't get the push notifications.

Clon1998 commented 7 months ago

Apr 8, 2024

Ill try to debug the container in my machine later this week. Can you confirm that it is working fine for one print, but as soon as you start another the container requires a restart?

Clon1998 commented 7 months ago

@Johnnytk36

Apr 8, 2024

Ill try to debug the container in my machine later this week. Can you confirm that it is working fine for one print, but as soon as you start another the container requires a restart?

Johnnytk36 commented 7 months ago

@Clon1998 I'll try and do some testing with this for you. I haven't noticed that. Off the top of my head, as soon as i restart the sonic pad, mobileraker doesn't send any push notifications, till i restart the container.

Johnnytk36 commented 2 months ago

I just wanted to let you know this is still an issue. As far as i can tell it doesn't work as soon as the sonic pad is rebooted.

Clon1998 commented 2 months ago

Sorry for the delay in looking into this. I got caught up with other stuff. I found the root cause of the problem and fixed it. Turns out, the issue wasn't with the docker image but with the websocket client not properly sending the disconnect event to all services. This meant that the data sync service, which receives state updates from the printer, wasn't re-subscribing to status updates.

Johnnytk36 commented 2 months ago

@Clon1998 Sorry, i have been printing 24/7 lately. Just had a chance to try this. Your fix seems to have work. I can't recreate the error now.

Thank you!