t0nyz0 / BambuBoard

Bambu Dashboard for viewing near real time data from the Bambu X1 Carbon 3D printer.
https://t0nyz.com/projects/bambuboard
MIT License
37 stars 6 forks source link

Gracefully recover after printer goes offline #7

Closed mtehonica closed 3 months ago

mtehonica commented 3 months ago

When the printer is rebooted and becomes unreachable, the service doesn't appear to recover on its own. It requires restarting the application to recover.

Connection error: Error: read ECONNRESET
Connection error: Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
t0nyz0 commented 3 months ago

I've noticed this myself. I'll see if I can provide a fix in the next version.

t0nyz0 commented 3 months ago

I just released v1.0.8. In this version I've rebuilt the connection/disconnection/error retry logic. After my limited testing everything seems to be much more stable. The dashboard automatically comes back online once the printer is available.

Let me know if you run into any issues.