*nix tooling
But what’s this ttyUSB0
thing? It’s a file of course! Everything is a file in *nix:
You can send out data by simply writing to this file:
Dealing with serial devices using echo
is far from ergonomic. So, we’ll use the program minicom
to interact with the serial device using the keyboard.
We must configure minicom
before we use it. There are quite a few ways to do that but we’ll use a.minirc.dfl
file in the home directory. Create a file in ~/.minirc.dfl
with the followingcontents:
That file should be straightforward to read (except for the last two lines), but nonetheless let’sgo over it line by line:
pu baudrate 115200
. Sets baud rate to 115200 bps.pu parity N
. No parity check.pu stopbits 1
. 1 stop bit.pu rtscts No
. No hardware control flow.
This tells minicom
to open the serial device at /dev/ttyUSB0
and set its baud rate to 115200.A text-based user interface (TUI) will pop out.
You can now send data using the keyboard! Go ahead and type something. Note that the TUI won’techo back what you type but you’ll see TX (red) LED on the serial module blink with each keystroke.
minicom
commands
exposes commands via keyboard shortcuts. On Linux, the shortcuts start with Ctrl+A
. Onmac, the shortcuts start with the Meta
key. Some useful commands below:
Ctrl+A
+Z
. Minicom Command SummaryCtrl+A
+C
. Clear the screenCtrl+A
+X
. Exit and reset