Skip to content

Latest commit

 

History

History
94 lines (89 loc) · 3.84 KB

INSTALL.md

File metadata and controls

94 lines (89 loc) · 3.84 KB

Setting up OpenBSD on Raspberry Pi 4B

Prepare SD card and install USB drive

  1. Got to the download page and retrieve install installXX.img for arm64.
  2. Flash the install firmware to a USB drive:
    sudo dd if=/home/user/Downloads/installXX.img of=/dev/sdb
    
  3. Download a current version of the Raspberry Pi 4 UEFI Firmware, then unzip the files:
    mkdir /tmp/rpi-firmware
    unzip Downloads/vXXX.zip -d /tmp/rpi-firmware
    
  4. Create a boot partition with at least 20 MB, for example with parted:
    sudo parted /dev/mmcblk0
    (parted) mkpart
    Partition type?  primary/extended? primary
    File system type?  [ext2]? fat16
    Start? 1M
    End? 50M
    (parted) set 1 boot on
    (parted) quit
    
  5. Mount the first partition of the SD card and copy the UEFI firmware:
    sudo mount /dev/mmcblk0p1 /mnt
    sudo cp /tmp/rpi-firmware/* /mnt/
    
  6. Edit the /mnt/config.txt and disable the WIFI and Bluetooth adapters by adding the following lines:
    dtoverlay=disable-wifi
    dtoverlay=disable-bt
    
  7. Unmount the SD card:
    sudo umount /mnt/
    
  8. Plug the SD card and USB drive into the RPi.

Configure UEFI and install OpenBSD

  1. When the UEFI logo appears, hit the ESC key to enter the setup.
  2. Use the boot options to boot the USB drive. If problems occur, have a look at AshyIsMe/openbsd-rpi4.
  3. Run the installer and install OpenBSD to suite your needs. The default settings should be fine in most cases.
  4. If you did overwrite the boot partition during installation, copy the files from /tmp/rpi-firmware/ into the boot partition again. Don't forget to edit the config.txt.
  5. Go to the UEFI "Boot Maintenance Manager" > "Boot Options" and create a new boot entry with the EFI file.
  6. Change the boot order to boot the OpenBSD efi file first.

Hardware setup

  1. Attach one UART adapter to each RPi.
  2. Connect the ground pins of both UART adapters.
  3. Connect the Tx pin of the sending RPi to the Rx pin of the receiving RPi.
  4. If you want to physically guarantee that there is no reverse channel, you can add a diode with a pull down or pull up resistor betwen the Tx and Rx pins. Alternatively, an optocoupler can be used to galvanically separate the circuits. Don't forget to disconnect the bluetooth and WLAN antennae.
  5. Flash the arduino/arduino.ino file on the Arduino.
  6. Connect the Arduino via USB to the receiving RPi.
  7. Set up the power supply for both RPis.

Diode setup

Clone this repo or download the latest .zip file and extract. Then cd into the directory.

Receiver setup

  1. Copy the rc.d file:
    cp ./etc/rc.d/diode_receive /etc/rc.d/
    
  2. Edit the device paths in /etc/rc.d/diode_receive. If you do not have an Arduino with LCD display connected, remove the --arduino parameter.
  3. Create the directory to which the received files are written.
  4. Copy the main program:
    cp ./bin/diode_receive /usr/local/bin/
    
  5. Enable the service:
    rcctl enable diode_receive
    rcctl start diode_receive
    

Sender setup

  1. Copy the rc.d file:
    cp ./etc/rc.d/diode_send /etc/rc.d/
    
  2. Edit the device paths in /etc/rc.d/diode_send.
  3. Create the directory from wich the files are read.
  4. Copy the main program:
    cp ./bin/diode_send /usr/local/bin/
    
  5. Enable the service:
    rcctl enable diode_send
    rcctl start diode_send
    

Adjust transfer speeds

Transfer some files. If not all they are not appearing on the receiver, there were transmission errors. Reduce the bit rate in the rc.d scripts until you have no transmission errors. Alternatively, improve your hardware setup.