Bitcoin Forum

Bitcoin => Mining software (miners) => Topic started by: jamesg on February 23, 2012, 01:03:47 PM



Title: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: jamesg on February 23, 2012, 01:03:47 PM
Hello fellow bitcoiners!

I am willing to pay 5 BTC for clear, step-by-step instructions for using the latest cgminer build with the --scal-serial option ON LINUX.

Specifically, the instructions should include:

- How do detect what serial port each BFL unit is on.
- What exactly needs to be added to the --scan-serial option.
- Any other tidbits to make others life easier as more singles arrive.

The first one to post the instructions that I can follow with get the bounty.

Thanks,
gigavps


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: bulanula on February 23, 2012, 01:36:40 PM
See your "dmesg" and maybe "logread" to see when you plug and unplug the device to see the serial port.

It should be something like "/dev/ttyUSBx" with "x" being a number like 0 or 1 etc.

Then launch cgminer with the --scan-serial option like this :

./cgminer --scan-serial /dev/ttyUSB1

in case your device uses 1 etc.

Make sure to compile cgminer with the BFL support because it comes disabled by default ( or if you are using the binaries the same applies and you need to compile manually with BFL support on ).

https://github.com/ckolivas/cgminer how to compile.

Thank you and 1M1Eo8upubkEmCqmhnMvVMfEyQiYbCXxKS if I helped.


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: jamesg on February 23, 2012, 01:43:36 PM
See your "dmesg" and maybe "logread" to see when you plug and unplug the device to see the serial port.

It should be something like "/dev/ttyUSBx" with "x" being a number like 0 or 1 etc.

Then launch cgminer with the --scan-serial option like this :

./cgminer --scan-serial /dev/ttyUSB1

in case your device uses 1 etc.

Make sure to compile cgminer with the BFL support because it comes disabled by default ( or if you are using the binaries the same applies and you need to compile manually with BFL support on ).

https://github.com/ckolivas/cgminer how to compile.

Thank you and 1M1Eo8upubkEmCqmhnMvVMfEyQiYbCXxKS if I helped.

Hi Bulanula,

"maybe" is not something I am looking for here. Please provide step-by-step instructions to claim the bounty.

I have tried using dmesg and the output I get I am unable to comprehend.


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: -ck on February 23, 2012, 01:58:29 PM
Dunno anything about windows, but on linux...

Try this:

Code:
lsusb

then look for the device in the listing
Bus 002 Device 003: SOME KIND OF AWESOME MINING DEVICE NAME

Then based on the values of bus and device 2 and 3 above.

Code:
--scan-serial /dev/bus/usb/002/003


Just a guess since I didn't really do the bitforce code. Note it's meant to detect devices automatically though, but I have no experience with them...


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: kano on February 23, 2012, 02:59:40 PM
When you don't have the device plugged in:
Code:
dmesg | tail
and notice the contents - (the last few lines - to spot next time)
Code:
ls -ort /dev/ttyUSB*
and notice the list of devices
(there will probably be none and you get an error)

Then plug in the device
Code:
dmesg | tail
and look for "now attached to ttyUSBx" you may get two e.g. ttyUSB0 and ttyUSB1
this may also take a minute to appear so you may need to repeat
Code:
dmesg | tail
a few times until it does

Next you can also repeat
Code:
ls -ort /dev/ttyUSB*
and notice the (new) list of devices - i.e. ignore the ones that were there before at the start if there were any
Here you should see the same devices as with dmesg

Now you know the ttyUSBx (assuming they are 0 and 1) try:
Code:
cgminer ... ... ... -S /dev/ttyUSB1
if that doesn't work then it will be:
Code:
cgminer ... ... ... -S /dev/ttyUSB0
(where ... ... ... are all the other options you usually use)

If you still can't get it to work post the output of
Code:
ls -ort /dev/ttyUSB*
and say the time you did it (v.s. the time it will show on the devices)
and also post the output of
Code:
dmesg
on it's own from when you first did "dmesg | tail"
i.e. "dmesg" on it's own will show you from a long time back, but you just what from the point where you plugged in the BFL


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: marked on February 24, 2012, 02:40:35 AM
Code:
dmesg | tail
a few times until it does

should be able to use

Code:
dmesg | tail -f 

to follow output until ctrl-c to break out of it.


marked


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: kano on February 24, 2012, 03:38:55 AM
Code:
dmesg | tail
a few times until it does

should be able to use

Code:
dmesg | tail -f 

to follow output until ctrl-c to break out of it.


marked
Yep - I was just trying to make it a simple - how to check ... to avoid "it stops and nothing happens" :D


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: zefir on February 24, 2012, 09:29:31 AM
Hello fellow bitcoiners!

I am willing to pay 5 BTC for clear, step-by-step instructions for using the latest cgminer build with the --scal-serial option ON LINUX.

Specifically, the instructions should include:

- How do detect what serial port each BFL unit is on.
- What exactly needs to be added to the --scan-serial option.
- Any other tidbits to make others life easier as more singles arrive.

The first one to post the instructions that I can follow with get the bounty.

Thanks,
gigavps
Hello gigavps,

you better should have asked what you want to achieve instead of how ;)

So I read you are going to get 10 BitForces and assume you need to know how to attach them to your PC. My BitForces will arrive hopefully soon, until then this is just what I get from reading Luke's implementation of the BFL support for cgminer. It seems that a auto-scan mode is available, i.e. you just set
Code:
--scan-serial auto

Thats it. The BFL module will loop through all BFL serial attached devices (prefixed with 'BitFORCE_SHA256') in "/dev/serial/by-id" and use all found ones for mining. This works for Linux only, but that's what you asked for. With the current implementation there is no plug-and-play support, i.e. devices are scanned only during startup of cgminer.


One different thing you might be very interesting in: user Xiangfu (who did the Icarus support for cgminer) integrated cgminer into OpenWRT, so you basically should be able to control your BitForce mining farm with your existing WLAN router. I am working on a stripped down cgminer version for FPGA devices only for OpenWRT to leave some resources for additional management software (like BAMT) to be run on the router.


Cheers, Zefir

PS: if thats good enough to get the bounty, please send it to Luke.


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: kano on February 24, 2012, 10:30:42 AM
I presume the problem is that didn't work on his machine
(hmm just noticed Luke-jr forgot to put "auto" in the docs - I'll tell him now :P)

though I'm not sure if it works on pre 3.0 kernels either ...
e.g. 11.04 xubuntu doesn't have it and it is pre 3.0

Edit: nope I'm wrong, 11.04 does have it and that may also explain if gigvaps already tried it:
As I mentioned above about waiting for the USB ports to appear ... the same is also true of course of the /dev/serial/ structure
... especially if you are already GPU mining :)
(that's what happened for me on my 11.04 miner - the /dev/serial/ didn't appear at first when I looked for it and I didn't think to wait)
So yeah "--scan-serial auto" should work but it's slow to appear and if you are already GPU mining - it's can be REALLY slow to appear.
So if you just plugged the BFL into the USB port, don't start cgminer with "--scan-serial auto" until "ls /dev/serial/by-id/" shows something other than an error and lists your BFL


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: bulanula on February 24, 2012, 11:32:14 AM
So who got the bounty ???


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: kano on February 24, 2012, 12:39:30 PM
BFL :P


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: jamesg on February 24, 2012, 01:33:51 PM
If the auto thing was undocumented but works, zefir will get the bounty. He seems to have pointed me to the magic (undocumented) pill.

I will not be able to find out until this weekend when I can get the latest version of BAMT working on a rig.


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: kano on February 26, 2012, 02:05:05 AM
I wouldn't bother giving it to Luke-jr as zefir suggested - just give it to zefir.
I asked Luke-jr to update the README and he wouldn't
So I updated it as follows:
Code:
--scan-serial|-S <arg> Serial port to probe for FPGA mining device

     With "-S auto", BitForce enabled and only on linux, cgminer will attempt
     to automatically find BitForce FPGA devices
     Note that the computer may take some time to recognise the USB device
     when it is first plugged in - especially if the system is slow or busy
     (e.g. already GPU mining)

     On linux <arg> is usually of the format /dev/ttyUSBn
     On windows <arg> is usually of the format COMn
       (where n = the correct device number for the FPGA device)

(aside Luke-jr has just got his BitForce device and is using it also)


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: kano on February 26, 2012, 02:12:31 AM
OK solution now :)
You need a bitforce enabled version of cgminer.
It's off by default.
So if you get it from github the compile steps are changed to:
Code:
./autogen.sh
CFLAGS="-O2 -Wall" ./configure --enable-bitforce
make
Edit: and it also does an auto scan if you don't use "--scan-serial" at all
(i.e. the '--scan-serial auto' isn't needed if you just run a cgminer with bitforce code enabled - it will run an 'auto' anyway)


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: zefir on February 26, 2012, 10:54:40 AM
OK solution now :)
You need a bitforce enabled version of cgminer.
It's off by default.
So if you get it from github the compile steps are changed to:
Code:
./autogen.sh
CFLAGS="-O2 -Wall" ./configure --enable-bitforce
make
Edit: and it also does an auto scan if you don't use "--scan-serial" at all
(i.e. the '--scan-serial auto' isn't needed if you just run a cgminer with bitforce code enabled - it will run an 'auto' anyway)
I admit, this is the shortest and clearest version the instruction can get, so you deserve the bounty ;)

