diff --git a/5G_MODEM_TROUBLESHOOTING.md b/5G_MODEM_TROUBLESHOOTING.md index 6aee74c..4cf4fd1 100644 --- a/5G_MODEM_TROUBLESHOOTING.md +++ b/5G_MODEM_TROUBLESHOOTING.md @@ -233,6 +233,12 @@ chown root:dialout /dev/ttyUSB1 **Prevention:** `connect-5g.sh` now checks and fixes a broken AT port automatically before use (recreates the device node if it is a regular file). +### Stray /dev/ttyUSB file (no number) + +**Symptoms:** Troubleshoot shows `/dev/ttyUSB` as a regular file (no digit). Real ports are ttyUSB0, ttyUSB1, etc. + +**Fix:** Remove the stray file. The connection script now removes it automatically; you can also run: `rm -f /dev/ttyUSB` + ### ttyUSB3 Shows as Regular File (legacy) **Symptoms:** `ls -la /dev/ttyUSB3` shows `-rw-r--r--` instead of `crw-rw----` diff --git a/scripts/troubleshoot-5g.sh b/scripts/troubleshoot-5g.sh index ff9da12..385c7c1 100644 --- a/scripts/troubleshoot-5g.sh +++ b/scripts/troubleshoot-5g.sh @@ -41,8 +41,8 @@ for d in /dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3 /dev/ttyUSB4 /dev/t [ -e "$d" ] || continue ls -la "$d" 2>/dev/null if [ -f "$d" ] && [ ! -c "$d" ]; then - _n="${d#/dev/ttyUSB}"; _n="${_n#/dev/ttyACM}" - echo " -> BAD: $d is a regular file. Fix: rm $d && mknod $d c 188 $_n && chmod 660 $d && chown root:dialout $d" + case "$d" in /dev/ttyUSB*) _m=188; _n="${d#/dev/ttyUSB}";; /dev/ttyACM*) _m=166; _n="${d#/dev/ttyACM}";; *) _m=188; _n=0;; esac + echo " -> BAD: $d is a regular file. Fix: rm $d && mknod $d c $_m $_n && chmod 660 $d && chown root:dialout $d" fi done if ! ls /dev/ttyUSB[0-9]* /dev/ttyACM[0-9]* 2>/dev/null | grep -q .; then