UPDATE DEC 2 2017: Please see comment at the bottom for a suggestion of a miner that currently works!
I’ve got a Pi 3 that’s hanging around doing nothing so I thought I would try and use it to mine some cryptocurrency, mostly for a bit of fun – I’m not sure I will make much money from it!
Many Cryptocurrencies like Bitcoin and Etherium now have a such a high difficulty that you can only mine them with a rack of dedicated graphics cards – however there are some that you can use a CPU for. I’m trying Monero as the price of it (about $50) isn’t too bad for the mining difficulty at the moment.
I found a great little script which worked first time – starting with a fresh copy of Raspbian Lite. Credit to this github repo!
Here’s a break down of what to install:
# update raspbian sudo apt-get update -y # install the following modules sudo apt-get install autoconf libcurl4-openssl-dev libjansson-dev openssl libssl-dev gcc gawk # clone this miner repo git clone https://github.com/lucasjones/cpuminer-multi.git # navigate to the directory and compile (doesn't take too long) cd cpuminer-multi ./autogen.sh ./configure make # see instructions on how to use: ./minerd --help
Mining
As for mining, you’ll need to create a Monero wallet and find a pool to join. Mining in a pool means you get a small part of the reward for the mining you do – it would still be very very unlikely to mine even one block(?), for which you’d get around 7XMR currently. I signed up to Minergate, which I have heard some complaints about (giving a low hash rate), but they do seem to credit your account. I’m earning about $0.01 per day so far!
Here’s my mining command:
./minerd -a cryptonight -o stratum+tcp://xmr.pool.minergate.com:45560 -u [email protected] -p x -t 4
-a cryptonight : This is the crypto type
-o stratum+tcp://xmr.pool.minergate.com:45560 : This is the pool and port number
-u [email protected] : My pool username
-p x : My pool password
-t 4 : Number of threads (4 because the RPi 3 is a 4 core processor)
So its very easy – next step is to make my own wallet and find a different pool to try.
10th April 2018 at 9:38 pm
INSTALLED AND WOKING 🙂
Thanks from portugal
24th March 2018 at 5:30 am
grats 🙂 nice aplication going to install it thurdsday & see how it works
2nd February 2018 at 2:52 am
Great job on this guide Andy.
This was finally the first guide of at least six or seven that finally worked for me. Yours is also the only one that specifies the number of CPU cores for the Pi3.
The next step is to figure out why the software displays 0.00 H/s for all the threads while working, but then also tells me blocks have been accepted with an average of maybe 5 H/s.
29th January 2018 at 7:47 pm
I did this as well per the original instructions and it works for me. Out of curiosity I tried the other miner and while it works it also give a “donation” to someone else!
7th January 2018 at 2:15 pm
it worked well except a format issue with command –with (converted to -)
# clone this miner repo
git clone https://github.com/tpruvot/cpuminer-multi
# navigate to the directory and compile (doesn’t take too long)
cd cpuminer-multi
./autogen.sh
./configure
./configure –with-crypto –with-curl #it’s 2 “-” before with
make
./cpuminer -a cryptonight -o stratum+tcp://xmr.pool.minergate.com:45560 -u xxx -p xxx -t 4
5th January 2018 at 9:43 pm
Not sure what the other 2 commenters are speaking of, but I installed this and ran the instructions exactly as they are above, but with my own minergate account, and I am mining just fine.
1st January 2018 at 11:25 am
Thanks to Pman for this message (below). I haven’t checked out the additional info so please leave a comment if you manage to get it working or not:
Hi Andy, Great article – The recent comment by Chris about the updated GitHub link: https://github.com/tpruvot/cpuminer-multi was handy and I managed to get it all up and running perfectly. BUT, there were a few issues I encountered and extra steps I did. I\’ve documented them below for you so hopefully you can update the article. 1. After running the \”make\” command, it failed with errors complaining about various curl and SHA things missing. Googling this issue I found the solution here: https://bitcointalk.org/index.php?topic=841401.215;imode which basically says when you do the ./configure command, you need to do ./configure –with-crypto –with-curl Then, run the make command again and it should make just fine. 2. The next command says to use ./minerd, but this doesn\’t exist. I think in this GitHub repo, they\’ve changed the name to \”cpuminer\”. In other words, everything else you\’ve got is fine, but just replace minerd with cpuminer 3. If you kill your putty/terminal session to your Pi, that\’s it, the mining\’s over! I used a nohup command to get round this, with \”nohup\” at the start, and \”&\” at the end: nohup ./cpuminer -a cryptonight -o stratum+tcp://xmr.pool.minergate.com:45560 -u INSERT_MINERGATE_EMAILADDRESS -p INSERT_MINERGATE_PWORD -t 4 & 4. This then writes the output to nohup.out inside the cpuminer-multi folder… which of course will fill up over time, so a logrotate is in order. Cheers!
2nd December 2017 at 6:16 am
Thanks to Chris for this message (below). I haven’t checked out the other miner he suggests so please leave a comment if you manage to get it working:
Hello! Your post on XMR mining is now one of the first results that happen to pop up for a person who is looking into arm mining through their Raspberry pi-s. Your post is incredibly helpful, but it seems that it is also, out of date since lucasjones’ miner has been retired, and only gives you invalid shares if you try using it. I’ve since then searched for a while until finding a replacement miner from Tpruvot (https://github.com/tpruvot/cpuminer-multi) which seems to work effectively(ish) I hence request you to put an update to this post since, you know, its one of the first set of articles people read when they get into this topic. Thanks.