How to find /dev/ name of USB Device for Serial Reading on Mac OS?

Maxwell Smith

I am trying to plug in a device into my Macbook and connect to it to read it's serial port. I know the device connects on baudrate 115200.

Currently, I run the command

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

I can see the embedded device plugged in

+-o Root Hub Simulation Simulation@14000000
| +-o iBridge@14200000
| |     "PortNum" = 2
| +-o USB2.0 Hub@14100000
|   |   "PortNum" = 1
|   +-o 4-Port USB 2.0 Hub@14120000 
|   | |   "PortNum" = 2
|   | +-o MBED CMSIS-DAP@14122000
|   |       "PortNum" = 2
|   |       "USB Serial Number" = "024002267822ce0a00000000000000000000000085fb33b2"
|   +-o USB Keyboard           @14110000 
|         "PortNum" = 1
|         "USB Serial Number" = "0000000000000001"

note: There's a tag close to

<class AppleUSBDevice, id 0x100014343, registered, matched, active, busy 0 (363 ms), retain 33>

next to every device's name above, but I removed them for formatting issues (as I don't think they're related to the question). In the event they are, that is the tag for my embedded device).

The Question

How would I find out the MBED device's association in /dev/?

I am trying to find the device MBED CMSIS-DAP@14122000 inside the /dev/ directory, so that I can read its serial output. This is where I am lost.

The end goal is that I could use screen or putty or something similar to:

screen /dev/ttyTHIS_MBED_DEVICE 115200

Maxwell Smith

So, I actually found the answer.

To find out what the device name is, I did an ls of the /dev/ directory with the device plugged in and then with it disconnected.

ls -lha /dev/tty* > plugged.txt
ls -lha /dev/tty* > np.txt

Then I compared the files using

vimdiff plugged.txt np.txt

And saw the line

crw-rw-rw- 1 root wheel 19, 30 Jan 16 15:24 /dev/tty.usbmodem145222

Sure enough, the device is named tty.usbmodem145222!

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Error overflow reading serial number of USB device

How to find the parent USB device of a serial port under macOS?

Need to find and open a USB serial device on linux

How to get the USB VID, PID and serial number of a device in Ubuntu using C++ from /dev/xxx path

Find /dev entry with VID/PID of USB device

One USB device, two serial interfaces: how to?

Redundancy when reading USB serial port (C;Mac OSX;Arduino)

mac os x - usb hid - how the receive device added / device removed callbacks?

How to retrieve the name of an usb device

IOKIT Detecting BSD(unix) name for USB Serial Device with PID and VID

How to give a custom name to a serial device on connection?

Kernel recognizes USB device but then I can't find it in /sys or /dev

How do I access a USB serial port without an entry in /dev?

How can I get USB device serial number from iserialnumber?

Create serial console on plug in USB serial device

Fake serial number of USB device

Mac, list the usb port name that my device is connected to

How to bind USB device under a static name?

How to assign symlinks to serial devices from usb-to-serial device CP2105?

Assigning name to usb device

How can I find out the COM number of a serial device?

How to make an/a (API or driver) to handle all the USB serial request on the USB-device side in Linux?

How to find type of device with mac address?

How do I find the Serial Number of a USB Drive?

PyUSB: reading from a USB device

How to modify an USB stick in order to have a device node as /dev/sda1 instead of /dev/sda?

webAPI - Serial Device via USB converter

Bind serial device address to specific usb port

System.USB: serial port from Device

TOP Ranking

HotTag

Archive