Transfer file from Computer to Raspberry Pi Using USB-Serial Cable

Introduction

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.

Transfer file from Computer to Raspberry Pi Using USB-Serial Cable

Scope

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

Materials

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.

Environment

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:

  1. Choose Raspbian Distribution
  2. Skip Test and Configure
  3. Do NOT remove SD Card from SD Card Reader/Writer
  4. Do NOT connect power cable to RPi's microUSB jack
  5. Do NOT connect any network cable into RPi's ethernet jack
  6. 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:

  1. Download lrzsz package
  2. Save the lrzsz package using its original name: lrzsz_0.12.21-7_armhf.deb
  3. 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/
  4. Unmount the SD Card:
    #umount /path/to/your_sd_card
  5. Remove the SD Card from the SD Card Reader/Writer
  6. 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.

Transfer file from Computer to Raspberry Pi Using USB-Serial Cable pic

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


About The Author

Ibrar Ayyub

I am an experienced technical writer with a Master's degree in computer science from BZU Multan University. I have written for various industries, mainly home automation and engineering. My writing style is clear and simple, and I am skilled in using infographics and diagrams. I am a great researcher and am able to present information in a well-organized and logical manner.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top