Project

General

Profile

Actions

Todo #12461

closed

Improve macOS Serial Command Instructions

Added by Kris Phillips over 2 years ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Hardware
Target version:
-
Start date:
Due date:
% Done:

100%

Estimated time:

Description

Many of the devices no longer just show "/dev/cu.usbserial" for their path in macOS. For example the SG-5100 with the new serial chipset will show up as /dev/cu.usbserial-[random 4 digit number] when the driver is installed like /dev/cu.usbserial-1540. On the Netgate 1100 the device will show up as something completely different. It would be helpful to adjust the instructions to be more "generic" for macOS. For example, we could direct the users to enter "ls /dev/ | grep cu*" to get the output of all USB serial devices and use that in the screen command.

Actions #1

Updated by Kris Phillips almost 2 years ago

This should be corrected as customers run into this all the time now, since the driver was updated for all platforms by Silicom Labs.

The instructions here are incorrect entirely for macOS:
https://docs.netgate.com/pfsense/en/latest/solutions/netgate-2100/connect-to-console.html#locate-the-console-port-device

Actions #2

Updated by Jim Pingle almost 2 years ago

  • Status changed from New to In Progress
  • Assignee set to Jim Pingle
  • % Done changed from 0 to 70

I added some general info on finding the serial device.

Waiting on info from someone with both a Mac and a 2100 to confirm a couple items before updating any of the 2100 information.

It's also not yet clear if the device name differences are from OS X version, platform difference (e.g. M1 Macs), or a change in the drivers from Prolific and/or SiLabs.

Actions #4

Updated by Jim Pingle almost 2 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 70 to 100

This should take it the rest of the way, given that it appears all recent (~10 year old and newer) Macs running a current macOS will see /dev/cu.usbserial-<id>.

https://gitlab.netgate.com/docs/pfsense-platforms/-/commit/866c1495fc68aae2ba82d99c370a665d920d5c34

Actions #6

Updated by Ryan Coleman almost 2 years ago

Jim Pingle wrote in #note-5:

Updated in pfSense docs as well: https://gitlab.netgate.com/docs/pfSense-docs/-/commit/a1870dd5368f3232712f0cc9564b54a8c6916aaa

I recommend the command:

ls -l /dev/ | grep -i usb

And this is the result on my M1-based iMac:


ryan.netgate@Ryans-iMac ~ % ls -l /dev/ | grep -i usb
crw-rw-rw-  1 root          wheel        0x9000005 Jul 31 14:03 cu.usbserial-2320
crw-rw-rw-  1 root          wheel        0x9000004 Jul 31 14:03 tty.usbserial-2320

and then use this command (-U for unicode support, -L for writing a log file to the current directory):

screen -U -L /dev/cu.usbserial-2320 115200

It would be worth noting that there should be proper commands listed on how to disconnect your Screen session safely.

Control-A, Control-D to detach; then it will say "Resource Busy" when you try to open a new session.

To search for open screens:

screen -list

ryan.netgate@Ryans-iMac ~ % screen -list
There are screens on:
    77058.ttys000.Ryans-iMac    (Detached)
Remove dead screens with 'screen -wipe'.
1 Sockets in /var/folders/xx/50bhbcrs1zj6khwnv2hl55sm0000gp/T/.screen.

And remove the specific with the following method:

screen -X -S 77058 quit

or
screen -wipe

to remove all detached screens

And then you can re-attach on the original command.

Screen is a great tool but it very much isn't super convenient to novice users.

I will verify these things against both of my other Apple Silicon devices here.

Actions #7

Updated by Chris Linstruth almost 2 years ago

Thoughts: ls -l /dev/cu.* will specifically show all available cu devices regardless of driver, which is what we are interested in here. “ usb ” will miss some (like /dev/cu.KeySerial1 - a KeySpan adapter I have, and possibly future chipsets in netgate units or their drivers because "they" decide to change them and how they enumerate.)

Actions #8

Updated by Jim Pingle almost 2 years ago

Ryan Coleman wrote in #note-6:

Jim Pingle wrote in #note-5:

Updated in pfSense docs as well: https://gitlab.netgate.com/docs/pfSense-docs/-/commit/a1870dd5368f3232712f0cc9564b54a8c6916aaa

I recommend the command:
ls -l /dev/ | grep -i usb

As cjl mentioned that will miss some other devices, and also be confusing. The tty devices are not usable in the way we want here, only the cu devices. A tty device is for others to call into the Mac, whereas the cu device is for the Mac to "call up" another serial host, which is the only usable mode for these purposes. As far as I can tell any serial device usable the way we want would use the cu driver/prefix.

and then use this command (-U for unicode support, -L for writing a log file to the current directory):

[...]

The doc already mentions -U, I'm not sure we should recommend -L, not everyone will need to log, and there are other ways (e.g. :hardcopy -h blah.txt to dump the buffer to file).

It would be worth noting that there should be proper commands listed on how to disconnect your Screen session safely.

I don't think we should start down a path of writing a manual for screen. We only explain enough of the others like PuTTY to get the users connected, after that it's up to them. If we did write such a thing, it would have to be a separate reference document and is not macOS specific so not in scope here. It might be an OK fit on the main pfSense docs rather than platform docs, but even that is a stretch.

Should we choose to do this I already have a document I wrote which would be a decent head start (though it would need to be generalized and expanded): https://www.pingle.org/2022/04/02/raspberry-pi-serial-console-server#gnu-screen

However that would have to be part of a separate Redmine issue for new content as it is not specific to macOS which is the focus of this request.

Actions #9

Updated by Ryan Coleman almost 2 years ago

Jim Pingle wrote in #note-8:

I don't think we should start down a path of writing a manual for screen. We only explain enough of the others like PuTTY to get the users connected, after that it's up to them. If we did write such a thing, it would have to be a separate reference document and is not macOS specific so not in scope here. It might be an OK fit on the main pfSense docs rather than platform docs, but even that is a stretch.

This is an issue in all uses of Screen, not specifically that to the Mac. Applies to Linux as well.

Actions #10

Updated by Jim Pingle almost 2 years ago

Ryan Coleman wrote in #note-9:

Jim Pingle wrote in #note-8:

I don't think we should start down a path of writing a manual for screen. We only explain enough of the others like PuTTY to get the users connected, after that it's up to them. If we did write such a thing, it would have to be a separate reference document and is not macOS specific so not in scope here. It might be an OK fit on the main pfSense docs rather than platform docs, but even that is a stretch.

This is an issue in all uses of Screen, not specifically that to the Mac. Applies to Linux as well.

Right but this Redmine issue is only about macOS serial commands, so anything else is out of scope here.

Actions #11

Updated by Kris Phillips over 1 year ago

  • Status changed from Feedback to Resolved

Docs look good for the scope of macOS. Closing this as Resolved.

Actions

Also available in: Atom PDF