File transfer over uart (Example for C/C++ course)

Login

Login with ssh to your beaglebone (example: ssh debian@192.168.7.2)

Clone

git clone https://github.com/vlabo/file_transfer_over_uart.git

Build

cd file_transfer_over_uart
make

Run

Load UART drivers

edit /boot/uEnv.txt (you may want to backup the file first sudo cp /boot/uEnv.txt /boot/uEnv.txt_backup)

sudo nano /boot/uEnv.txt

replace:

#uboot_overlay_addr6=/lib/firmware/<file6>.dtbo
#uboot_overlay_addr7=/lib/firmware/<file7>.dtbo

with:

uboot_overlay_addr6=/lib/firmware/BB-UART1-00A0.dtbo
uboot_overlay_addr7=/lib/firmware/BB-UART2-00A0.dtbo

reboot:

sudo reboot

Connect UART1 with UART2

Connect the four pins on the board
Pin 24 -> Pin 22
Pin 26 -> Pin 21

beaglebone_black_pinmap

Run the servers

You need 3 ssh session (or use tmux)

session one:

in project directory:

cd device1
./server 1

session two:

in project directory:

cd device2
./server 2

session tree:

in project directory

cd device1 # or device2
./client -m test_message # send a test message
./client -f ../common.h # send common.h file to the other server