Преглед изворни кода

Fix $Bye not being sent: flush serial and wait before closing

The serial port was closing before the write buffer was flushed,
so $Config/Filename and $Bye commands never reached the board.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tuanchris пре 4 месеци
родитељ
комит
fde9555e22
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      flash-fluidnc.sh

+ 4 - 1
flash-fluidnc.sh

@@ -335,8 +335,11 @@ try:
     # Set this config as the active one and restart to apply
     time.sleep(1)
     ser.write(b"$Config/Filename=config.yaml\n")
-    time.sleep(0.5)
+    ser.flush()
+    time.sleep(1)
     ser.write(b"$Bye\n")
+    ser.flush()
+    time.sleep(1)
     ser.close()
 
 except Exception as e: