I have a problem with TTY device on MAC. I created a script which talks to Arduino and works well on Linux. Problem I'm having with MAC is I can't "fopen" the device. For example, if I do
echo "foo" > /dev/tty.usbmodem1431
It hangs forever blocking the port. It works well from Arduino's Serial Monitor so theoretically I should be able talking to it.
OK. I found the solution. I have to write to
/dev/cu.usbmodem1431
I still don't know why TTY don't want to work.
You can use tty with:
stty -f /dev/tty.usbmodem1431 cs8 115200 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts
echo "hello" > /dev/tty.usbmodem1431
Where 115200 is your Serial.begin speed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With