Fix to allow canBUS MCUs to connect and disconnect mid print#905
Fix to allow canBUS MCUs to connect and disconnect mid print#905akitbalian wants to merge 1 commit into
Conversation
|
Thanks for the PR. I reviewed the diff and reproduced the shutdown path on a real printer.
The _handle_shutdown change has two problems, both reproduced:
Same defect class as #870, fixed by #918:
suggestion: rebase on main once #918 lands and drop the One related heads-up: while testing CAN bus loss, I also reproduced the canbus_stats crash from #900 (the periodic query can be in flight when the connection drops, so the existing non_critical_disconnected check can't catch it) and #918 guards that path too. Without it any CAN disconnect can still take klippy down before the reconnect machinery gets a chance. |
|
Hi! So pardon if I make any mistakes (first ever PR for me) - I did run the rebase as #919 looks like it has been committed. I do see that it has shrunk to the _handle_shutdown. I won't be able to test the code with out the self._is_shutdown = False until a few days out. I removed that part as per your suggestion, and I think it all looks good now. But if I made any mistakes please let me know! Note the rebase also dropped my serialhdl.py / canbus_stats.py changes — I'll take another look at whether anything there is still needed once #918 is in, and open a separate PR if so. Thanks for taking care of the other stuff! -AK |
|
Also — I just noticed my PR description mentions serialhdl.py / canbus_stats.py changes that aren't actually in the diff; those are still uncommitted on my machine and never made it in. So your test was of the mcu.py change alone. I'll check whether the reconnect timer change is still needed once I'm on current main with #918, and open a separate PR if it is. Updating the description now. |
Modified a number of files that were causing issues when an MCU is connected/disconnected mid print or between prints.
This allows for example disconnecting an MCU on the carriage for toolchanged. In my specific case this was with Cartographer but should apply to any MCU.
Main change description: (also in the commit)
Also modified the behavior on reconnect timer in serialhdl.py
and canbus_stats.py. This was causing time out errors because it was configured to wait for 1 second for a reconnect (changed to 0.1s)
Checklist
if new feature, added to the readme