Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serial port names on Mac OS X

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!

like image 594
Mikael Avatar asked Sep 18 '25 01:09

Mikael


2 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?

like image 66
Carl Norum Avatar answered Sep 19 '25 17:09

Carl Norum


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.

like image 20
Rupesh Harode Avatar answered Sep 19 '25 17:09

Rupesh Harode