DEV Community

Grant McNamara
Grant McNamara

Posted on • Updated on

How To Mine XMR On A Raspberry Pi In 2022

It's 2022 now and the world of crypto currency has never been more popular. Crypto currency is almost everywhere now. Its advertised online and heck crypto.com purchased a basketball stadium down in california. But all of these new words such as NFT, crypto, address, private key, safe, secure ,etc are a bit confusing to the beginners. So if you are new to this kind of stuff, check out my site and watch the blog to see if a new article about this is posted. If you already know about crypto and you currently use it but would like to know how to mine it then read on.

Quick Note

So I just launched one of my old sites, cryptoandpi.cf, again. It's not doing very well right now in traffic so a small visit would help. I try to regularly publish content there as well as possible too though so it is still growing.

Getting Started

If you want to mine monero on your raspberry pi then there are a few details I should tell you. Now you are not going to get rich by mining on the raspberry pi. Its a low-powered, single board computer, with a arm processor that runs a special operating system. Yes it needs a special os to mine. The regular raspberry pi 32-bit os wont cut it. It used to but not anymore. In october 2021 the terminal that was used for apps like xmrig, was shutdown. It is no longer available to install on your pi. But you can get around this by simply using the 64-bit raspberry pi os. Just look it up on google and you'll find it easily. Once you have that setup on your sd, boot it up, set it up and then your raspberry pi is ready to mine, almost.

Tweaks

There are still a few things that you might want to do with your raspberry pi before you mine, to improve your hashrate. First thing you will want to do is overclock it. This is super simple to do. Just type in the commandsudo nano /boot/config.txt. Then go down to the section that says something about the arm_freq=800 and then do the following. Uncomment to arm_freq=800 and change the number to 2147 and then below it add gpu_freq=750 and then below that add over_voltage=6. Now look through your boot config and look for something that says arm_boost=1 and that is usually at the bottom. But if you don't see it just add it to the bottom of the file. Now save it and then reboot. When your raspberry pi boots back up, it should now be overclocked. In the event that your raspberry pi fails to boot, plug it in to another computer and edit the config file.

Packages

Xmrig won't run just by itself. It will need a few packages to compile and it will need some for running too. To install the packages that you need just run the following command. sudo apt-get install git build-essential cmake libuv1-dev libssl-dev libhwloc-dev
That will install the needed packages such as cmake and git.

Installing Xmrig

The last thing that you want to do is install the mining software. To do this you need to first download the program and then set build configuration files and then build it or install it. This is extremely simple to do. The following commands will do this.
git clone https://github.com/xmrig/xmrig.git
mkdir xmrig/build && cd xmrig/build
cmake ..
make -j4

Once these commands finish up you are just about ready to mine. You first need to make a monero wallet and then head over to the xmrig config wizard and setup a file there. Just a small tip I recommend using the pool xmrpool.eu as it is fast and easier on the pi. Mining here will result in much faster mining. There is one last thing you need to do now. Put the downloaded config file in the build directory and then close all other programs head over to the terminal, make sure your in the xmrig build directory and then run sudo ./xmrig. It will also work without root privileges but using root makes your pi mine faster.

That's all for today's article and please follow so you don't miss any more great content. Also go visit my site that I just relaunched.

Discussion (0)