How To Setup Asic Gridseed Miners using linux

by gridseeds

Part 5A.1: Linux

Credit: https://bitcointalk.org/index.php?topic=421921.msg5455483#msg5455483
Credit: https://github.com/gridseed/usb-miner/blob/master/software/doc/INSTALL_EN.pdf

Install Pre-Requisites:

Code:
sudo -s
apt-get update
apt-get install build-essential libtool libcurl4-openssl-dev libncurses5-dev libudev-dev autoconf automake screen

Grab possibly needed packages:

Code:

Install curl and jansso packages:

Code:
tar -xvf curl-7.34.0.tar.bz2 
cd curl-7.34.0/ 
./configure 
make 
make install 
cd
Code:
tar -xvf jansson-2.5.tar.bz2 
cd jansson-2.5/  
./configure 
make 
make install 
cd

Build cpuminer from git:

Code:
cd
git clone https://github.com/gridseed/usb-miner
cd ~/usb-miner/software/cpuminer
./autogen.sh
CFLAGS="-O2 -Wall -march=native" ./configure 
make
cd

*** For ubuntu 13.10 ***
Install the correct automake version so cgminer builds

Code:

Link the Jansson Libraries to fix:

Code:
./minerd: error while loading shared libraries: libjansson.so.4: cannot open shared object file: No such file or directory
Code:
sudo ln -s /usr/local/lib/libjansson.* /usr/lib/

*** END ***

Build cgminer:

Code:
cd /home/miner/usb-miner/software/cgminer
./autogen.sh
CFLAGS="-O2 -Wall -march=native" ./configure --enable-gridseed
make
cd

Link the build directories for convenience:

Code:
ln -s /home/miner/usb-miner/software/cpuminer /home/miner/cpuminer
ln -s ~/usb-miner/software/cgminer ~/cgminer

If all went well you will have the miner installed.

Now DO NOT PLUGIN the USB yet just the power cable:

Code:
tail -f /var/log/syslog

Plug in the USB cable to the computer and device:

Syslog results

*You might have /dev/ttyUSBX not ttyACMX

Now run the miner process:

Code:
sudo ./minerd --freq=600 --gc3355=/dev/ttyACM0  --url=stratum+tcp://middlecoin.com:3333 --userpass=13zKJjzxGpjbqJDAWAhFNHVqALqcsCWiat:x

Or using CGMiner Syntax

Code:
sudo ./minerd -F 600 -G /dev/ttyACM0  -o stratum+tcp://middlecoin.com:3333 -u 13zKJjzxGpjbqJDAWAhFNHVqALqcsCWiat -p x

It appears you can’t combine devices to one line like this: (worldlybedouin,Powell)

Code:
sudo ./minerd -F 600 -G /dev/ttyACM0 -G /dev/ttyACM1  -G /dev/tACM2  -G /dev/ttyACM3  -G /dev/ttyACM4  -G /dev/ttyACM5  -G /dev/ttyACM6  -G /dev/ttyACM7  -G /dev/ttyACM8  -G /dev/ttyACM9 -o stratum+tcp://middlecoin.com:3333 -u 13zKJjzxGpjbqJDAWAhFNHVqALqcsCWiat -p x

I use dynamic pool files but something like this will work:

Code:
sudo -s
cd /home/miner/usb-miner/software/cpuminer
for i in `seq 0 10`; do screen -dmS $i ./minerd -G /dev/ttyACM$i -F 800 -o stratum+tcp://stratum.scryptguild.com:3333 -u unicornhasher -px;done

use

Code:
screen -ls

to list screens and

Code:
screen -x xxxx.x

to join a screen

YAY means YAY

How I run the 10 miners to 10 separate pools:
1) Create 10 pool files named pool0.sh to pool9.sh
2) insert the FREQ NAME and POOL variables into each pool file
pool9.sh

Code:
NAME="miaviator"
POOL="-o stratum+tcp://middlecoin.com:3333 -u 13zKJjzxGpjbqJDAWAhFNHVqALqcsCWiat -p x"
FREQ="800"

3) make the mine.sh script to execute the miners

Code:
cat > mine.sh << EOF
count=0
for i in `ls /dev/ttyACM*`
do
source /home/miner/pool$count.sh
cd /home/miner/cpuminer/
screen -dmS $NAME ./minerd -F $FREQ -G $i $POOL
count=$((count+1))
done
EOF
chmod +x mine.sh

After running mine.sh for this hosting thread https://bitcointalk.org/index.php?topic=471764.0 I have the following screens:

Part 5A.2: BTC Mode

Modified from PDF and this post: https://bitcointalk.org/index.php?topic=494625.msg5465107#msg5465107

Code:
cd cgminer

To mine to my donation address for this guide:

Code:
./cgminer --gridseed-options=baud=115200,freq=800,chips=5,modules=1,usefifo=0,btc=16 --hotplug=0 -o stratum+tcp://stratum.mining.eligius.st:3334 -u 13zKJjzxGpjbqJDAWAhFNHVqALqcsCWiat -p x

