This is my 3rd iteration of this guide, and now it appears that armbian officially supports the orange pi pc2!
- rtorrent
- plex
- flood (or similar rtorrent web interface)
- support external usb3 hd with exfat
I'm going to do my best to document everything start -> finish.
Base image: armbian
- downloaded from https://www.armbian.com/orange-pi-pc2/
- extracted image with p7zip (
brew install p7zip
) - flashed sd card via etcher (
brew cask install etcher
)
I set up static dhcp routing beforehand, so I already know the ip, but if you didn't do this then check your connected devices on your router page, or run a portscan on your subnet before and after plugging in the device.
Example nmap command:
nmap -p 22 192.168.1.0-255
Check the armbian page for initial login credentials, currently its user root
and password 1234
Follow the prompt to create a user account, then once you've done that kill the ssh connection and start a new one with the new user account.
Now its ready for specific software.
I remember plex being easy, so lets give that a shot. @uglymagoo has an awesome repo for this.
Actual link is here https://www.dev2day.de/projects/
wget -O - https://dev2day.de/pms/dev2day-pms.gpg.key | sudo apt-key add -
I used the armbian bionic which is ubuntu bionic which is ~ debian stretch I believe.
I have in my notes from last year that this implies architecture armhf, which I'm just going to trust, but there are links below.
I'm not super clear on the finer points of arm64 vs armhf (arm hard-float) vs armv7 and how multiarch works in debian. More reading here and here and here and here
Note that even though some of the above links claim you need to do dpkg --add-architecture armhf
, I didn't find this necessary.
For reference, dpkg --print-architecture
returns arm64
and dpkg --print-foreign-architectures
returns armhf
.
echo "deb [arch=armhf] https://dev2day.de/pms/ stretch main" | sudo tee /etc/apt/sources.list.d/pms.list
# Not sure why this one is needed, its new on the dev2day.pe site from last time. Figure it can't hurt
sudo apt-get install apt-transport-https
sudo apt update
sudo apt install plexmediaserver-installer -y
Check service plexmediaserver status
and make sure it doesn't display any errors. If it does, try restarting it via sudo service plexmediaserver restart
Now you should be able to go to http://<your-orange-pi-ip-addr>:32400/web
and login to plex.
I like exFat because its the best modern filesystem that I've found for multi-platform usage (windows and osx support it out of the box, linux supports it pretty easily).
- Plugin usb drive
udevadm info --query=property -n /dev/sda2
for each /dev/sda* until you find your drivename in the output.sudo apt install exfat-fuse
sudo mkdir /media/myExternalDisk
sudo mount -t exfat /dev/sd? /media/myExternalDisk
Now just make sure you can ls
/media/myExternalDisk
and see what you want to see.
Now you probably want to go into plex and add your libraries so they can start indexing.
Here I attempted to get some of the existing rtorrent + flood docker images working on aarch64, but couldn't.
So here are the plain ubuntu instructions:
sudo apt install rtorrent
basedir="$HOME/rtorrent"
mkdir -p "$basedir"/{.session,download,log,watch/load,watch/start}
curl -Ls "https://raw.githubusercontent.com/wiki/rakshasa/rtorrent/CONFIG-Template.md" \
| sed -ne "/^######/,/^### END/p" \
| sed -re "s:/home/USERNAME:$HOME:" >~/.rtorrent.rc
Enable xml-rpc by adding this to your .rtorrent.rc scgi_port = localhost:5000
rtorrent is hard to daemonize, I opt for a start.sh
script that runs it inside a tmux session
sudo apt install tmux
start.sh:
tmux new-session -s rtorrent -d rtorrent
Rtorrent should be set at this point, now for flood.
# install nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
# install node 8.x per flood readme
# use `nvm ls-remote --lts` to find latest long term support branches
nvm install v8.12.0
# clone flood
git clone https://github.com/jfurrow/flood.git ~/flood
cd flood
Follow the rest of the instructions on https://github.com/jfurrow/flood#configuration
Note that flood added a dependency on argon2, which requires node-gyp, which in turn requires python, so you'll probably need to do
sudo apt install python
as well.
Make sure to change the server address in config.js
to 0.0.0.0
.
Flood uses node-sass to do a production build, which is fine, except node-sass doesn't support arm64.
Node-sass is a node binding into the native lib libsass
.
So what you have to do is install everything locally on the orange pi (which builds argon2), then also build on a supported machine (since sass is a build-time dependency, not run-time), then merge the two.
On the orange pi
git clone https://github.com/jfurrow/flood.git ~/flood
sudo apt install python
npm install
(to build argon2)
On a libsass supported machine
git clone https://github.com/jfurrow/flood.git ~/scratch/flood
cd ~/scratch/flood
npm install
npm run build
tar -cf ~/scratch/flood_built.tar ~/scratch/flood
scp ~/scratch/flood_built.tar orangepi:~/flood_built.tar
On the orange pi
tar -xf ~/flood_built.tar ~/flood_built
rm -rf ~/flood/node_modules/argon2
cp -r ~/flood_built/node_modules/argon2 ~/flood/node_modules
Now, after a million steps, you should be able to execute npm start
in ~/flood
just fine.
Now, in the browser, make a user and password, then put in 127.0.0.1
and 5000
assuming you didn't change the default scgi_port
in the .rtorrent.rc
config.
And now add another line to you trusty start.sh tmux new-session -s flood -d cd ~/flood && npm start
This is disabled by default. To get it working, I removed the following lines from my .rtorrent.rc
dht.mode.set = disable
protocol.pex.set = no
trackers.use_udp.set = no
And add the following:
dht=auto
dht_port=6881
and then in a running session of rtorrent, I hit ctrl+x
to input a command, then ran the following command to bootstrap dht:
dht.add_node = dht.transmissionbt.com
Also don't forget to forward the ports via your router.
I always want to have subtitles available, so follow this guide