Using socat for raw serial connection

≯℡__Kan透↙ 提交于 2019-12-03 16:47:08

As Austin Phillips says, you can use stty sane to recover...

...but what is even better is that you can (probably) append it to your socat command as socat xxxxx ; stty sane and have the recovery be automatic when you quit with ctrl-c.

Thanks, that worked for me! I just want to point out that the script should not rely on "static" console identification, because when expect spawns the script, it is going to have a completely different tty, therefor:

socat $(tty),raw,echo=0,escape=0x03 /dev/ttyS2,raw,echo=0,nonblock ; stty sane

edit: nonblock also solved the "enter" problem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!