Monday, July 22, 2013

Using a Raspberry Pi to Mine LiteCoins

Raspberry_Pi_Logo.svgLitecoin_Logo
In this tutorial I assume that you already know about LiteCoin, and have already signed up to a mining pool. If not, probably best go start reading here.

To begin, lets install the latest Raspbian image on to your SD card from here. I use Win32DiskImager for this:

image

Now we boot up the pi and run through the initial setup steps. We could skip this part, but you may want to run through the steps to expand your SD card and/or overclock your pi. Be warned: overclocking may shorten the life of your pi.

After logging in to the command line, first make sure our distro is running the latest and greatest software by running the following commands

sudo apt-get update

Then…

sudo apt-get upgrade

20130721_230222

Agree to the prompt to make changes. Go and make a cup of tea while this runs, it won't be quick.

Some time later, when we have a command prompt back, we need to install the pre-requisites we need:

sudo apt-get install make automake build-essential git libcurl4-openssl-dev

20130721_232207

Agree to the prompt to continue. You may already have some of these (git for instance), which is fine.

Now we need to get the source code from Github:

git clone git://github.com/pooler/cpuminer.git
cd cpuminer


20130721_233059

We now have the cpuminer source, so now we build it

./autogen.sh
./configure CFLAGS="-O3"
make

20130721_233343


This should compile the source code into the binary we need to run. Note that the CFLAGS="-O3" option is the capital letter O for Orange, not zero.

Now we can run the miner. Provide your pool url and username/password and off you go:

./minerd --url=<pool url> --user=<username> --pass=<password> -–debug

I have specified the debug flag here in order to diagnose if there are any issues. You may want to leave that out if you're feeling confident.

You should now see something like this:

20130721_235043

As you can see, the hash rate is barely worth the effort. Even with the low power usage of the Raspberry Pi, you will be spending far more in electricity than you will gain in LiteCoins. If you have some solar panels or other free electricity source then this may become viable, but really you’d be better off selling the electricity!

If you like this article, and you’re feeling generous, here is my LTC address: LKRove4ktG8mksNCfVzcnhvdbiFBwW4tF2

1 comment:

  1. trying to test it out and I get this -bash: http://elitter.net:9327: No such file or directory
    Everything else worked great

    ReplyDelete