USB drive copier example project for the Adafruit 128x64 OLED Raspberry Pi bonnet, using a USB hub such as the Zero4U shield.
Uses the Adafruit OLED Bonnet Toolkit to implement an asynchronous UI for USB drive copying/formatting, controlled by the D-pad and A/B buttons.
The USB copier application, showing highlighted menus (arranged using the layout system).
On the build machine:
git clone https://github.com/lukehutch/Adafruit-OLED-Bonnet-Toolkit.git
cd Adafruit-OLED-Bonnet-Toolkit ; mvn install ; cd ..
git clone https://github.com/lukehutch/usb-copier.git
cd usb-copier ; mvn package ; cd ..
usb-copier/target/usb-copier-0.0.2-jar-with-dependencies.jar
to /home/pi
on the Raspberry Pi.On the Raspberry Pi:
raspi-config
and enable Interfacing Options -> Advanced Options -> i2c
apt-get install openjdk-11-jdk wiringpi pigpio nano udevil
sudo nano /etc/cmdline.txt
iomem=relaxed
sudo nano /etc/config.txt
dtparam=i2c_arm=on
dtparam=i2c_baudrate=1000000
/home/pi
(this is needed due to a bug in the library loading code)
cd ; unzip -j /path/to/usb-copier-0.0.2-jar-with-dependencies.jar lib/armhf/libpi4j-pigpio.so
sudo bash -c 'nohup java -Dpi4j.library.path=/home/pi -jar /home/pi/usb-copier-0.0.2-jar-with-dependencies.jar &'
(Some steps may need to be tweaked a little...)