peontky
Posts: 1
Joined: Fri Mar 06, 2015 9:22 pm

How to add cgminer 4.8.0 on pi raspbian

Fri Mar 06, 2015 9:31 pm

I am going crazy . I can't find any help about this issue. I got Raspbian but can't find out how to down load the antminer U3 drivers or CGminer 4.8.0. on my pi.

can someone link me to the right site or write the script need to get it in.

User avatar
DougieLawson
Posts: 42748
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: How to add cgminer 4.8.0 on pi raspbian

Sat Mar 07, 2015 9:27 am

You need to call the emergency services, Google is broken in your part of the World.

https://www.bcoinnews.com/tutorials/cgm ... pberry-pi/
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

yohomiedude
Posts: 5
Joined: Wed Mar 25, 2015 11:11 pm

Re: How to add cgminer 4.8.0 on pi raspbian

Thu Mar 26, 2015 12:17 am

That link is useless if you're running an Antminer U3, here's how I got mine working using screen and PuTTY.

Run a fresh install of Raspbian using NOOBS, after the install type ifconfig and make a note of the IP address, so that you can remotely SSH into your Pi. Login via PuTTY with the default username/password, then raspi-config if you would like to change the hostname, default password and so on.

Now update the Pi:
sudo apt-get update
sudo apt-get upgrade


Install dependencies:
sudo apt-get install libusb-1.0-0-dev libusb-1.0-0 libcurl4-openssl-dev libncurses5-dev libudev-dev screen libtool automake pkg-config libjansson-dev screen

Clone cgminer from here:
git clone https://github.com/bitmaintech/cgminer

Install, configure and also enable bmsc options:
cd cgminer
sudo ./autogen.sh
export LIBCURL_CFLAGS=’-I/usr/include/curl’
sudo ./configure --enable-bmsc
sudo make


Test cgminer is working correctly by running the following (input your own pool, username and password):
sudo ./cgminer --bmsc-options 115200:0.57 -o POOL -u USERNAME -p PASSWORD --bmsc-voltage 0800 --bmsc-freq 1286

Type Q to exit cgminer...

Now, add cgminer to start automatically when the Pi is powered on and create a screen session:
sudo nano /etc/rc.local - remember, Ctrl-X to exit, then type Y and press Enter to save changes.
Add this just above exit 0, again enter your own pool, username and password:
cd /home/pi/cgminer
screen -dmS cgminer ./cgminer --bmsc-options 115200:0.57 -o POOL -u USERNAME -p PASSWORD --bmsc-voltage 0800 --bmsc-freq 1286


My Antminer U3 is running at around ~59-60Gh/s, hopefully yours should be the same. You can play around with voltage and frequencies by following the table in the official manual, found here http://bit.ly/1BMXNXL, there's no real need to change what I suggested above though. You can also SSH into your Pi at any time and run sudo screen -x cgminer to view your cgminer screen. And if your Pi is failing to communicate with your Antminer U3 via cgminer, unplug and reconnect the USB cable.

If you found this useful, I accept Bitcoin donations by following this link http://bit.ly/1GWElN4 ... Hope I helped! :D

User avatar
eriktheitalian
Posts: 358
Joined: Thu Feb 19, 2015 1:03 pm

Re: How to add cgminer 4.8.0 on pi raspbian

Sun Mar 29, 2015 11:39 pm

Need some experiments with gcc "cflags".Linaro gcc better for performance when compared raspbian default gcc.
I cant using enough English language. My writings can be wrong grammer.$
"in micro$oft we not trust"

tommydark
Posts: 2
Joined: Thu May 07, 2015 7:09 am

Re: How to add cgminer 4.8.0 on pi raspbian

Thu May 07, 2015 7:14 am

hi !
i have 4 g blade 5.2 MH , usb hub and i need help to run this in raspberry Pi 2 B . I try with bfgminer but not found usb device ,,M,, and + not work!
Thank you very much!

definer
Posts: 1
Joined: Sat May 16, 2015 2:48 am

Re: How to add cgminer 4.8.0 on pi raspbian

Sat May 16, 2015 2:53 am

This is the MOST straightforward discussion of how to install cgminer on a R-Pi that I've read. It worked FLAWLESSLY!!

