Talking to modem with AT commands on android

那年仲夏 提交于 2019-12-05 10:23:23

I suggest that you try to send AT command using the atinout program, e.g. instead of redirecting output to the modem device run

echo "ATD12345678900;" | atinout - /dev/ttyGS0 -

I am guessing, but it could be that the echo command in the adb shell does not interpret \r as anything special (that would at least explain no response whatsoever). By using atinout you are guarantied that AT command lines are properly terminated with \r and capturing should be simpler and work much more reliably.

please try different ports available to check the results.

in my android its working under /dev/pts/7 port number.

also use different terminal to read and write

Terminal 1 :

echo -e "AT\r" > /dev/pts/7

Terminal 2 :

cat /dev/pts/7

also try using executing as a root user.

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