Tomodachi: Simple DIY Raspberry Pi expansion board

Even a quick search for "Raspberry Pi expansion board" yields an impressive array of boards for all sorts of practical uses. There are boards loaded with sensors, boards for driving motors, relay boards, and the list goes on. And if you need a basic expansion board with a couple of inputs and a display, there is Tomodachi. This expansion board is rather simple: two LEDs, two push buttons, and a small LCD screen are all you get. But Tomodachi does have a few redeeming qualities.

So what can you actually do with a Tomodachi board? Since you can program the board to run practically any command or script on the Raspberry Pi, Tomodachi essentially transforms the Raspberry Pi into a self-contained programmable appliance. Right out of the box, you can use the buttons to display the Raspberry Pi's IP address and power off the machine. Of course, you can easily program the board to run practically any command or script. In fact, the supplied documentation shows how to use Tomodachi to display system information, weather conditions, transform the Raspberry Pi into an Internet radio player, and more.

Practical example: Photo backup appliance for Android devices

If you are curious about how this works in practice, here is how you can use the Tomodachi board to transform the Raspberry Pi into a photo backup device for an Android device.
  1. On the Raspberry Pi, run the following commands to install the required software and create directories:
    sudo apt install mtp-tools jmtpfs
    mkdir -p ~/BACKUP
    mkdir -p ~/ANDROID
  2. Use the nano ~/ command to create a text file and open it for editing. Insert the code below in the file:
    #!/usr/bin/env bash
    jmtpfs ~/ANDROID
    rsync -avh --delete /home/pi/ANDROID/Internal\ storage/DCIM/ /home/pi/BACKUP
    sudo oled r
    sudo oled +a "Backup completed!"
    sudo oled s
    In the example above, the rsync command backs up the content of the DCIM folder on the Android device to the BACKUP directory on the Raspberry Pi. You can change this behavior, if needed.
  3. Save the changes and make the script executable using the chmod +x command.
  4. Open the tomodachi/scripts/commands.csv file for editing and add the following command:
    Backup photos, /home/pi/
  5. Save the changes and reboot the Raspberry Pi.
  6. Connect your Android device to the Raspberry Pi and make sure that the device is set to use the MTP protocol.
  7. Use the SELECT button to select the Backup photos command, press **RUN**, and wait till the Backup completed! message appears on the display.

That's all there is to it.

© Dmitri Popov