macosterminalarduinocommunicationbaud-rate

How to set the baud rate for Macs in a terminal


Is it possible to set the baud rate for Macs in a terminal? If yes, how to set the baud rate in terminal through the terminal?

I am trying to talk to the Mac using an Arduino (open source microcontroller), an XBee (wireless communicator) to type in the terminal through the serial monitor. The only problem I am having is the baud rate of the serial monitor and terminal are different. I can easily change the baud rate for the serial monitor in the Arduino, but I do not know what the baud rate is for the terminal in Mac.


Solution

  • On Mac OS, stty seemingly can only change terminal settings for an ongoing access.

    It works to either:

    This only seems to work for the /dev/cu.* device files. I don't know the difference from /dev/tty.* files.