Fully missed that FPGA miners are not enabled with cgminer's default build options. With the current stampede to BFL devices I guess it is time to include FPGA support by default. But since e.g. scanning for an Icarus takes considerably long, it might be a good idea to require  the "--scan-serial auto" parameter explicitly set to initiate discovery. Sadly, I'll have to wait for another 3 weeks for my devices to arrive and to test all of this :(


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: kano on February 26, 2012, 11:45:42 AM
My friend in China that I have been helping a little bit with the Icarus code is posting my two Icarus' to me tomorrow.
So I'll try to sort out the 'auto' for Icarus after I get them
However, I'm not sure there is a tidy and quick way to auto detect an Icarus, among many devices, with it's current firmware.


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: zefir on February 26, 2012, 01:43:28 PM
My friend in China that I have been helping a little bit with the Icarus code is posting my two Icarus' to me tomorrow.
So I'll try to sort out the 'auto' for Icarus after I get them
However, I'm not sure there is a tidy and quick way to auto detect an Icarus, among many devices, with it's current firmware.
Had a look at the Icarus code/protocol and got an idea on what you mean. Basically you could screw an Icarus' state machine by sending a BFL ID request command. If you knew that the BitForces are ignoring the Icarus work commands, you could just scan for Icarus devices first and then look for BitForces.

Anyone started working on X6500 support? Maybe the FPGA miner devs need to agree on a common protocol if they want to get natively supported by cgminer...



Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: jamesg on February 27, 2012, 06:46:22 PM
Had a try at this over the weekend but nothing yet....

Found this post from BFL stating that they find BFL singles with ttyUSB* in the /dev folder in linux.

https://bitcointalk.org/index.php?topic=28402.msg692304#msg692304

I am guessing my problem is that BAMT doesn't have any ttyUSB* files in the /dev folder. Can anyone elaborate how this can be fixed? Looks like I have the following tty files...

tty*
ttyS*


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: zefir on February 27, 2012, 07:35:53 PM
Had a try at this over the weekend but nothing yet....

Found this post from BFL stating that they find BFL singles with ttyUSB* in the /dev folder in linux.

https://bitcointalk.org/index.php?topic=28402.msg692304#msg692304

I am guessing my problem is that BAMT doesn't have any ttyUSB* files in the /dev folder. Can anyone elaborate how this can be fixed? Looks like I have the following tty files...

tty*
ttyS*
gigavps,

I'm not familiar with BAMT, but assuming it is a typical Linux distro try this to narrow down the problem:

1) ensure that you have common module usbserial installed:
Code:
lsmod | grep serial
should display usbserial

