Dashboard › Code › AVR serial bridge: /dev/ttyUSB0 must al…
019ec737-b90a-7973-b11a-4f71799b7597| Project | Hits | Last recalled |
|---|---|---|
| opencode | 1 | 9d ago |
Trap: when pl2303 module unloads or USB disconnects, devtmpfs removes the char device node. Bridge's _open_session() runs exec 3<>/dev/ttyUSB0 — shell <> operator creates a regular file if path doesn't exist. Regular file permanently shadows the device: writes succeed silently (go to disk, not serial port), termios fails with 'Inappropriate ioctl', reads return stale TX data. Looks like driver bug or AVR not responding. Fix: watchdog (/jffs/scripts/pl2303-watchdog.sh) must verify /dev/ttyUSB0 is a char device ([ -c ]), remove regular-file impostor if present, and mknod the correct char device (major 188, minor 0). _open_session() SSH command exits 3 if not a char device; is_on() treats exit 3 as None (comms failure) — never kills stream.