This short tutorial extends on Adafruit’s excellent tutorial on using Serial Cable(also known as Serial Console) to remote control the Raspberry Pi (RPi). Adafruit’s tutorial demonstrates how to connect the correct USB-Serial cable to the correct GPIO pins. However, the tutorial ended with no examples of what useful tasks you can do after login to RPi.
My contribution is to demonstrate a useful task that you can do after login to RPi:
How to transfer file from computer running Linux to a Headless, Keyboardless and Mouseless Raspberry Pi disconnected from the network.
Headless mean the RPi device has NO TV or computer display connected to it.
Keyboardless and Mouseless mean the RPi device has NO keyboard and mouse
You need to purchase a USB-Serial cable suitable for RPi because RPi’s RX and TX pins operate at 3.3V and NOT 5V. Using 5V logic level will damage the RPi device.
Computer running Centos 6
Raspberry Pi running Raspbian
Step 1: Preparing an SD Card for your Raspberry Pi
Complete the steps as demonstrated in Adafruit’s tutorial but adhere to the following modifications:
- Choose Raspbian Distribution
- Skip Test and Configure
- Do NOT remove SD Card from SD Card Reader/Writer
- Do NOT connect power cable to RPi’s microUSB jack
- Do NOT connect any network cable into RPi’s ethernet jack
- Do NOT connect any USB device to RPi’s USB jacks
Step 2: Download a Unix Communication Package onto SD Card
The following steps are Linux commands. You have to adapt them for Mac or Windows.
Complete the following steps:
- Download lrzsz package
- Save the lrzsz package using its original name: lrzsz_0.12.21-7_armhf.deb
- As root user, copy the package file to the SD card you prepared:# cp path/to/lrzsz_0.12.21-7_armhf /path/to/your_sd_card/
- Unmount the SD Card:
- Remove the SD Card from the SD Card Reader/Writer
- Insert SD Card into Raspberry Pi
Step 3: Install Minicom package onto PC
Note that minicom is needed to be installed on PC and NOT RPi.
minicom package has a dependency on lrzsz package. Usually, the package manager(yum, apt-get) will install the dependencies automatically.
For more detail: Transfer file from Computer to Raspberry Pi Using USB-Serial Cable