Skip to content

Commit

Permalink
fix some serial and aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
jr1221 committed Sep 4, 2024
1 parent c34d383 commit 1f91af3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions aliases.txt
Original file line number Diff line number Diff line change
@@ -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\" "
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\" "
9 changes: 5 additions & 4 deletions miniterm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand All @@ -58,4 +59,4 @@ def main():
run_miniterm(selected_device)

if __name__ == '__main__':
main()
main()

0 comments on commit 1f91af3

Please sign in to comment.