diff --git a/aliases.txt b/aliases.txt index 47bf4b9..b19c22a 100644 --- a/aliases.txt +++ b/aliases.txt @@ -1,4 +1,5 @@ build="docker compose run --rm ner-gcc-arm make" -cerbcon="sudo usbip attach -r 192.168.100.12 -b 1-1.3" -shepcon="sudo usbip attach -r 192.168.100.12 -b 1-1.4" -peyton="echo \" Shut the fuck up Peyton, fucking hell\" " \ No newline at end of file +cerbcon="sudo modprobe vhci_hcd && sudo usbip attach -r 192.168.100.12 -b 1-1.3" +disconnect="sudo usbip detach -p 0" +shepcon="sudo modprobe vhci_hcd && sudo usbip attach -r 192.168.100.12 -b 1-1.4" +peyton="echo \" Shut the fuck up Peyton, fucking hell\" " diff --git a/miniterm.py b/miniterm.py index 6e11d8b..5e8e000 100644 --- a/miniterm.py +++ b/miniterm.py @@ -23,7 +23,8 @@ def list_usb_devices(): elif os_name == 'Linux' or os_name == 'Darwin': # Darwin is macOS # List USB devices on Unix-like systems try: - result = subprocess.run(['ls', '/dev/tty*'], capture_output=True, text=True) + result = subprocess.run(['ls /dev/tty*'], shell=True, capture_output=True, text=True) + devices = [device for device in result.stdout.splitlines() if 'ttyUSB' in device or 'ttyACM' in device] return devices except Exception as e: @@ -34,10 +35,10 @@ def list_usb_devices(): print(f"Unsupported operating system: {os_name}", file=sys.stderr) sys.exit(1) -def run_miniterm(device, baudrate=9600): +def run_miniterm(device, baudrate=115200): """Run pyserial-miniterm with the specified device and baudrate.""" try: - subprocess.run(['pyserial-miniterm', device, '--baud', str(baudrate)], check=True) + subprocess.run(['pyserial-miniterm', device, str(baudrate)], check=True) except subprocess.CalledProcessError as e: print(f"Failed to run pyserial-miniterm: {e}", file=sys.stderr) sys.exit(1) @@ -58,4 +59,4 @@ def main(): run_miniterm(selected_device) if __name__ == '__main__': - main() \ No newline at end of file + main()