Trying My Hand At Scrypt Mining

So, I’ve spent the last several days just sitting back and watching my USI Tech account accumulate value.  Since I have some spare hardware lying around, I thought that today I’d try some crypto mining and see what happens.  Now I’m not deluding myself into thinking I’m going to make a ton of money doing this.  I’ve known for a long time that mining for cryptocurrency is an uphill battle against the big mining farms all over the world where the electricity prices are ridiculously cheap. So let’s dig in.

There are plenty of sites that talk about mining bitcoin and mining altcoins so I will give you my simple definition.  If you want a more detailed explanation of what’s going on, you can search google. In a nutshell, mining involves using a computer (or dedicated hardware) to solve a complex math problem.  If you solve it, you are awarded a small amount of the coin you are mining for. There are two basic algorithms used by all the miners in the world. The first is primarily used for Bitcoin and that’s SHA-256.  The one I’m focusing on today is used by most altcoins and that’s scrypt.  Different hardware is used for each algorithm so it’s rare to have a single hardware solution that mines for both SHA-256 and scrypt currencies.

I’m focusing on scrypt mining today for two reasons. First, most altcoins can still be profitable in the right conditions.  You determine whether or not it’s “profitable” to mine based on how many coins you can mine per day and the amount of electricity it takes to mine those coins.  If you can make more money than it costs to power the unit, it’s a profitable venture. Second, I have some spare hardware lying around that is capable of mining scrypt.

So, to get started, here’s a list of all the items I’m using:

  • Gridseed ASIC Miner – It’s old and there are better units available but if you just want to experiment, you can pick one of these up on eBay for around $50
  • Raspberry Pi Starter Kit – One of the coolest little computers you will find anywhere. So versatile.  If you get tired of mining, you can use it for a lot of other fun little projects
  • P3 P4400 Kill A Watt Electricity Usage Monitor – This useful little device shows you how much power you are using.

You will want to plug the Gridseed and the Raspberry Pi into a power strip and plug the power strip into the Kill A Watt so you can see how much power you are using to do the mining.

Setting it all up

Configuring the Raspberry Pi

OK, this is going to get a bit technical but this is a step by step guide to getting the Gridseed miner working with a Raspberry Pi in 2017. Most documentation on setting up this ancient piece of hardware are several years old and the links are all dead now but I did find this guide which seems to be working so far. I’m going to walk through this and document the process.

  1. Download NOOBS – Just like with any computer, the Raspberry Pi needs an Operating System (OS) to run. From my laptop, I went to the Raspberry Pi official website and downloaded the NOOBS installation package.
  2. Install NOOBS – I’m a big believer in not reinventing the wheel.  The folks over at the official Raspberry Pi website have put together some great instructional videos on how to install NOOBS. Check out their training video page here.
  3. Once NOOBS was installed, you come to the desktop screen below.  Press Ctrl-ESC (unless you have a mouse connected, which I do not) to open the Raspberry menu
  4. Click Preferences / Raspberry Pi Configuration
  5. Change the Pi to boot to CLI mode (since we don’t need the GUI to run mining).
  6. Do a shutdown / restart to reboot in CLI mode.  If you changed nothing else, it should automatically log in as the default user, pi.
  7. If you’re using a wifi adapter, you have to do the following steps as well:
    1. sudo vi /etc/wpa_supplicant/wpa_supplicant.conf
    2. Add the following:
      network={
      ssid=”your SSID”
      psk=”your SSID password”
      }
    3. Reboot the pi and type ‘ifconfig’ to get the IP address of the unit.  If you don’t care what the IP address is, you’re done.  If you want to manually set the IP address, continue to the next step.
    4. sudo vi /etc/network/interfaces
    5. Add the following:
      iface wlan0 inet static
      address 192.168.1.30
      netmask 255.255.255.0
      gateway 192.168.1.1
  8. Now your Raspberry Pi is online, on the network, and ready to be configured as a mining node

Installing CGMiner on the Raspberry Pi

  1. Use a tool like Putty to connect to your Raspberry Pi (in my example I’ll be connecting to 192.168.1.30 using the default user, pi)
  2. Once you’re in, you should be able to detect the Gridseed when you ssh into it and type lsusb command:
    pi@raspberrypi16:~/cgminer-gc3355 $ lsusb
    Bus 001 Device 006: ID 0483:5740 STMicroelectronics STM32F407
  3. Now that your device is connected and ready to go, let’s get the mining software. There is a fork of cgminer, that is specifically designed for the Gridseed that we will use. Let’s go clone it.
  4. Install git:
    $ sudo apt-get install git
  5. You need to install these packages:
    $ sudo apt-get install libncurses-dev libcurl4-openssl-dev libudev-dev
  6. Clone cgminer:
    $ git clone https://github.com/dtbartle/cgminer-gc3355.git
  7. Build cgminer:
    $ cd cgminer-gc3355
    $ ./configure -enable-scrypt -enable-gridseed
  8. Go grab a cup of coffee. This might take awhile to configure.
  9. What you are looking for is that GridSeed.ASIC is enabled.  If it is, type ‘make’ to finish the build.  Go get another cup of coffee:
  10. To use the cgminer binary to run against your mining pool, you’ll need to launch it with sudo, since it needs access to the USB device.
    I am mining multipool.us. Here is an example of the scrypt:

    $ sudo ./cgminer –scrypt -o stratum+tcp://us-east.multipool.us:7777 -u username.threadid -p x –gridseed-options=baud=115200,freq=888,chips=5

    Be patient.

    You should see some output from the cgminer:

Setting CGMiner to Autostart on Reboot

Once you’ve verified that your miner is working (log into the pool’s website and make sure your worker threads are being identified), you can set the miner to start on reboot.

  1. sudo vi /etc/rc.local
  2. Add the following at the bottom of the file (but above the exit 0 line):
    /root/cgminer –scrypt -o stratum+tcp://us-east.multipool.us:7777 -u username.threadid -p x –gridseed-options=baud=115200,freq=888,chips=5
  3. Save the file and reboot your Pi.  If you did it right, your mining pool’s website should still show your worker threads

    Check Power Draw

    Shut down the Raspberry Pi and plug everything into a power strip and plug the power strip into the Kill A Watt. Record how much power you are consuming while mining.  As you can see, in my system, I am consuming about 11 Watts of power while mining.  That’s the beauty of mining with a Raspberry Pi.  I may not be getting massive money quickly but I’m also not spending a lot in power either.

  4.  

At 11 Watts, I will draw 0.011 kW/h.  Over the course of a year that would be 96.36 kW of power.  At my current rate of approximately 0.07 per kW/h running this all year, 24×7 will cost me $6.74.  If I can generate more than $6.74 of AltCoin over the year then this will be a profitable venture.  I will post progress every so often.

About the Author Steve Bailey

Steve has been a crypto enthusiast for 5 years but only started learning the technology seriously in June of 2017. Since then, he's become widely known as a cryptocurrency expert.

follow me on: