Is it really possible? Many people ask themselves if t is possible to use their small Raspberry to earn money in general. With cryptocurrencies 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 cryptocurrencies, I must advise you that this is really hard – if not impossible – because using RPI means electricity costs, hardware usage (and failure risks) and internet connection costs.
RPI is capable to run only CPU mining, as their GPU is not enough powerful to make mining cryptocurrency efficient. For this reason, you can use it as a miner only for some cryptocurrencies allowing CPU mining (like, for example, Monero, Bytecoin and Litecoin). It will not be possible to use RPI for Bitcoin mining as this cryptocurrency relies on a blockchain using only GPU miners. The same result will occur with other only-GPU cryptocurrencies like Ethereum.
Before entering on how to mine process, let’s dig on main terms related to this topic.
What is Bitcoin?
Bitcoin is a digital currency or a cryptocurrency. An increasing number of businesses today are starting to accept Bitcoin and other cryptocurrencies (such as Litecoin and Ethereum) as a form of payment for products and services.
As a digital currency, Bitcoin is not held in your hand or kept in your pocket. Bitcoin only exists on a digital ledger known as a blockchain. Typically, people keep their bitcoins in a digital wallet.
Bitcoin is not backed by any government, central bank, or precious metal like gold; its value comes mainly from its acceptance as a currency. Some of its value also comes from its scarcity. Only a finite number of bitcoins will ever be mined, and that number is estimated to be 21 million bitcoins. But this is not expected to happen until the year 2140.
Bitcoin was created in 2009, during the banking crisis, as an alternative to traditional banking. It wasn’t always valuable, however. In 2010, bitcoin was worth about 10 cents. Today, one bitcoin is worth over $37,000, and it has been higher.
The idea behind Bitcoin as a currency was that it would not rely on traditional banks for transactions. Due to the fact it isn’t backed by a government, it should therefore not be affected by inflation. Transactions made with bitcoins can be quicker, smoother, and cheaper because the banks are taken out of the equation.
What is a Blockchain?
A blockchain is a digital ledger with information such as dates, amounts, etc. The bitcoin ledger keeps track of transactions and other types of transaction information.
Bitcoin’s blockchain is a decentralized ledger that is transparent on a peer-to-peer network. The blockchain confirms transactions without a need for a central clearinghouse like banks need.
The blockchain is a series of separate blocks in chronological order. Each block of information depends on the previous block. As the process of transaction verification continues, a chain of blocks is created. This is the blockchain.
The blockchain is unbreakable. Once a transaction has been confirmed, it is stored on the digital ledger and is protected by using cryptography. It cannot be deleted or changed without group agreement. Even if one node or computer on the chain breaks, others take its place, and the process continues, which builds trust and transparency in the blockchain.
What is Mining?
Bitcoin mining refers to the verification of transactions and awarding miners new bitcoins for their service. The purpose of mining is to allow Bitcoin nodes to reach a consensus that a transaction is valid, secure and tamper-proof.
As soon as a miner verifies a transaction, all of the nodes (the consensus) will confirm that it is valid and is then added to the blockchain. The cryptocurrency miners will be awarded Bitcoins for their work and new bitcoins are put into circulation.
Bitcoin mining also utilizes a great deal of computer power. Each transaction is sent to everyone on the network. But before the transaction is added to the blockchain, miners must solve complicated cryptographic puzzles.
CPU, GPU and ASIC Mining
CPU, GPU and ASIC are three popular methods for mining cryptocurrencies. CPU stands for central processing unit, and every computer has a CPU. In the beginning, it was possible to mine for bitcoins using a computer with just a CPU. Today, there are still some cryptocurrencies mined using a CPU.
GPU stands for graphics processing unit and is much more powerful than a CPU. GPUs are good for large amounts of calculations. It is still possible today to mine numerous cryptocurrencies using a GPU.
ASIC is an application-specific integrated circuit. Today, most miners use ASIC to mine for bitcoins and other cryptocurrencies such as Litecoin. Most of the large cryptocurrency mines use an ASIC chip because they are specifically built for this purpose.
What is a Digital Wallet?
People keep their personal cryptocurrencies in a digital wallet, and security is crucial because lost cryptocurrencies cannot be replaced. Cryptocurrencies are not protected against theft or fraud like money in the bank is.
A cold wallet is stored offline and is more secure. Hot wallets are connected to the internet and are used to carry around what you might need to spend. They are less secure than a cold wallet. There are also hardware wallets, desktop wallets, paper wallets, mobile wallets and web wallets.
A digital wallet allows users to make electronic transactions with their cryptocurrencies. Cryptocurrency can be bought and sold through exchanges and either put in or taken out of the wallet. Cryptocurrencies are traded similarly to stocks and they are used for purchases such as a cup of coffee, a new computer, or any item as long as the business selling the goods accepts the cryptocurrency as payment.
In this tutorial I will explain a step-by-step guide to use your Raspberry PI as miner. I will use a Raspberry PI 3 model B, but this guide works also with other Raspberry PI boards,
What we need
As usual, I suggest adding from now to your favourite e-commerce shopping cart 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 the shopping cart. So, hardware will be only:
- Raspberry PI computer board (including proper power supply or using a smartphone micro usb charger with at least 3A)
- high speed micro SD card (at least 16 GB, at least class 10)
I strongly suggest evaluating buying a case with a 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, a 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 the 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 this example, I will mine Monero. From the terminal, use the 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 the 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:
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?