PirateBox Setup - epfl-dojo/porangebox GitHub Wiki
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.
- Download DietPi for OrangePi zero here
wget http://dietpi.com/downloads/images/DietPi_OrangePiZero-armv7-(Jessie).7z
; - Extract the .img file
7z x -so DietPi_OrangePiZero-armv7-(Jessie).7z
; - 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.
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 !
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
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)
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.
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.
Steps to reproduce to share a WiFi connexion through a network cable:
- Identify which interface is connected to the OrangePi from the laptop (e.g. enx00b56d030f2b) with
ip a
- Assign an IP + Netmask to this interface
ifconfig enx00b56d030f2b 129.168.4.2/24
- Be sure the interface is UP
ifconfig enx00b56d030f2b up
- Check with
ip link
orethtool enx00b56d030f2b
("State UP" or "link detected: yes") - Activate the eth0 interface on the OrangePi:
ifconfig eth0 up 192.168.4.1
- Both OrangePi and the laptop can now
ping
each other (if not working check withip a
that both get the IP) - Add a name server resolver in /etc/resolv.conf
nameserver 8.8.8.8
- Add a default route on OrangePi via laptop
ip route add default via 192.168.4.2
orroute add default gw 192.168.4.2
- Identify which interface is connected to Internet on the laptop (WiFi) (e.g. wlp3s0) with
ip a
- Add an IpTable rule on the laptop
iptables -t nat -A POSTROUTING -o wlp3s0 -j MASQUERADE
- Test that you reach the Internet on the OrangePi (e.g.
ping www.orangepi.org
)
-
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
-
dietpi-software
- choose "optimize"
- Activate "WiFi Hostspot"
- choose "optimize"
- 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.