I am developing a cross-platform User Interface with Qt, and I need to communicate through a serial port.I am able to use the serial port on Windows and Linux by using the following port names:
COM1, COM2, and so on, on Windows;
ttyACM0, ttyS0, ttyS1, etc, on Linux.
Now I want to do the same on Mac OS X. Do you know which are the possible port names on Mac OS X?
Installing a USB Serial Adapter on Mac OS X. You need an application which will talk to the serial port. On Mac, the file which maps to the port is /dev/cu.usbserial. If you have a null modem cable and a terminal program on the other side, the Mac actually has a built-in terminal program called “screen” that you can use to test the. Terminal is a simple serial port (COM) terminal emulation program. It can be used for communication with different devices such as modems, routers, embedded uC systems, GSM phones. - Very small size (246 Kb only), only one Terminal.exe file only, no instalation required.
Thanks in advance!
dsolimano5 Answers
They could be pretty much anything. They'll probably be /dev/tty.SOMETHING
, but there's no guarantee of that. For example, my USB->serial dongle is: /dev/tty.usbserial-FTG6RCEJ
. The last bit of gibberish there is a serial number or something, I think.
Shouldn't you be asking the user for which port to use, anyway?
Carl NorumCarl NorumUsing an Arduino, one of mine is:
/dev/tty.usbmodemfa131
The last 5 characters are different for each port.
David IngledowDavid IngledowThe name of the serial port in OS X is dependant on the driver. It might be something like /dev/tty.USBSERIAL/
and it might be /dev/tty.PL2303-xxx
You might wish to have the user create a symlink such as /dev/tty.MY_APP_USB
that points to their specific serial port.
To use the programmer in Mac OS X, you will need to determine which names have been assigned to its serial ports.
To do this, open a Terminal window, type ls /dev/tty.usb*
, and press enter. You should see two entries of the form tty.usbmodem<number>
(e.g. /dev/tty.usbmodem00022331
). These entries represent virtual serial ports created by the programmer.
The entry with the lower number is your programmer’s Programming Port, and later you will need to pass its name as a parameter to AVRDUDE. The entry with the higher number (which should be two plus the lower number) is the TTL Serial Port, and you can use a terminal program such as screen
to send and receive bytes from it.
If you have other USB devices plugged in, you might see additional serial ports for those devices.
many USB->miniUSB cables no has all pins plugged, only Vcc and GND. Them, cables may be the problem