Raspberry Pi – CGMiner – Bitcoin adventures.

Raspberry Pi with CGMiner making the bitcoins.

My Raspberry Pi runs almost 24/7 with some of the projects that we've done in the past such as OpenSIM and installing Airplay onto it so that we can send music to the amplifier to my living room and even running some P2P programs to get my latest Linux distros faster. Because it runs on a 24/7 basis that means that I'm pissing 3 watts of power non-stop. We decided to out my Pi to work on getting me bitcoin currency.

We're not overly serious about Bitcoin and also are fully aware that the hash rate I am running at is pathetic now that ASIC miners are everywhere. But it's one more thing for my Pi to do, and who knows. In 3-4-6 months, I might not only pay for the ASIC block eruptor but the Raspberry Pi itself!

Following Adafruits entry on bitcoin mining. I not only did not want to output to screen because I telnet into my Pi and I just use the "screen" command to minimize it in the background whenever I log out. I was having problems actually reading the data that was coming down from many of the pools and it turned out that cgminer is too old (This is because at the time the suggested 3.1.1 as there were interface issues ASIC mining.

Well, enough time has passed, and I found out that they are up with v3.6.1 which we downloaded.

wget http://ck.kolivas.org/apps/cgminer/cgminer-3.6.1.tar.bz2

Then from there, you can continue following the compilation according to adafruit which is

tar xvf cgminer-3.6.1.tar.bz2
cd cgminer-3.6.1
./configure --enable-icarus

and then make a pool.conf file with whatever pool you are linking up to, example for Horrible Horrendous Terrible Tremendous:

    "pools" : [
    "url" : "stratum.hhtt.1209k.com:3333",
    "user" : "YourBitCoinReceiveWalletHere",
    "pass" : "PasswordDoesNotMatterOnHHTT"
    "api-listen" : true,
    "api-port" : "4028",
    "expiry" : "120",
    "failover-only" : true,
    "log" : "5",
    "no-pool-disable" : true,
    "queue" : "1",
    "scan-time" : "60",
    "worktime" : true,
    "shares" : "0",
    "kernel-path" : "/usr/local/bin",
    "api-allow" : "0/0",
    "icarus-options" : "115200:1:1",
    "icarus-timing" : "3.0=100"

The major difference from 3.1.1  is how you launch cgminer since you no longer rely on the -S flag to talk to your ASIC chips via serial, it actually searches out your USB bus for your ASIC chips now which means your flags have changed.

./cgminer --config ./pool.conf --usb :1

Wherever "--usb :1" represents the number of ASIC block devices you have on your Pi. If you have 4 you change it to "--usb :4"

cgminer-3.6.1-on-raspberry-pi And off it goes! Works with just one ASIC just fine. I'm probably going to get the usual 4 for a Raspberry Pi just so it looks pretty. And at $15 an ASIC chip versus the $100's it used to be I can't go terribly wrong. Since Bitcoin is rather new clients will be released rather quickly (Last week 3.5.0 was the newest CGMiner) so you can always download the latest version and compile it in a separate directory, transport your .conf file over and try it out.

bitcoin USB hub poweredErruptors spaced out to prevent overheating.


An important note about USB hubs.

After a lot of headaches scratching my head wondering why I can only get two of my bitcoin miners working, or they would all activate but all but one gives nothing but hardware errors. I found out that not all USB hubs are created equal. Even after bypassing the power distribution and going direct power from a 5volt to power the ASIC's. no good. After wandering the malls I picked up a USB hub from best buy for $20 open box special. it was a Dynex 7-port USB hub that had a 3.5amp power supply backing the charge to it. Which is kind of awesome? I found out that not only was the power distribution and chip-set in the hub stable for mining. But I was also able to power my raspberry pi off of the same power supply (which is what the black wire is coming off of it.) As for the white wire, that's for my audio DAC for AirPlay listening because if it's going to eat power it minus well be mufti-function. cgminer with 4 ASIC processors on raspberry pi for bitcoin mining Update: 12/12/13 - Just wanted to show you that it does indeed work with 4 ASIC miners and that my previous screenshot only showed just one. This time I'm mining on DeepBit which is an obnoxious mining pool because there's a lot of lag going on. Currently running continuously for 4 days. It was running for a week solid but I had to restart it due to some weird error I was getting about opening the USB Library. I'll record it the next time I see it.

How many ASIC erruptors can a single Pi run?

It really is not a question of how many can you run per se. It's more of a question of how much power are you willing to dedicate to your bitcoin farm. I've seen Pi's running 32 USB ASIC erruptors. But those 32 erruptors were running on its own 60watt power supply. Although ASIC miners are the most efficient energy-wise. They still take a bit of power! In my configuration I have a 3 amp power supply. The four miners taking 2 amps (so my power supply was around 36 watts to power the Pi and Erruptors), and the Pi/DAC taking the last amp. It works and I can't complain! Also, depending on what version of cgminer you are running there can be some stability issues (lockups and crashes) and thus people have diversified their mining pools over multiple pis instead of relying on just one. Happy mining party people!

What about Banana Pi?

banana-pi-logoI didn't have any problems running with the Banana Pi. In fact, I think it was a little more stable to run Because Occasionally I would have to reset my Raspberry Pi's as they would lock up from time to time bouncing off of the USB ports all of the time. I have not tried the Raspberry Pi v2 yet. But I ran them for about 3 months without having to restart


 Update 6/18/14 - A Special note about bitcoin cgminer exceeding 4.x

For some weird reason, it's not reading my configuration files like 3.x did. I'm currently working around this with the following command typed into the script in the root of the cgminer folder. For connecting to the deepbit pool using 4 ASICs connected to your Pi as an example.:

./cgminer -o http://pit.deepbit.net:8332 -u username@here.com_0 -p passwordhere --usb :4

I'm not entirely sure why 4.x is being so picky about configuration files. I will post an update when I figure this out.

Update 12/16/18 - Locking entry.

We're locking this entry on the grounds of age and the simple fact that we're not your financial advisors. I'm not going to provide advise as to what Crypto is hot, what pools to join as well as support for your hardware. This article was posted as an example scenario of how I mined a long time ago and that is it.


2 thoughts on “Raspberry Pi – CGMiner – Bitcoin adventures.

    • I think you need to a space in between the "-usb" and ":15" otherwise it thinks your still talking about the flag itself instead of the variable. Also don't forget about double-dashes indicating your flag is a word!

      here's how my script is to launch my bitcoins for HHTT.
      /d0/bitcoin/cgminer-3.8.5/cgminer --config /d0/bitcoin/cgminer-3.8.5/hhtt.conf --usb :4

      Hope that helps you! Thanks for checking out my site!

      - S

Comments are closed.