1
votes

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?

Thanks in advance!

5

5 Answers

2
votes

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?

1
votes

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.

0
votes

Using an Arduino, one of mine is:

/dev/tty.usbmodemfa131

The last 5 characters are different for each port.

0
votes

The 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.

-3
votes

many USB->miniUSB cables no has all pins plugged, only Vcc and GND. Them, cables may be the problem