from pathlib import Path import importlib.util,subprocess,time ROOT=Path('/mnt/MediaVolume/home/jadams/src/gitlab.daringbit.com/josh/k230-the-screen-runs-a-shell-not-a-console') out=ROOT/'docs/evidence/splash-uboot-motion' spec=importlib.util.spec_from_file_location('ums',ROOT/'tools/ums-session.py');m=importlib.util.module_from_spec(spec);spec.loader.exec_module(m) s=m.Session('/dev/ttyACM0',115200,str(out/'console.txt')) held=False try: s.port.write(b'\r\n');s.port.flush();time.sleep(.4);s.pump() s.send_line('reboot',kill=False) end=time.monotonic()+20 while time.monotonic()