Reputation: 2914
I'm able to see serial ports in Terminal:
ls /dev/tty.*
also in OSX: preferences system -> network.
But the names are different, Ex: /dev/tty.usbserial-26223B and Quad RS232-HS 24
I have 64 ports, so I don't know which one is the good one...
Upvotes: 2
Views: 615
Reputation: 14056
I'm actually not sure how did you manage to get the serial device in the preferences system > network
section. Maybe it was a feature in the older version of macOS which I'm not aware of?
In macOS Mojave 10.14.6 one can see the serial devices in the system reports section:
but as you truly mentioned it does not report the actual serial port which can be listed through the ls /dev/{tty,cu}.*
command. Apart from the system_profiler
command, there is also the ioreg
which can be used in the below format to list many information about the serial port device:
ioreg -r -c IOUSBHostDevice -l | grep -E "@|IOTTYDevice|idProduct|idVendor|USB Vendor Name|USB Product Name"
Now one could try to use awk/sed/grep
to further clean up the "hierarchical registry structure as an inverted tree" information. this is as far as I could get with the cripled version of sed on macOS terminal/bash:
sed -E -n -e 's/^(\+-o .*) <.*$/\1/p' -e 's/^( \| "idProduct" = [0-9]+)$/\1/p' -e 's/^( \| "USB Product Name" = .+)$/\1/p' -e 's/^( \| "USB Vendor Name" = .+)$/\1/p' -e 's/^( \| "idVendor" = [0-9]+)$/\1/p' -e 's/^( "IOTTYDevice" = .+)$/\1/p'
Upvotes: 1
Reputation: 1861
The serial ports should all have a corresponding /dev/cu.*
device (Call-Up). If you're looking for a particular device connected by USB, maybe your easiest route is check the /dev
devices with it disconnected, then connect it and check again.
You can also use system_profiler
to look for info on what is using a /dev/tty.*
device, e.g. running system_profiler 2>&1 | tee system.profiler.log
and searching for /dev/tty
I see:
| +-o IOSerialBSDClient <class IOSerialBSDClient, id 0x100000471, registered, matched, active, busy 0 (0 ms), retain 5>
| {
| "IOClass" = "IOSerialBSDClient"
| "CFBundleIdentifier" = "com.apple.iokit.IOSerialFamily"
| "IOProviderClass" = "IOSerialStreamSync"
| "IOTTYBaseName" = "Bluetooth-Modem"
| "IOSerialBSDClientType" = "IOModemSerialStream"
| "IOProbeScore" = 0x3e8
| "IOCalloutDevice" = "/dev/cu.Bluetooth-Modem"
| "IODialinDevice" = "/dev/tty.Bluetooth-Modem"
| "IOMatchCategory" = "IODefaultMatchCategory"
| "IOTTYDevice" = "Bluetooth-Modem"
| "IOResourceMatch" = "IOBSD"
| "IOGeneralInterest" = "IOCommand is not serializable"
| "IOTTYSuffix" = ""
| }
However, the network information is separate, this corresponds to what you see in the preferences GUI:
Bluetooth PAN:
Type: Ethernet
Hardware: Ethernet
BSD Device Name: en3
IPv4:
Configuration Method: DHCP
IPv6:
Configuration Method: Automatic
Proxies:
Exceptions List: *.local, 169.254/16
FTP Passive Mode: Yes
Service Order: 3
Upvotes: 1