tommydark
Posts: 2
Joined: Thu May 07, 2015 7:09 am

Re: How to add cgminer 4.8.0 on pi raspbian

Sat May 16, 2015 12:59 pm

I succeed :))) Thank you!

yohomiedude
Posts: 5
Joined: Wed Mar 25, 2015 11:11 pm

Re: How to add cgminer 4.8.0 on pi raspbian

Sun May 17, 2015 10:51 pm

definer wrote:This is the MOST straightforward discussion of how to install cgminer on a R-Pi that I've read. It worked FLAWLESSLY!!
tommydark wrote:I succeed :))) Thank you!
Hey, great news! Happy you both got things sorted :)

kelten
Posts: 1
Joined: Wed Jun 17, 2015 2:34 am

Re: How to add cgminer 4.8.0 on pi raspbian

Wed Jun 17, 2015 2:43 am

ajweller88 wrote:Test cgminer is working correctly by running the following (input your own pool, username and password):
sudo ./cgminer --bmsc-options 115200:0.57 -o POOL -u USERNAME -p PASSWORD --bmsc-voltage 0800 --bmsc-freq 1286
I'd like to thank you for your post. You made it extremely easy for me, who is brand new to raspberry pi, to get my miners up and running.

I'd like to add one side note related to an issue I ran into while running cgminer on my pi with the above command. It turned out that cgminer would crash/halt after a few minutes of hashing without notice or any error. So I did some digging and found the --lowmem option to be the fix. So i'm under the assumption that raspbian and/or the pi itself was killing the cgminer process due to excessive memory usage.

tl;dr: Thanks! Try adding --lowmem if cgminer keeps crashing during hashing.

yohomiedude
Posts: 5
Joined: Wed Mar 25, 2015 11:11 pm

Re: How to add cgminer 4.8.0 on pi raspbian

Mon Jun 22, 2015 10:05 am

kelten wrote: I'd like to add one side note related to an issue I ran into while running cgminer on my pi with the above command. It turned out that cgminer would crash/halt after a few minutes of hashing without notice or any error. So I did some digging and found the --lowmem option to be the fix. So i'm under the assumption that raspbian and/or the pi itself was killing the cgminer process due to excessive memory usage.

tl;dr: Thanks! Try adding --lowmem if cgminer keeps crashing during hashing.
Thanks kelten, good to hear you got it working too :)
I haven't had any memory issues, I'm wondering if its because you have a different model Pi compared to myself, I've got a Pi 2B which has 1GB RAM.

nickel
Posts: 1
Joined: Mon Jun 22, 2015 3:33 pm

Re: How to add cgminer 4.8.0 on pi raspbian

Mon Jun 22, 2015 3:35 pm

[2015-06-22 15:30:28] Failed to resolve (?wrong URL) uk1.ghash.io:3333
[2015-06-22 15:30:36] Waiting for work to be available from pools.
[2015-06-22 15:31:26] No servers were found that could be used to get work from.
[2015-06-22 15:31:26] Please check the details from the list below of the servers you have input
[2015-06-22 15:31:26] Most likely you have input the wrong URL, forgotten to add a port, or have not set up workers
[2015-06-22 15:31:26] Pool: 0 URL: stratum+tcp://uk1.ghash.io:3333

STRAYDOG0626
Posts: 1
Joined: Sat Jul 18, 2015 3:25 am

Re: How to add cgminer 4.8.0 on pi raspbian

Sat Jul 18, 2015 3:42 am

I followed this video

https://www.youtube.com/watch?v=dPWTSytzN7g

that follows this tutorial and everything worked smoothly... im working with slush's pool and using putty to conect to my pi.

all i see is this


