PirateBox Setup - epfl-dojo/porangebox GitHub Wiki

Flashing SD card

Note: we succeed to make the PirateBox works on both Armbian and DietPi. The following procedure use DietPi, but feel free to try any other arm distro.

  1. Download DietPi for OrangePi zero here
    wget http://dietpi.com/downloads/images/DietPi_OrangePiZero-armv7-(Jessie).7z;
  2. Extract the .img file
    7z x -so DietPi_OrangePiZero-armv7-(Jessie).7z;
  3. Write image on SD card with your favourite image writer, e.g.
    sudo dd if=DietPi_v145_OrangePiZero-armv7-(Jessie).img of=/dev/mmcblk0 where /dev/mmcblk0 represent your SD card.

Test it

Connect the OrangePi to your PC via a serial RX/TX (FTDI USB to Serial adapter) wire to see the serial console.

The pinout schema of the orange pi and this OPi Zero UART image can surely helps !

Cable X (asian)

While there is no worldwide standard for the colours of FTDI cable, we found that (asian) colours for our cable are :

  • 1 VCC: Red
  • 2 GND: Black
  • 3 RX: White
  • 4 TX: Green
  • 5 RTS: Yellow
  • 6 CTS: Blue

Don't forget to cross the RX/TX !!

OrangePi -- FTDI
 1 GND   --  2 GND
 2 RX    --  4 TX
 3 TX    --  3 RX

Adafruit FTDI cable

If you are using this Ada fruit FTDI cable, the pinout are:

FTDI            --  OrangePiZ
 1 (black) GND  ->  1 GND
 2 (brown)
 3 (red)
 4 (orange) TXD ->  2 RXD
 5 (yellow) RXD ->  3 TXD
 6 (green)

Connect to serial

When connecting the OrangePi Zero to your computer with USB, you can use the command dmesg -w to identify on which ttyUSB/ttyACM it's connected to.

Then, in a terminal launch command: screen /dev/ttyUSB0 115200 to connect to your device. You can use the Ctrl + a, k to kill the session and screen -r to reattach any running session.

Once connected on the OrangePi

Connect it to the internet network

Be sure to be able to connect to an internet network in order to update the packages and download the PirateBox setup. Options are DHCP, Wifi or even with a shared connexion trough USB.

Sharing laptop wifi through ethernet

Steps to reproduce to share a WiFi connexion through a network cable:

  1. Identify which interface is connected to the OrangePi from the laptop (e.g. enx00b56d030f2b) with ip a
  2. Assign an IP + Netmask to this interface ifconfig enx00b56d030f2b 129.168.4.2/24
  3. Be sure the interface is UP ifconfig enx00b56d030f2b up
  4. Check with ip link or ethtool enx00b56d030f2b ("State UP" or "link detected: yes")
  5. Activate the eth0 interface on the OrangePi: ifconfig eth0 up 192.168.4.1
  6. Both OrangePi and the laptop can now ping each other (if not working check with ip a that both get the IP)
  7. Add a name server resolver in /etc/resolv.conf nameserver 8.8.8.8
  8. Add a default route on OrangePi via laptop ip route add default via 192.168.4.2 or route add default gw 192.168.4.2
  9. Identify which interface is connected to Internet on the laptop (WiFi) (e.g. wlp3s0) with ip a
  10. Add an IpTable rule on the laptop iptables -t nat -A POSTROUTING -o wlp3s0 -j MASQUERADE
  11. Test that you reach the Internet on the OrangePi (e.g. ping www.orangepi.org)

Update packages and installation

  • Change the password by typing passwd

  • First be sure to update the package list with apt update

  • PirateBox will need some packages, use apt install -y vim htop lighttpd dnsmasq hostapd iw iptables python php-cgi

  • Upgrade any package to the latest version with apt upgrade

On dietpi

  • dietpi-software
    • choose "optimize"
      • Activate "WiFi Hostspot"
  • Back to menu => install
  • The system will reboot just wait...

Your OrangePi is now ready, you can now follow the Software setup for the pirate box.

More doc

⚠️ **GitHub.com Fallback** ⚠️