OK, so, here's what works and what doesn't.
When I just try: ...it doesn't work. I've tried with and without newline, doesn't make any difference.
Opening port through screen works:After that: ...also works, with and without newline.
I've tried your huge all-parameter port reset:
...and afterwards, this doesn't output anything, just drops me back to prompt:
But! If I do this after that huge port reset command, it works, and afterwards suddenly cat works as well:
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.
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.
When I just try:
Code:
cat </dev/ttyACM0
Opening port through screen works:
Code:
screen /dev/ttyACM0 115200
Code:
cat </dev/ttyACM0
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
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$
Code:
(stty raw; cat) < /dev/ttyACM0
It basically sets baud rate; might be that something in the stack sets some default parameters, but I'm not aware that it does.Might be that “…my app”which “throws NullPointerException” does some configuration of the usb ports ?
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