--------------------------------------------------------------------------------
(5s):0.000 (1m):0.000 (5m):0.000 (15m):0.000 (avg):0.000h/s
A:0 R:0 HW:0 WU:0.0/m
Connected to us-east.stratum.bitcoin.cz diff 256 with stratum as user AUSTprt523.worker1
Block: ee6d70e7... Diff:51.1G Started: [20:37:47] Best share: 0
--------------------------------------------------------------------------------
SB management [P]ool management ettings [D]isplay options [Q]uit
--------------------------------------------------------------------------------
[2015-07-17 20:38:25] -----------------start freq-------------------
[2015-07-17 20:38:25] Send frequency 82128614
[2015-07-17 20:38:26] Send freq getstatus 84000400
[2015-07-17 20:38:28] Send freq getstatus 84000400
[2015-07-17 20:38:28] ------recv freq getstatus no data finish------
[2015-07-17 20:38:29] -----------------start nonce------------------
[2015-07-17 20:38:29] Bmsc send golden nonce1
[2015-07-17 20:38:30] Bmsc recv golden nonce timeout
[2015-07-17 20:38:30] ---------------------start voltage----------------------
[2015-07-17 20:38:30] Send voltage aab800c0
[2015-07-17 20:38:30] Send voltage ok
[2015-07-17 20:38:30] -----------------start freq-------------------
[2015-07-17 20:38:31] Send frequency 82128614
[2015-07-17 20:38:31] Send freq getstatus 84000400


the top isn't refreshing the hash rate so i dont know how its doing but the bottom (start nonce, start voltage, and start freq) part just keeps looping with different values.

and when i go to slushes pool dashbord it doenst say any of my workers are going.... also my ASIC Miner Block Erupters led is off but it was solid the whole time i was setting it up...

charlie.us
Posts: 1
Joined: Sun Aug 09, 2015 4:28 am

Re: How to add cgminer 4.8.0 on pi raspbian

Sun Aug 09, 2015 4:32 am

Good day

I'm new in linux and the terminal. When i close my ssh session (putty) the cgminer is stopped. how can i close ssh session and leave the cgminer working?

Thank you so much, and sorry for my noob question.

User avatar
DougieLawson
Posts: 42748
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: How to add cgminer 4.8.0 on pi raspbian

Sun Aug 09, 2015 10:12 am

nohup cgminer &
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

SonOfAMotherlessGoat
Posts: 690
Joined: Tue Jun 16, 2015 6:01 am

Re: How to add cgminer 4.8.0 on pi raspbian

Sun Aug 09, 2015 5:41 pm

Wouldn't this be a good time to learn about

Code: Select all

screen
and

Code: Select all

screenie
.
Account Inactive

keithgagne
Posts: 2
Joined: Sat Oct 03, 2015 2:58 pm

Re: How to add cgminer 4.8.0 on pi raspbian

Sat Oct 03, 2015 3:08 pm

Another happy customer. I got my two U3 up and mining on PI with 119 avg.
ajweller88 - you wrote some of the best instructions and well defined steps I have ever seen. Great Job!

yohomiedude
Posts: 5
Joined: Wed Mar 25, 2015 11:11 pm

Re: How to add cgminer 4.8.0 on pi raspbian

Mon Nov 02, 2015 9:37 pm

STRAYDOG0626 wrote:the top isn't refreshing the hash rate so i dont know how its doing but the bottom (start nonce, start voltage, and start freq) part just keeps looping with different values.

and when i go to slushes pool dashbord it doenst say any of my workers are going.... also my ASIC Miner Block Erupters led is off but it was solid the whole time i was setting it up...
Sorry for the late reply, I don't really browse these forums, anyway... Could be a couple of things
  • 1. Looks like your frequency is incorrect, or even try removing the frequency altogether to see if it automatically adjusts for you?
    2. You *may* need to clone cgminer from a different repository as this is for Bitmain miners only.
Another thing to note is that I've only tested this working 100% on the Antminer U3.
charlie.us wrote:Good day

I'm new in linux and the terminal. When i close my ssh session (putty) the cgminer is stopped. how can i close ssh session and leave the cgminer working?

Thank you so much, and sorry for my noob question.
As "SonOfAMotherlessGoat" mentioned, you need to use screen to have it running in the background, I also suggest having your Pi start mining on boot to minimize potential downtime if your Pi restarts for whatever reason.
keithgagne wrote:Another happy customer. I got my two U3 up and mining on PI with 119 avg.
ajweller88 - you wrote some of the best instructions and well defined steps I have ever seen. Great Job!
Awesome! Happy to hear you got it working and for your kind words :D

troycopes
Posts: 1
Joined: Thu Nov 19, 2015 11:40 pm

Re: How to add cgminer 4.8.0 on pi raspbian

Thu Nov 19, 2015 11:44 pm

