forgee
Veteran OT User
A few days ago I got curious as to whether it would be possible to run TFS on a Raspberry Pi (2). As it turns out it is, and since a few people showed some interest here I decided to share how I did it.
The usefulness of running TFS off a Raspberry Pi is admittedly limited. It might be viable for some testing but this is mostly meant as a fun experiment.
I used a Raspberry Pi 2 with 1 GB of RAM, but it would likely work on the older Model B/B+ devices too, although 256/512 MB of RAM would really be pushing it.
Note: Although this is written for Raspberry Pi it should work fine on any Debian 7 system. The only thing we really need to do is to install a newer version of gcc than the 4.6 that is found in the Debian 7 "wheezy" repositories.
You should have a SD card with Raspbian "wheezy" installed (Raspbian is a version of Debian 7 optimized for Raspberry Pi).
If you don't, then you first need to download and install it.
With Raspbian running you can follow these steps on the Pi with a keyboard and monitor connected, or through SSH. SSH should be enabled by default and the default username/password is pi/raspberry unless you changed it.
I will only cover building TFS 1.1 from source. To set up a fully working server follow the excellent tutorial by @dominique120.
With that out of the way, let's get started!
First make sure your system is up-to-date.
Install the packages required to compile TFS.
We need to get gcc from the jessie repositories, so open sources.list and replace wheezy with jessie.
Update package lists and install gcc 4.9.
Now change jessie back to wheezy in sources.list and update package lists again.
Now we are ready to compile, so grab the source and create the build directory as usual.
We tell cmake to use g++ 4.9 that we installed earlier as the c++ compiler, instead of the default 4.6. Then run make as usual.
Take a break! This will take a while.
Now you're ready to move the executable and config.lua to your preferred location and drop in a datapack of your choice (when choosing a map, remember that you don't have a whole lot of RAM on a Raspberry Pi!).
Raspbian comes with SSH filetransfer enabled by default so you can use FileZilla or another SFTP/SSH filetransfer client to move the files. Remember to use SFTP/SSH (port 22), I don't know if it has FTP (port 21) installed by default but we might as well just use SFTP either way.
Or you can use the command line, for example:
Credits to @Mark for the GitHub Wiki compile guide that I used as a base.
If anyone feels that I used their work, just let me know and I'll add your credits.
Now, why run TFS on a Raspberry Pi? Because we can.
The usefulness of running TFS off a Raspberry Pi is admittedly limited. It might be viable for some testing but this is mostly meant as a fun experiment.
I used a Raspberry Pi 2 with 1 GB of RAM, but it would likely work on the older Model B/B+ devices too, although 256/512 MB of RAM would really be pushing it.
Note: Although this is written for Raspberry Pi it should work fine on any Debian 7 system. The only thing we really need to do is to install a newer version of gcc than the 4.6 that is found in the Debian 7 "wheezy" repositories.
You should have a SD card with Raspbian "wheezy" installed (Raspbian is a version of Debian 7 optimized for Raspberry Pi).
If you don't, then you first need to download and install it.
With Raspbian running you can follow these steps on the Pi with a keyboard and monitor connected, or through SSH. SSH should be enabled by default and the default username/password is pi/raspberry unless you changed it.
I will only cover building TFS 1.1 from source. To set up a fully working server follow the excellent tutorial by @dominique120.
With that out of the way, let's get started!
First make sure your system is up-to-date.
Code:
sudo apt-get update
sudo apt-get upgrade
Code:
sudo apt-get install git cmake build-essential liblua5.2-dev libgmp3-dev libmysqlclient-dev libboost-system-dev
Code:
sudo nano /etc/apt/sources.list
Code:
sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9
Code:
sudo nano /etc/apt/sources.list
sudo apt-get update
Code:
git clone https://github.com/otland/forgottenserver.git
cd forgottenserver
mkdir build && cd build
Code:
cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/g++-4.9
make
Now you're ready to move the executable and config.lua to your preferred location and drop in a datapack of your choice (when choosing a map, remember that you don't have a whole lot of RAM on a Raspberry Pi!).
Raspbian comes with SSH filetransfer enabled by default so you can use FileZilla or another SFTP/SSH filetransfer client to move the files. Remember to use SFTP/SSH (port 22), I don't know if it has FTP (port 21) installed by default but we might as well just use SFTP either way.
Or you can use the command line, for example:
Code:
mkdir /home/pi/tfs && mv /home/pi/forgottenserver/build/tfs /home/pi/tfs/tfs
cp /home/pi/forgottenserver/config.lua /home/pi/tfs/config.lua
cp -R /home/pi/forgottenserver/data /home/pi/tfs
If anyone feels that I used their work, just let me know and I'll add your credits.
Now, why run TFS on a Raspberry Pi? Because we can.