2) post output of
Code:
dmesg
shortly after you plugged in the BitForce.
Code:
dmesg | grep tty
should contain 'ttyUSBx'

3) post output of
Code:
lsusb -v

4) ensure that your cgminer supports FPGAs:
Code:
./cgminer -h | grep Built | grep bitforce

If any of those fail, you'll have to try with a standard Ubuntu and cgminer built with BitForce support.


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: jamesg on February 27, 2012, 07:48:01 PM
gigavps,

I'm not familiar with BAMT, but assuming it is a typical Linux distro try this to narrow down the problem:

1) ensure that you have common module usbserial installed:
Code:
lsmod | grep serial
should display usbserial

2) post output of
Code:
dmesg
shortly after you plugged in the BitForce.
Code:
dmesg | grep tty
should contain 'ttyUSBx'

3) post output of
Code:
lsusb -v

4) ensure that your cgminer supports FPGAs:
Code:
./cgminer -h | grep Built | grep bitforce

If any of those fail, you'll have to try with a standard Ubuntu and cgminer built with BitForce support.

Thanks for the help. I have determined that BAMT does not contain the proper serial support needed to create the ttyUSB* files. Moving on to ubuntu this evening....


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: lodcrappo on February 27, 2012, 10:18:39 PM


Thanks for the help. I have determined that BAMT does not contain the proper serial support needed to create the ttyUSB* files. Moving on to ubuntu this evening....

I am interested to know how this was "determined" ?


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: jamesg on February 28, 2012, 01:25:51 AM


Thanks for the help. I have determined that BAMT does not contain the proper serial support needed to create the ttyUSB* files. Moving on to ubuntu this evening....

I am interested to know how this was "determined" ?


By my non existent linux skills..... hence the bounty for some help.


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: gnar1ta$ on February 28, 2012, 03:21:31 PM
Hey gigavps I saw in the cgminer thread you got this mostly working??  Would you mind sharing what was needed for BAMT + cgminer + BFL? (given there was bounty, no would be a perfectly reasonable answer here)


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: jamesg on February 28, 2012, 03:32:08 PM
Hey gigavps I saw in the cgminer thread you got this mostly working??  Would you mind sharing what was needed for BAMT + cgminer + BFL? (given there was bounty, no would be a perfectly reasonable answer here)

Hi gnar1ta$,

The bounty has gone to lodcrappo (the creator of BAMT) as he was able to log into my rig and figure out what was needed to get the debian OS to recognize the single. There kernel mod was there but not enabled and there were a couple other things he did to get it working.

Lodcrappo created fix #7 for BAMT 0.5 to distribute this to the masses.

I now have the single plugged into a BAMT rig and cgminer recognizes it and runs it. Unfortunately, the gpumon and mgpumon tools are based on gpus and not devices and the cgminer api call "devs" does not return the BFL device, so no monitoring.

We are close.... I can smell it.  :)


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: gnar1ta$ on February 28, 2012, 03:47:15 PM
We are close.... I can smell it.  :)

That's good to know.  I spent some time without BAMT on my rigs...never again.


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: jamesg on February 28, 2012, 03:55:45 PM
We are close.... I can smell it.  :)

That's good to know.  I spent some time without BAMT on my rigs...never again.

I know the feeling. Compiling shit and trying to find everything to get ubuntu setup with cgminer is quite a chore. BAMT is my friend.


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: kano on February 28, 2012, 08:09:57 PM
I have not written API support yet - no bounty oh well I'll consider it some time in the future :P

Luke-jr wrote the BFL support but didn't bother adding the API code (even after I pointed that out to him)

(The first post says "LINUX" not BAMT - thus my last post was actually correct :P)

Edit: ...

https://bitcointalk.org/index.php?topic=28402.msg738661#msg738661


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: gnar1ta$ on February 28, 2012, 11:48:42 PM
I have not written API support yet - no bounty oh well I'll consider it some time in the future :P

