You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@app.command(help="Like 'ner serial', but with some extra custom features (message filtering, graphing, and monitoring).")
200
+
defserial2(
201
+
ls: bool=typer.Option(False, "--list", help="List available serial devices and exit."),
202
+
device: str=typer.Option("", "--device", "-d", help="Specify the board to connect to."),
203
+
monitor: str=typer.Option(None, "--monitor", help="Opens a monitor window of the specified title. (Note: A monitor window can be created/configured using the serial_monitor() function from serial.c)"),
204
+
graph: str=typer.Option(None, "--graph", help="Opens a live graph window of the specified title. (Note: A graph window can be created/configured using the serial_graph() function from serial.c)"),
205
+
filter: str=typer.Option(None, "--filter", help="Only shows specific messages. Ex. 'ner serial2 --filter EXAMPLE' will only show printfs that contain the substring 'EXAMPLE'. ")):
print(f"[bold red]No USB devices found on {os_name}.[/bold red]", file=sys.stderr)
34
+
ifis_wsl():
35
+
print("\n[blue]If you're using WSL, you may need to attach attach the USB device in a Windows terminal.")
36
+
print("1. Open a Windows terminal [bold blue]with admin privalleges[/bold blue] and enter 'usbipd list'.")
37
+
print("2. Find the device you want to attach (probably named something like 'CMSIS-DAP v2 Interface' or 'USB Serial Device')")
38
+
print("3. Note the device's BUSID and run [bold green]'usbipd bind --busid=<BUSID>'[/bold green]. (If you've mounted the device before, skip this step.)")
39
+
print("4. Then, run [bold green]'usbipd attach --wsl=ubuntu --busid <BUSID>'.")
40
+
print("5. It should work now, so try running the command again.\n")
41
+
sys.exit(1)
42
+
43
+
exceptsubprocess.CalledProcessErrorase:
44
+
print(f"[bold red]Failed to execute command to list USB devices: {e}[/bold red]", file=sys.stderr)
0 commit comments