Skip to content

Mining on Raspberry Pi

BK edited this page Feb 4, 2022 · 6 revisions

Important Note

Due to some semi-recent changes in XMRig, you can no longer run it on an ARM-based processor with a 32-bit OS. Currently, there is only one Raspberry Pi SoC that supports a 64-bit OS, the Raspberry Pi 4 (regardless of memory spec, but the higher it is the better).

Also, after following any link to a page other than here is not my work and I do not take credit for them, all credit to the respective devs and owners.

Before we Begin

This is also not for beginner users of Linux. If you are one, I would recommend familiarizing yourself with basic console commands and returning later.

Things to Remember

Raspberry Pis are not specialty RandomX mining hardware, nor does that really exist, as it is a heavily CPU based currency with frequent hard forks. With that being said, do not expect good hashrates or even return-on-investment if paying for electricity. This is merely a proof-of-concept and a good way for those without extensive hardware to learn the methods of cryptocurrency and the mining thereof.

Disclaimers

Neither GNTLMiningPools (or any of its devs/affiliates), XMRig Devs, Raspberry Pi Foundation, nor any Cryptocurrency devs are responsible for any damage that may occur to your Raspberry Pi, or other belongings as a result of cryptocurrency mining. Depending on conditions, it would be best off to actively cool your Raspberry Pi (with a fan, or possibly water cooling, as it is possible) as failing to keep the SoC cool will cause throttling (which will lower your hashrate) or possibly even permanent damage to the silicon chip.

Installation

Pre-requisites

These are all required before you proceed:

  1. Start by acquiring the .zip of a 64-bit OS from the index located here. As of November 17th, 2021, the currently known working build is "raspios_lite_arm64-2021-11-08"

  2. To install XMRig you will either need to use a tool to move your files over to the raspberry pi from another computer (like WinSCP) or use the browser on the pi to download the file directly. *Alternatively, you can use this to get the most recent XMRig source if on a lite OS with no browser.

git clone https://github.com/xmrig/xmrig.git
  • As of 1/29/2021 the following releases of the XMRig binary are known to work on a Raspberry Pi, older versions along with future releases may work as well, but as of right now, v6.15.3 is tested using this guide (if you test another build and it works, let me know! Contact info below). These can all be acquired here. Grab the "Source code (tar.gz)" download. After downloading use this to unpack.
sudo apt-get install git build-essential cmake libuv1-dev libssl-dev libhwloc-dev
tar xvf xmrig-6.x.x.tar.gz

Installing XMRig

At this time, if you would like to compile a 0% dev fee version of XMRig:

cd xmrig/src
nano donate.h

Within the file, change both of the lines that contain a 1, to a 0.

Once at the location of your unpacked tar.gz file, or git clone instance, do the following:

mkdir xmrig/build && cd xmrig/build
cmake ..
make

In case the final make command fails, past XMRig versions have required the make command to be run as follows, so attempt this as well:

make -j$(nproc)

As a side note, if you run your Raspberry Pi headless, or would like to mine multiple currencies at once, (like GNTL and ARQ) you may want to install screen. Screen allows you to essentially have "windows" of each process running so that you can do multiple things at a time.

sudo apt install screen

After installation, you can find out more about how to use the program here

Your XMRig should now be ready to run, save for configuration. You are more than welcome to try using the config.json and the --config parameter of XMRig, but I haven't had any luck with it whatsoever. For those who want to run it using command parameters, I recommend using the xmrig config wizard

Resources

Contact:

General stuff that I referenced:

Overclocking Information (more hashes):