Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5802

Troubleshooting • Re: USB ports not working after reinstall to newest Bookworm

$
0
0
OK, so, here's what works and what doesn't.

When I just try:

Code:

cat </dev/ttyACM0
...it doesn't work. I've tried with and without newline, doesn't make any difference.

Opening port through screen works:

Code:

screen /dev/ttyACM0 115200
After that:

Code:

cat </dev/ttyACM0  
...also works, with and without newline.

I've tried your huge all-parameter port reset:

Code:

stty -F /dev/ttyACM0 115200 min 0 -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke -flusho -extproc
...and afterwards, this doesn't output anything, just drops me back to prompt:

Code:

$ stty -F /dev/ttyACM0 115200 min 0 -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke -flusho -extproc$ cat </dev/ttyACM0$
But! If I do this after that huge port reset command, it works, and afterwards suddenly cat works as well:

Code:

(stty raw; cat) < /dev/ttyACM0
I'm not sure what all that means. I'm guessing that by default, some port parameter is incorrectly set. It makes sense that both screen and your reset port command + stty raw override that. Unfortunately my app still doesn't work, I'll try to find how I can set all those parameters while opening port through the app as well, which will be pain in the ass.
Might be that “…my app”which “throws NullPointerException” does some configuration of the usb ports ?
It basically sets baud rate; might be that something in the stack sets some default parameters, but I'm not aware that it does.

However I've ruled out any interference by app by simply not running it at all after reboot, or before any of tests here. In other words, it's not my app that breaks the port, it's OS itself, which is unfortunate as opening port correctly should work by default.

Statistics: Posted by domchi — Thu Nov 07, 2024 2:22 am



Viewing all articles
Browse latest Browse all 5802

Trending Articles