Is it really possibile?
Many people ask themselves if t is possible to use their small Raspberry to earn money in general. With criptocurrencies spreading all over the world, mining has become really popular and easy to access also with a very simple PC. But, honestly, if you are expecting to generate an income by mining criptocurrencies, I must advise you that this is really hard. However, I will explain a step-by-step guide to make possible mining in our Raspberry.
What we need
As usual, I suggest adding from now to your favourite ecommerce shopping chart all needed hardware, so that at the end you will be able to evaluate overall costs and decide if continuing with the project or removing them from shopping chart. So, hardware will be only:
- Raspberry PI (including proper power supply or using a smartphone micro usb charger with at least 3A)
- micro SD card (at least 16 GB, at least class 10)
I strongly suggest to evaluate buying a case with cooling system with fans (for example give a try searching Raspberry PI Case with cooling on Amazon).
I will configure my raspberry by ssh connection from my PC with Putty.
I will also use as mining software “cpuminer-arm” from afritzler. This is a multi-threaded CPU miner, fork of pooler’s cpuminer and supports a wide number of algorithms. All is simplified using Docker: our CPU miner will run inside a container so that – once installed Docker – enabling it will require a single line command.
You also should choose a mining pool. Please check Solo mining versus pool mining to see differences between solo mining and pool mining. For example, I use Minergate: this a simple way to start learning to mine. Just signup and get your cryptocurrency mining link.
Prepare your RPI operating system installing Raspberry PI OS Lite.
Once done, proceed installing Docker in your Raspberry PI.
From here we don’t need any dependencies or installation for our container to run.
Choose your coin to be mined: in the this example I will mine Monero. From terminal, use following command, changing <<yourEmail@address>> with your Minergate registration email:
docker run -d --name minerd -e ALGO="cryptonight" -e URL="stratum+tcp://xmr.pool.minergate.com:45700" -e EMAIL="<<yourEmail@address>>" -e THREADS="2" afritzler/cpuminer-arm:latest
This command will download (only for first time) container image and run a container named minerd. “-e THREADS=”2″ ” identify how many CPU you are dedicating to mining. Keep low this value without cooling fans, to avoid hardware failures.
Looking in logs we will see that it is working:
pi@raspberrypi:~ $ docker logs minerd [2020-06-30 17:20:02] Using JSON-RPC 2.0 [2020-06-30 17:20:02] CPU Supports AES-NI: NO [2020-06-30 17:20:02] Starting Stratum on stratum+tcp://xmr.pool.minergate.com:45700 [2020-06-30 17:20:02] 2 miner threads started, using 'cryptonight' algorithm. [2020-06-30 17:20:02] Pool set diff to 2000 [2020-06-30 17:20:02] Stratum detected new block [2020-06-30 17:20:02] thread 0: 1961878880 hashes, 0.00 H/s [2020-06-30 17:20:02] thread 1: 1951393120 hashes, 0.00 H/s [2020-06-30 17:20:48] thread 1: 1951393120 hashes, 0.00 H/s [2020-06-30 17:20:48] accepted: 1/1 (100.00%), 4.83 H/s at diff 2000 (yay!!!) [2020-06-30 17:20:55] thread 0: 1961878880 hashes, 0.00 H/s [2020-06-30 17:21:44] thread 1: 1951393120 hashes, 0.00 H/s
And (after first accepted mine) your Minergate Dashboard will show your active worker.
You can stop / start this docker container when you want with:
docker stop minerd docker start minerd
You need to stop and remove minerd container to change running options.
Take a continuous look on system temp with the following command:
watch cat /sys/class/thermal/thermal_zone0/temp
which gives you a continuous look to system temperature (divide resulting number by 1000 and you have temperature in °C).
Check hardware prices with following links: