Please note: The farmerbot releases for ARM which run on Raspberry Pi are not tested as rigorously as the regular releases. This should be considered as a beta release with limited support. While I’ll do my best to help with any issues that come up, our developers can’t guarantee that ARM specific issues will get fixed in the code, if something were to arise.
Inquiring minds want to know: can you run the ThreeFold famerbot on a Raspberry Pi? The answer is, yes, you can, with a few tweaks from the normal instructions. This method should work with Pi 2, 3, and 4, although I’ve only tested on my Pi 4 so far. Supporting Pi 1 and Zero would be just a bit of extra work, as far as I can see, so drop me a line if you have interest in using one of those models and I’ll see about making it happen.
The tricky part about working with the Pi is that the binary executables we release for Intel and AMD x64 based systems aren’t natively compatible with the ARM based processor in the Pi. To overcome this, we’ll use a combination of recompiled binaries and using an emulator to run the existing binaries, to provide a suitable mix of running services that support a working farmerbot.
For now, I am providing a set of ARM compatible containers hosted in my personal forks of our Github repositories. I’ll be working with the dev team to incorporate this into our normal build cycle and our official repositories.
To follow this tutorial, you’ll need the following:
- ARM based computer, with at least ARMv7 or higher chip (Pi 2 and later)
- 512mb total RAM (~200mb of free RAM is required to run Docker and farmerbot)
- 1-2gb free storage space
- Debian based operating system like Raspbian/RPi OS or Ubuntu (I tested on 32 bit “Buster” and 64 bit “Bullseye”)
You can use a different OS if you want to, but the needed packages might have different names and there could be some other quirks to account for. We don’t need a desktop, so the using a “lite” or “server” OS image is okay.
Update: There are now two paths to choose from below, the first is the original option, which works on any of the devices and operating systems mentioned above. If you’re not sure, this is the way to go.
The second option is for 64 bit Pis (3 and 4) running a 64 bit operating system. Note that the default Raspberry Pi OS images are 32 bit. You can check by running
uname -m in a terminal. The output on a 64 bit OS will be
aarch64. In that case, you can skip to the 64 bit section below for a bit simpler setup.
I won’t cover the farmerbot setup in detail here. Check the link at the top of the post for written instructions or see my video. You can follow the normal instructions and come back here to complete the rest just before you run
docker compose up.
While the version of Docker included in the repositories might work, I like to get the latest version using Docker’s install script:
wget -O docker.sh get.docker.com
sudo sh docker.sh
Install QEMU (32 Bit OS)
The following instructions are only for 32 bit operating systems. If you do have a 64 bit OS running on your Pi, you can skip to the 64 bit instructions below.
We’re going to install QEMU for emulation support inside Docker. This is needed because one component that makes farmerbot work,
rmb-peer, won’t compile natively for 32 bit ARM systems:
sudo apt update
sudo apt install qemu-user-static
While this was not necessary in my own testing, one user reported needing to install
binfmt-support manually as well. You can check if it’s working properly with:
There should be many entries starting with
qemu-. If not, try this:
sudo apt install binfmt-support
You can find an ARM compatible
docker-compose.yaml file here. To download it on your machine, run this command:
Alright that’s it. Now we can run
docker compose up and Docker will take care of the rest.
Quick troubleshooting tip
I’m not sure why, but I found during my testing that sometimes Docker had trouble pulling down the images and gave this error:
Error response from daemon: manifest unknown
If you see that, you can pull the images manually:
docker pull ghcr.io/scottyeager/farmerbot:0.2.0-arm
docker pull ghcr.io/scottyeager/rmb-peer:1.0.6-arm
docker pull ghcr.io/scottyeager/grid_http_server:2.1.0-rc2-arm
docker compose up again.
While I did my best not to pack this post with details about the problem and process of porting software from one platform to another, there’s more to say on that for anyone who’s curious, and I’m keeping my thoughts on that as a draft for now to maybe add to this post later
Please drop a reply here with any questions and your experience running farmerbot on a Rpi or other ARM based computer. It would be great to generate a collection of reports about what works and try to troubleshoot what doesn’t.