- Open Terminal or iTerm2
- See if the serial port exists
$ ls -l /dev/cu.*
crw-rw-rw- 1 root wheel 20, 1 Jun 10 21:07 /dev/cu.Bluetooth-Incoming-Port crw-rw-rw- 1 root wheel 20, 3 Jun 12 18:13 /dev/cu.usbmodem1421401
- Connect to the port
$ screen -L /dev/cu.usbmodem1421401 115200
-L : show log of the command from the serial port
- Other commands
# in a running session
# out of sessionCtrl-A, K : kill the session Ctrl-A, D : detach from the session
$ screen -ls : list sessions There is a screen on: 9244.ttys001.Dee15S (Attached) Format : [PID].[TTYID].[HOSTNAME] $ screen -r : attach the default session $ screen -r [NAME] : attach to a session named [NAME] $ screen -S [NAME] : attach to a session named [NAME] $ screen -d [ID] : detach from the session with screen id [ID]
2019-06-12
Serial port communication on Mac with SCREEN command
Labels:
IoT,
Serial port
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment