开发者

How can I send a string to serial /dev/tty.* port, delay a second, disconnect from the port and continue my bash script in OSX?

This is in relation to resetting an Arduino, and then start pushing data to it from my usb xbee. I've tried using screen, with no luck.

screen -S Xbee -d -m /dev/tty.usbserial-A900fra9 115200 *reset

I don't know how to close this session, not sure whether the args are correct, ei开发者_运维知识库ther.


to send anything to devices on /dev, you can use the > >> 2> 2>&1, etc.

Try this example from tty1 (ctrl+alt+F1):

echo "my string" > /dev/tty2

now go to tty2 (alt+F2) and you gonna see your string. It should work with any device. and to sleep, use:

sleep 1

your problem could be also with permissions. Try it with root! ;)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