Breakdown:  NEEDS HELP

Execute the Miner:

Code:
./cgminer

Enable Gridseed configuration flags

Code:
--gridseed-options=

The Serial/USB com speed (Don’t Change)

Code:
baud=115200

The chip frequency in 50 Unit steps from 600 to 900:

Code:
freq=800

The number of chips on the device (Don’t change for these devices)
*Change if you get a 10 or 25 Mh/s GridSeed box
*you bastard
* I want one

Code:
chips=5

The number of boards/modules/devices per com port (IE 1, don’t change this)

Code:
modules=1

Communications method used to talk to the device board (Don’t change)
*Correct me if I’m wrong

Code:
usefifo=0

A seemingly arbitrary number until someone tells me what its for Smiley
*The doc says 11 I’m sure there is a range

Code:
btc=16

I’d guess this allows devices, modules or chips to be added/removed while the miner is running?
*IDK and IDC

Code:
hotplug=0

Standard pool config

Code:
-o POOL:PORT -u USER -p PASS

Mining:

Mining per device vs all devices:

Code:
lsusb

Quick and dirty Bus:Device:

Code:
lsusb |grep STMicroelectronics|cut -d " " -f 2,4|sed 's/://g'|sed 's/ /:/g'

Run one or more devices using cgminers —usb flag https://github.com/ckolivas/cgminer

Code:
./cgminer --gridseed-options=baud=115200,freq=800,chips=5,modules=1,usefifo=0,btc=16 --hotplug=0 -o stratum+tcp://stratum.mining.eligius.st:3334 -u 13zKJjzxGpjbqJDAWAhFNHVqALqcsCWiat -p x --usb 001:009

or

Code:
--usb 001:009,001:013

etc.

Part 5A.3: BTC/Dual Mode

Once you turn on BTC mining you have to attache to the LTC proxy in order to mine in scrypt mode / dual mode.  Or unplug the devices and replug them so they show up as ttyACM# again?

Once you are running one or more devices in SHA mode you can start Scrypt mining in dual mode with:

Code:
./minerd -F 800 -o stratum+tcp://middlecoin.com:3333 -u 13zKJjzxGpjbqJDAWAhFNHVqALqcsCWiat -p x --dual

Can I run to 10 pools this way?  Let’s find out.

MORE TO COME with power readings and speed/clock readings.

Part 5B: WindowsHow to run miners on com ports 10+ in windows:use \.\COMXX instead of COMXX on the command line for com ports above 10

IE: —gc3355=\.\COM17

If anyone has any corrections or wants new screenshots for the windows directions let me know.

11 –Download the modified CPUminer from here or here. Extract
the archive anywhere you want.

12 –Check the com port. To connect to your miner, you need to know what comport is assigned to your miner. You can do this by pressing the windows key + the R key. So ‘Windows + R’. This should give you a small window called ‘run’. (Sorry, I am Dutch, so screenshots are in Dutch)

Enter ‘compmgmt.msc’ in the window, and hit the enter key. This should open a new window, called ‘computermanagement’.

Click ‘Devicemanager’

Now click the small arrow in front of ‘Ports (COM & LPT)’

Now you can see that in my case it says ‘STMicroelectronics Virtual COM Port (COM7)’. This means that my miner is now assigned to COM port 7. Some people have experienced problems with miners which had COM port numbers above 10, if you have a number above 10, go to step 13, otherwise go to step 14.

13 –Changing the COM port number. This step is only necessary if your automatically assigned COM port number is 10 or higher!. Like this:

In the devicemanger, right click on the ‘STMicroelectronics Virtual COM port (COMXX)’, which has a COM port number above 10. Select ‘properties’. This will open a new window, go to the ‘portsettings’ tab in that window.

Now, click ‘advanced’. This will open another window, in which you can select which COM port to use. Select one that is not in use, and click ‘ok’ after you are finished.

Also click ‘ok’ in the properties window. Make sure the COM port now has the number you selected:

If all is correct, you can close the computermanagement window.

14 –Now you know your COM port number. You can setup your miner now! Download this bat file, and save it in the folder where you extracted the miner in step 11. Make sure the bat file is in the same folder as the ‘minerd.exe’ program.

15 –Edit the bat file. Right click on the bat file, and select ‘edit’. This should open this window:

Change the ‘XXX’ of the COM port to the number you found in step 12. Make sure to change the ‘—url=’ to the url of the pool you want to mine at. Also change the ‘—userpass=’ to the workername and password of your pool (format is workername:password). If you don’t change this, you will mine for my account, which I don’t mind either of course  Grin

Save the file.

16 –Mine away! Just double click the bat file. It should start a small window, and your miner will start mining. If you have more than one miner, just make a copy of the bat file, change the COM port number, and start that one as well. You need one cpuminer window per miner.

As soon as you start seeing ‘yay!!!’ you know that your miner is working properly. This version of cpuminer is not able to show the hashrate, so your hashrate will always show ‘0.00 khash/s’, even though it is mining.