What about connecting multiple Antminers to a Raspberry Pi after doing this for your first one? Will this command allow for, say, 4 miners to be connected to the Pi (2 model b) or will additional commands be needed to recognize each miner?

Also, do each miner need to be set up as their own workers for your chosen mining pool? Or will all hooked into one Pi be 1 miner?

keithgagne
Posts: 2
Joined: Sat Oct 03, 2015 2:58 pm

Re: How to add cgminer 4.8.0 on pi raspbian

Fri Nov 20, 2015 11:33 am

For my setup, I have 2 Antminer U3 connected to the PI. No special command for multiple miners though I am not sure if there is an upper limit to the number of miners that can be attached. The PI/cgminer app detects the additional miner and adds it to the same pool, so I am getting 120-125 GH combined on the one pool worker. I believe I read about options for separating them into different pools, but I chose to keep it simple and no need to differentiate between the 2 miners.

Jawsh
Posts: 3
Joined: Fri Dec 04, 2015 12:38 am

Re: How to add cgminer 4.8.0 on pi raspbian

Fri Dec 04, 2015 12:45 am

Used the info here to setup 2 Pi 2s running Antminer U3s (2 on 1 and 1 on another)

I went ahead and reserved some IPs for the Pis so they quit changing on me, too...

One Pi is running off of a 12 volt battery connected to an inverter, directly off of the USB port on the inverter. The single U3 on it is currently powered by the grid, but not for long. It'll also be connected to that battery, once I have more panels up to support it.

The other is my dev environment with 2 U3s connected to a computer power supply, since the reseller didn't ship the power supplies with the U3s, but instead included a cable that connects to 6 pin 12v... Least the PSU only draws on demand.

Now they immediately start mining when they boot up and I can just remote in and open screen to see their activity. :)

mnk
Posts: 2
Joined: Thu Dec 10, 2015 4:15 pm

Re: How to add cgminer 4.8.0 on pi raspbian

Thu Dec 10, 2015 4:19 pm

Thanks ajweller88!

I got all the way unto "
Test cgminer is working correctly by running the following (input your own pool, username and password):
sudo ./cgminer --bmsc-options 115200:0.57 -o POOL -u USERNAME -p PASSWORD --bmsc-voltage 0800 --bmsc-freq 1286
"

I added my POOL, USERNAME and PASSWORD, but when I hit enter, putty gives me the following error, even though I am in the cgminer directory:

sudo: ./cgminer: command not found


What is the reason for this error? How can I fix it?

I would be soooo happy to understand it.

All the best,
mnk

Jawsh
Posts: 3
Joined: Fri Dec 04, 2015 12:38 am

Re: How to add cgminer 4.8.0 on pi raspbian

Fri Dec 11, 2015 6:50 pm

Are you in the cgminer directory? If not... cd cgminer...

Guessing you probably didn't finish it up with "sudo make" or the configuration command that precedes it, though. After you do make, cgminer is executable

mnk
Posts: 2
Joined: Thu Dec 10, 2015 4:15 pm

Re: How to add cgminer 4.8.0 on pi raspbian

Sat Dec 12, 2015 1:36 am

"sudo make" results in the following:

Part 1 of 2:
Image

Part 2 of 2:
Image


i am indeed in the cgminer directory but still am getting the same error (sudo: ./cgminer: command not found) when after "sudo make" entering the edited version of "cd /home/pi/cgminer
screen -dmS cgminer ./cgminer --bmsc-options 115200:0.57 -o POOL -u USERNAME -p PASSWORD --bmsc-voltage 0800 --bmsc-freq 1286".

any ideas how to fix it?

Jawsh
Posts: 3
Joined: Fri Dec 04, 2015 12:38 am

Re: How to add cgminer 4.8.0 on pi raspbian

Thu Dec 17, 2015 8:42 pm

Can't see the pics...

Mrwaffles
Posts: 1
Joined: Mon Dec 21, 2015 2:10 am

Re: How to add cgminer 4.8.0 on pi raspbian

Mon Dec 21, 2015 2:12 am

Thanks this helped so much!
Last edited by Mrwaffles on Mon Dec 21, 2015 3:51 pm, edited 1 time in total.

Return to “Raspberry Pi OS”