Bob-ob
Bob-ob

Reputation: 1618

How to find the serial port number on Mac OS X?

I have just started experimenting with Serproxy and Arduino to get some serial data into Flash Builder/Flex. Serproxy seems to work fine and seems to connect to whatever port is specified. However, I am not able to see or read any data from the serial port using ActionScript. This is odd, because the Arduino should be printing data on a loop.

The only thing I can think of is that I am not setting the correct serial port number. I have been trying to figure out how to find out what number should be set, that is, 5331, 5332, 5333, etc.

How do I find out the port number? Is there a way to do this using Terminal on OS X maybe?

Upvotes: 47

Views: 246585

Answers (7)

Janzaib M Baloch
Janzaib M Baloch

Reputation: 1353

Let me share a much fun way for watching your serial port on Mac.

Step1: Run this command in your terminal with your device connected and then run with your device not connected ls /dev/tty.* . Which ever port appear/disappears, that one is the port you are wanting to work with For e.g /dev/tty.URT2 in my case.

Step2: Go to Mac App Store and install Termius. It is a really cool and aesthetic application for watching your ports and performing other types of experimentation.

Step3: Start Termius, Click on Hosts tab, then click on Serial button, then pick your Serial Port from the dropdown and select Baudrate.

Step4: Press Connect. Wollah, you are watching your port now.

Upvotes: 0

Nadi Hassan
Nadi Hassan

Reputation: 520

Try this: ioreg -p IOUSB -l -b | grep -E "@|PortNum|USB Serial Number"

Upvotes: 27

Taha Ali
Taha Ali

Reputation: 487

Found the port esp32 was connected to by -

ls /dev/*

You would get a long list and you can find the port you need

Upvotes: -1

Prajwal Athreya
Prajwal Athreya

Reputation: 1

While entering the serial port name into the code in arduino IDE, enter the whole port address i.e:

/dev/cu.usbmodem*

or

/dev/cu.UG-*

where the * is the port number.

And for the port number in case of mac just open terminal and type

ls /dev/*

and then search for the port that u have set in arduino IDE.

Upvotes: 0

Harm
Harm

Reputation: 31

mac os x don't use com numbers. you have to use something like 'ser:devicename' , 9600

Upvotes: 3

Bob-ob
Bob-ob

Reputation: 1618

I was able to screen using the device's name anyway so that wasn't the issue. I was actually just trying to find the port number, i.e. 5331, 5332 etc. I managed to find this by a trial and error process using an app called TCP2Serial from the app store on Mac OS X. It isn't free but that's fine as long as I know it works!

Worth the 99c :) http://itunes.apple.com/us/app/tcp2serial/id506186902?mt=12

Upvotes: 3

Sr.Richie
Sr.Richie

Reputation: 5740

You can find your Arduino via Terminal with

 ls /dev/tty.*

then you can read that serial port using the screen command, like this

screen /dev/tty.[yourSerialPortName] [yourBaudRate]

for example:

screen /dev/tty.usbserial-A6004byf 9600

Upvotes: 112

Related Questions