Well I don't have one yet, but I'll contribute 5 BTC to you to write in the support.


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: jamesg on February 29, 2012, 12:06:35 AM
I have not written API support yet - no bounty oh well I'll consider it some time in the future :P

Well I don't have one yet, but I'll contribute 5 BTC to you to write in the support.

https://bitcointalk.org/index.php?topic=66699.0


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: fred0 on March 08, 2012, 09:48:55 PM
Just got 3 BFL Singles working.

I'm on ubuntu.

--scan-serial auto only detected the first device.

So for the cgminer command line you should expect somthing like this:

Code:
CGMCMD="./cgminer \
    -o $MINERPOOL1:$MINERPORT1 -u $MINERUSER1 -p $MINERPASS1 \
    -o $MINERPOOL2:$MINERPORT2 -u $MINERUSER2 -p $MINERPASS2 \
    -o $MINERPOOL3:$MINERPORT3 -u $MINERUSER3 -p $MINERPASS3 \
    --scan-serial /dev/ttyUSB0 \
    --scan-serial /dev/ttyUSB1 \
    --scan-serial /dev/ttyUSB2 \
    --failover-only \
    --disable-gpu \
    --submit-stale \
    "
echo $CGMCMD
cd $HOME/bfl

exec gnome-terminal --command="$CGMCMD" --title="BFL" --geometry=104x44-0+0 &
Disclaimer:  This may have been fixed recently, but I don't think anyone has been working on this.  Luke-Jr may have, I'll check out the most recent source later. But I KNOW this works.
http://s6.postimage.org/ci8c40rgt/BFLTrio.jpg (http://postimage.org/image/ci8c40rgt/)
Happy hashing.  :)


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: kano on March 08, 2012, 10:58:58 PM
Yep there are issues with --scan-serial
If you have both Icarus and Bitforce enabled and plug in an Icarus, the "auto" will hang.
Luke-jr posted a hack pull (well I consider it a hack) to work around that.
But it needs some work still as I have mentioned in 2 other threads.
Clearly specifying --scan-serial each device is the most reliable method at the moment.


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: wogaut on May 22, 2012, 06:55:17 PM
I have determined that BAMT does not contain the proper serial support needed to create the ttyUSB* files.

Just want to note the solution to that issue here (this has been posted by somebody elsewhere too), since I searched for it a while ago and it's somewhat frustrating to find this thread without the obvious solution for the generic Linux user without automatic ttyUSB mapping:

Depending on yourLinux distro your BFL might not show as a ttyUSB* device.

If you do a
Code:
ls /dev/ttyUSB*
and nothing shows up then
Code:
sudo modprobe ftdi_sio vendor=0x0403 product=0x6014
sudo chmod a+rw /dev/ttyUSB*

This reqires that you have general USB device support installed.

I got the vendor/product pair from dmesg (after plugging in the Single)
Code:
dmesg | grep -i bitforce
to find the USB device number
Code:
dmesg | grep -i vendor
to find the vendor/product codes (use the one with the matching USB device number)

compile cgminer with
Code:
./configure --enable-bitforce

and then
Code:
cgminer -S auto
and all the usual other parameters, should find your BFL Single.


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: smracer on May 22, 2012, 08:07:34 PM
It took me about 4 hours last night to figure this out.

I wish you would have posted this 24 hours ago.   :-\


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: wogaut on May 22, 2012, 08:15:31 PM
It took me about 4 hours last night to figure this out.

I wish you would have posted this 24 hours ago.   :-\


Dang, if I only knew that sooner!
Then I hope it will be helpful to someone else  :D


Title: Re: [BOUNTY 5 BTC] Clear instructions for cgminer's --scan-serial option
Post by: smracer on May 23, 2012, 09:44:10 PM
I am having a new problem.  I just switched to a thin client that only uses 36 watts.  I have 2 other thin clients running with Ubuntu 11.04 on them.  Only on this one cgminer looks different.  It is just one line and everything is flying by and it is hard to see what is going on.

Is this a different view?  Did I set it somehow in the conf file maybe?

How do i get the normal cgminer status window where I can see all my miners in a row?

Thanks

Bo