Bitcoin Forum
December 09, 2016, 05:59:02 AM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: « 1 ... 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 [566] 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 ... 830 »
  Print  
Author Topic: OFFICIAL CGMINER mining software thread for linux/win/osx/mips/arm/r-pi 4.9.2  (Read 4824264 times)
This is a self-moderated topic. If you do not want to be moderated by the person who started this topic, create a new topic.
bitpop
Legendary
*
Offline Offline

Activity: 1932


https://keybase.io/bitpop


View Profile WWW
June 30, 2013, 02:34:12 PM
 #11301

Just wanted to say, 331 doesn't display all devices especially when detected right after startup.

Reputation  |  PGP  |  DigitalOcean  |  OpenVPN 2GB Free  |  TorGuard  |  Ethereum Classic
Bitcoin: 3DSh6AnmvBpDJFUz2mnLirMLmTMcFs9nDm
Bitmessage: BM-2cXN9j8NFT2n1FxDVQ6HQq4D4MZuuaBFyb
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
tew
Newbie
*
Offline Offline

Activity: 3


View Profile
June 30, 2013, 08:50:42 PM
 #11302

I am interested in trying my hand at creating yet another FPGA cluster hasher, with each cluster connected via a single USB connection to the host (rather than 1 per FPGA).

I've looked at the Cairnsmore 1, Ztex, and Icarus drivers; each one has hard-coded some of the idiosyncrasies of those particular devices.  I'm wondering if there is something like a generic CGminer driver skeleton I could fill in / develop against.

Is there a simple block of code that easily links with CGminer, passes up the relevant info from the device chain (estimated duration of one hash-cycle iteration, number of hashes completed per cycle) to the main miner program on initialization, downloads base header data and range to be hashed against from the miner to the device with each getwork or stratum fetch, receives proof of work from the device to send to the mining pool, and sends an interrupt to the device when assigned work becomes invalid?

Given the proliferation of mining devices, there's almost a need for a "miner driver" specification just like the old "packet driver" specification back in the days of Win32s enabling Win3.11 to connect to the internet, so that the people creating the new mining devices would be responsible for driver creation, rather than the mining stack software creators.

Thanks,
 -Tom
-ck
Moderator
Legendary
*
Offline Offline

Activity: 2002


Ruu \o/


View Profile WWW
June 30, 2013, 10:05:09 PM
 #11303

Just wanted to say, 331 doesn't display all devices especially when detected right after startup.
That's because on windows, the window resize often crashed on some of the windows OSs (?xp) and it was easier to just disable the window resize that shows new devices since we have so far been unable to fix that issue without just telling people to move to linux >_>

Primary developer/maintainer for cgminer and ckpool/ckproxy.
Pooled mine at kano.is, solo mine at solo.ckpool.org
-ck
carlosmi
Jr. Member
*
Offline Offline

Activity: 31


View Profile
July 01, 2013, 09:12:22 AM
 #11304

I am interested in trying my hand at creating yet another FPGA cluster hasher, with each cluster connected via a single USB connection to the host (rather than 1 per FPGA).

I've looked at the Cairnsmore 1, Ztex, and Icarus drivers; each one has hard-coded some of the idiosyncrasies of those particular devices.  I'm wondering if there is something like a generic CGminer driver skeleton I could fill in / develop against.

Is there a simple block of code that easily links with CGminer, passes up the relevant info from the device chain (estimated duration of one hash-cycle iteration, number of hashes completed per cycle) to the main miner program on initialization, downloads base header data and range to be hashed against from the miner to the device with each getwork or stratum fetch, receives proof of work from the device to send to the mining pool, and sends an interrupt to the device when assigned work becomes invalid?

Given the proliferation of mining devices, there's almost a need for a "miner driver" specification just like the old "packet driver" specification back in the days of Win32s enabling Win3.11 to connect to the internet, so that the people creating the new mining devices would be responsible for driver creation, rather than the mining stack software creators.

Thanks,
 -Tom

+1 Trying to do the same with an Arduino Leonardo acting as controller of several devices.
-ck
Moderator
Legendary
*
Offline Offline

Activity: 2002


Ruu \o/


View Profile WWW
July 01, 2013, 12:27:44 PM
 #11305

I am interested in trying my hand at creating yet another FPGA cluster hasher, with each cluster connected via a single USB connection to the host (rather than 1 per FPGA).

I've looked at the Cairnsmore 1, Ztex, and Icarus drivers; each one has hard-coded some of the idiosyncrasies of those particular devices.  I'm wondering if there is something like a generic CGminer driver skeleton I could fill in / develop against.

Is there a simple block of code that easily links with CGminer, passes up the relevant info from the device chain (estimated duration of one hash-cycle iteration, number of hashes completed per cycle) to the main miner program on initialization, downloads base header data and range to be hashed against from the miner to the device with each getwork or stratum fetch, receives proof of work from the device to send to the mining pool, and sends an interrupt to the device when assigned work becomes invalid?

Given the proliferation of mining devices, there's almost a need for a "miner driver" specification just like the old "packet driver" specification back in the days of Win32s enabling Win3.11 to connect to the internet, so that the people creating the new mining devices would be responsible for driver creation, rather than the mining stack software creators.

Thanks,
 -Tom

+1 Trying to do the same with an Arduino Leonardo acting as controller of several devices.
Unfortunately we're not a committee nor a huge team with emphasis on infrastructure and frameworks. Kano and I do this in our spare time and the model keeps changing dynamically as we progress and each new device comes along with its own new set of issues. We work on what gets things done and we have hardware to play with or care about or get sponsored to work on. This is nothing more than a hobby/pastime/passion gone mad for us.

That and I'm leaving to go overseas shortly for 6 weeks...

Primary developer/maintainer for cgminer and ckpool/ckproxy.
Pooled mine at kano.is, solo mine at solo.ckpool.org
-ck
crazyates
Legendary
*
Offline Offline

Activity: 938



View Profile
July 01, 2013, 02:30:18 PM
 #11306

That and I'm leaving to go overseas shortly for 6 weeks...
Ooh business or pleasure?  Grin Grin

Tips? 1crazy8pMqgwJ7tX7ZPZmyPwFbc6xZKM9
Previous Trade History - Sale Thread
kano
Legendary
*
Offline Offline

Activity: 1932


Linux since 1997 RedHat 4


View Profile
July 01, 2013, 03:00:44 PM
 #11307

I am interested in trying my hand at creating yet another FPGA cluster hasher, with each cluster connected via a single USB connection to the host (rather than 1 per FPGA).

I've looked at the Cairnsmore 1, Ztex, and Icarus drivers; each one has hard-coded some of the idiosyncrasies of those particular devices.  I'm wondering if there is something like a generic CGminer driver skeleton I could fill in / develop against.

Is there a simple block of code that easily links with CGminer, passes up the relevant info from the device chain (estimated duration of one hash-cycle iteration, number of hashes completed per cycle) to the main miner program on initialization, downloads base header data and range to be hashed against from the miner to the device with each getwork or stratum fetch, receives proof of work from the device to send to the mining pool, and sends an interrupt to the device when assigned work becomes invalid?

Given the proliferation of mining devices, there's almost a need for a "miner driver" specification just like the old "packet driver" specification back in the days of Win32s enabling Win3.11 to connect to the internet, so that the people creating the new mining devices would be responsible for driver creation, rather than the mining stack software creators.

Thanks,
 -Tom
Pointless.
As soon as someone comes out with the next design of hardware, suddenly the whole thing would be thrown out the window and have to start again.

At the moment we advance the drivers as we see they need them and incorporate changes and improvements where we see needed.
If something is going to 'break' the 'interface', we simply change the 'interface'.
If an improvement is found inside that interface we can simply change that.

It's the same everywhere in cgminer.
When a new pool protocol comes up, we then add support if we consider it viable or it is sponsored well enough and popular enough.
If the protocol used for the old GetWork (and the same for the crappy GBT) was defined as 'The must use Interface' some of the gains of Stratum would not exist.
Stratum is a completely different connection to Getwork

In fact it has quite clearly already happened with ASIC.
Earlier last year I had reservations about using serial-USB and the restrictions and loss of information from the underlying USB.
So at the end of last year I wrote a new interface using USB direct (libusb) and we've both improved on that since then.

It wasn't even a year ago I was having arguments with people about USB even being able to support ASIC speed devices.
Although there is still room to grow, it hasn't been a simple case of knowing there's a mile of headroom so it doesn't matter, it has indeed been a case of tuning the way everything works to make the ASIC miners work at maximum speed.

Locking things down to old ideas, or adding extra layers in the mining process to simplify it, is exactly what are are not trying to do.
Performance is what matters, but of course that's not absolute, it's simply getting the device to perform optimally (and not being restricted by some interface that someone decided is how it should be)

Things change in bitcoin pretty quickly actually ...

Pool: https://kano.is BTC: 1KanoiBupPiZfkwqB7rfLXAzPnoTshAVmb
CKPool and CGMiner developer, IRC FreeNode #ckpool and #cgminer kanoi
Help keep Bitcoin secure by mining on pools with Stratum, the best protocol to mine Bitcoins with ASIC hardware
Paladin69
Hero Member
*****
Offline Offline

Activity: 770


View Profile
July 01, 2013, 05:36:16 PM
 #11308

Yay zadig utility fucked up my ability to connect to my FPGA BFL MiniRig.  Sad

Is there a tutorial out there somewhere?  Maybe this can't be done on an older XP laptop?  Was working before just fine prior to this winusb garbage.  It appeared to install correctly but no com ports are recognized now.
Easy to undo.
Go under system, device manager, USB serial bus controllers. The device will be there. Tell Windows to upgrade the driver. It will install the old serial one. Open Zadig, show all devices, and administrator. use WinUSB and the version of Zadig in the FPGA-README to try again. It will work.

I went to Linux and found far less errors. Raspberry Pi's are cheap, capable and low power. Personally it was the best <$60 I spent case included. Good luck!

Sorry for the late reply.  Just wanted to say thank you regarding undoing the zadig.  I'm back up and running with the machine in question again.  I didn't try reinstalling zadig because the XP version doesn't seem to have the libusb 1.0 version that is recommended in the readme.  I am using bfgminer for now since zadig isn't required, even for ASIC's according to pirate1.

Will cgminer come out with a version so zadig isn't required in the future?  I don't like changing it out so COM ports don't exist anymore.  I can't run EasyMiner admin tools without com ports if I ever need to identify which FPGA is giving me problems.

I don't understand how bfgminer got this working without zadig but cgminer needs it?
crazyates
Legendary
*
Offline Offline

Activity: 938



View Profile
July 01, 2013, 05:52:22 PM
 #11309

I don't understand how bfgminer got this working without zadig but cgminer needs it?
BFG and CGMiner both used to use the FTDI drivers for USB devices. CGMiner switched to libusb, but requires you to reinstall new drivers. Once you do it one, it should be all set.

Tips? 1crazy8pMqgwJ7tX7ZPZmyPwFbc6xZKM9
Previous Trade History - Sale Thread
os2sam
Legendary
*
Offline Offline

Activity: 1918


Think for yourself


View Profile
July 01, 2013, 07:08:26 PM
 #11310

 I didn't try reinstalling zadig because the XP version doesn't seem to have the libusb 1.0 version that is recommended in the readme.

Worked fine on my XP SP3

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Paladin69
Hero Member
*****
Offline Offline

Activity: 770


View Profile
July 01, 2013, 09:20:24 PM
 #11311

I don't understand how bfgminer got this working without zadig but cgminer needs it?
BFG and CGMiner both used to use the FTDI drivers for USB devices. CGMiner switched to libusb, but requires you to reinstall new drivers. Once you do it one, it should be all set.

I understand that part, but why make people do the extra step?  bfgminer doesn't need it when ASIC's are run there.
Krak
Hero Member
*****
Offline Offline

Activity: 591



View Profile WWW
July 01, 2013, 09:40:22 PM
 #11312

I don't understand how bfgminer got this working without zadig but cgminer needs it?
BFG and CGMiner both used to use the FTDI drivers for USB devices. CGMiner switched to libusb, but requires you to reinstall new drivers. Once you do it one, it should be all set.

I understand that part, but why make people do the extra step?  bfgminer doesn't need it when ASIC's are run there.
Because direct USB is better, plain and simple.

(inb4 Luke-jr's trolling)

BTC: 1KrakenLFEFg33A4f6xpwgv3UUoxrLPuGn
Paladin69
Hero Member
*****
Offline Offline

Activity: 770


View Profile
July 01, 2013, 11:05:01 PM
 #11313

I don't understand how bfgminer got this working without zadig but cgminer needs it?
BFG and CGMiner both used to use the FTDI drivers for USB devices. CGMiner switched to libusb, but requires you to reinstall new drivers. Once you do it one, it should be all set.

I understand that part, but why make people do the extra step?  bfgminer doesn't need it when ASIC's are run there.
Because direct USB is better, plain and simple.

(inb4 Luke-jr's trolling)

Define better.  Hashes more?
kano
Legendary
*
Offline Offline

Activity: 1932


Linux since 1997 RedHat 4


View Profile
July 01, 2013, 11:17:26 PM
 #11314

Yay zadig utility fucked up my ability to connect to my FPGA BFL MiniRig.  Sad

Is there a tutorial out there somewhere?  Maybe this can't be done on an older XP laptop?  Was working before just fine prior to this winusb garbage.  It appeared to install correctly but no com ports are recognized now.
Easy to undo.
Go under system, device manager, USB serial bus controllers. The device will be there. Tell Windows to upgrade the driver. It will install the old serial one. Open Zadig, show all devices, and administrator. use WinUSB and the version of Zadig in the FPGA-README to try again. It will work.

I went to Linux and found far less errors. Raspberry Pi's are cheap, capable and low power. Personally it was the best <$60 I spent case included. Good luck!

Sorry for the late reply.  Just wanted to say thank you regarding undoing the zadig.  I'm back up and running with the machine in question again.  I didn't try reinstalling zadig because the XP version doesn't seem to have the libusb 1.0 version that is recommended in the readme.
...
The binary release has the dll's you need (including libusb) ... so you messed up Tongue

... as I said last time ...
https://bitcointalk.org/index.php?topic=28402.msg2591941#msg2591941

Pool: https://kano.is BTC: 1KanoiBupPiZfkwqB7rfLXAzPnoTshAVmb
CKPool and CGMiner developer, IRC FreeNode #ckpool and #cgminer kanoi
Help keep Bitcoin secure by mining on pools with Stratum, the best protocol to mine Bitcoins with ASIC hardware
MinorMiner
Member
**
Offline Offline

Activity: 75


View Profile
July 01, 2013, 11:49:47 PM
 #11315

FEATURE REQUEST

Be able to run a script if a USB unit has issues. Could pass USB ID as an argument to this script, then the script could take action to power cycle the device in question.

I have found web controlled power switches that would allow a computer to power cycle peripherals from a script. It would be really helpful if cgminer detects a problem with a device (or devices) to be able to run a script to be able to power cycle them.

At the simplest level, a script to power cycle the whole lot would be a good start. Being able to pass the USB ID of the device in question would allow just that device to be power cycled, for example.

I'm thinking about this under Linux, which is where I run my miners. So simply being able to run a shell script with parameters is what I'm after. Not sure how it would be handled under Windows ... .vbs? .wsh?

Maybe the script could email the admin too? Either way, if there is a 'trouble script' handle, it would be AWESOME Smiley

All contributions gratefully received 1G6Wia22Jnpz2DUisA5EoAC6KJ7MHm6QyP
twmz
Hero Member
*****
Offline Offline

Activity: 737



View Profile
July 02, 2013, 12:01:09 AM
 #11316

FEATURE REQUEST

Be able to run a script if a USB unit has issues. Could pass USB ID as an argument to this script, then the script could take action to power cycle the device in question.

I have found web controlled power switches that would allow a computer to power cycle peripherals from a script. It would be really helpful if cgminer detects a problem with a device (or devices) to be able to run a script to be able to power cycle them.

At the simplest level, a script to power cycle the whole lot would be a good start. Being able to pass the USB ID of the device in question would allow just that device to be power cycled, for example.

I'm thinking about this under Linux, which is where I run my miners. So simply being able to run a shell script with parameters is what I'm after. Not sure how it would be handled under Windows ... .vbs? .wsh?

Maybe the script could email the admin too? Either way, if there is a 'trouble script' handle, it would be AWESOME Smiley


Prior to this enhancement being added (if it does get added), you could accomplish something similar by writing a script that polls the API every 30 seconds (or whatever) looking for unhealthy devices.  I have something similar that looks for a variety of issues on my devices (status other than "Alive", abnormally high HW errors or rejected shares, abnormally low hashrate, abnormal temp, etc.  It doesn't power cycle them (interesting idea), but rather just sends me an alert to do manual investigation and intervention.

Was I helpful?  1TwmzX1wBxNF2qtAJRhdKmi2WyLZ5VHRs
WoT, GPG

Bitrated user: ewal.
MineForeman.com
Legendary
*
Offline Offline

Activity: 896



View Profile WWW
July 02, 2013, 12:13:58 AM
 #11317

FEATURE REQUEST

I may be overstepping my boundaries (sorry ckolivas & kano) but what you're asking is not really within the scope of what cgminer does.

On top of that, one of the things that cgminer actually does do (the api) is already in place to allow you to do what you're asking, you just need to implement it Tongue .

Just to point you in the right direction though, have a look at API-README and miner.php.  You will find everything you need in there.

Neil

Bitcoin News http://mineforeman.com/ || MinePeon - Bitcoin mining on the Raspberry PI http://mineforeman.com/minepeon/ || MinePeon Wiki http://minepeon.com/ || MinePeon Forums http://minepeon.com/forums/
MinorMiner
Member
**
Offline Offline

Activity: 75


View Profile
July 02, 2013, 12:28:45 AM
 #11318

Ah, that's awesome. Thank you so much for pointing me at it. I've compiled cgminer and used it for a while but was not aware of the API stuff. Certainly wasn't aware of the php stuff included in the source these days.

So yes, I think you're right. I have the tools available and will get on with a monitoring thing.

Thanks Smiley

All contributions gratefully received 1G6Wia22Jnpz2DUisA5EoAC6KJ7MHm6QyP
kano
Legendary
*
Offline Offline

Activity: 1932


Linux since 1997 RedHat 4


View Profile
July 02, 2013, 12:34:34 AM
 #11319

I have a bunch of scripts I run that do certain tests.

This (old) one checks if an ICA hasn't returned a share in too long.
On the old serial-USB the ICA would just stop returning results for no reason on rare occasions.
A cgminer restart (basically resetting the serial-USB connection completely) would clear the problem.
So it sends a quit to cgminer if it detects that situation.

Obviously it doesn't contain everything required, but consider it a starting point if you want to do something.
i.e. do it yourself Tongue
Consider this a pointer to do something you want that's not really that difficult to do and the interface is already in cgminer.
i.e. no cgminer changes required.

... tools.php has e.g. all the socket/api code like in miner.php and sets $rigs and also has the msg()/txtmsg()/doabort()/dowarn() functions ... among other things
In my case the msg function runs a little java program I wrote to popup a windows on my screen with the message ...

Code:
<?php
session_start
();
#
include_once('tools.php');
#
global $icas;
#
$icas = array(); // Rigs with ICA's
#
function process()
{
 global 
$miner$port;
 global 
$haderror$error$rigs;
 global 
$icas$dis;

 if (
$rigs == null or count($rigs) == 0)
doabort("No rigs defined");

 foreach (
$rigs as $rig)
 {
$now time();
if (isset($dis[$rig]))
{
if (($now $dis[$rig]) > 90)
{
unset($dis[$rig]);
txtmsg("Reenabling $rig");
}
else
continue;
}

$parts explode(':'$rig3);
if (count($parts) < 2)
doabort("Invalid rig '$rig'");
else
{
$miner $parts[0];
$port $parts[1];

$process0 getapi($rig'summary');
if ($process0 === false)
continue;

if (!isset($process0['SUMMARY']['Elapsed']))
{
handle($rig"Error on '$rig'\n(Missing SUMMARY/Elapsed)");
continue;
}

$el $process0['SUMMARY']['Elapsed'];

$process getapi($rig'devs');
if ($process === false)
continue;

$now time();
$when $process['STATUS']['When'];

if (isset($process['STATUS']['Description']))
$des $process['STATUS']['Description'];
else
$des $rig;

$gotone false;
foreach ($process as $dev => $details)
{
if (isset($details['Name']) && $details['Name'] == 'ICA')
{
$gotone true;

// force a message from each rig with an ICA
if (!isset($icas[$rig]))
{
$icas[$rig] = 'on';
msg("Monitoring: ICAs on $des");
}

if (isset($details['Last Valid Work']))
{
// Give it 60s
if ($el 60 && $el 5184000// 60days
{
$lst $details['Last Valid Work'];

if (($when $lst) > 180)
{
msg("$dev=ICA".$details['ID']." on $des (Elapsed=$el when-lst=".($when-$lst).")\nSending API quit (then sleeping for 900s)");

$process api('quit');

sleep(900);
}
}
}
}
}

if (!$gotone)
{
$dis[$rig] = time() + (60*60*24*365.25*10);

dowarn("$des has no ICAs\nRestart monitoring disabled");

if (count($dis) == count($rigs))
doabort("No rigs to monitor");
}
}
 }
}
#
while (true)
{
 
process();
 
sleep(5);
}
#
?>


Edit: oh yeah, I run cgminer in a loop so it always restarts after a quit (after a 5s sleep).

Pool: https://kano.is BTC: 1KanoiBupPiZfkwqB7rfLXAzPnoTshAVmb
CKPool and CGMiner developer, IRC FreeNode #ckpool and #cgminer kanoi
Help keep Bitcoin secure by mining on pools with Stratum, the best protocol to mine Bitcoins with ASIC hardware
MineForeman.com
Legendary
*
Offline Offline

Activity: 896



View Profile WWW
July 02, 2013, 01:11:19 AM
 #11320

As a slightly alternitive way to how kano does it you can use this PHP function from MinePeon;-

Code:
function cgminer($command, $parameter) {

$command = array (
"command"  => $command,
"parameter" => $parameter
);

$jsonCmd = json_encode($command);

$host = "127.0.0.1";
$port = 4028;

$client = stream_socket_client("tcp://$host:$port", $errno, $errorMessage);

if ($client === false) {
throw new UnexpectedValueException("Failed to connect: $errorMessage");
}
fwrite($client, $jsonCmd);
$responce = stream_get_contents($client);
fclose($client);
$responce = preg_replace("/[^[:alnum:][:punct:]]/","",$responce);
$responce = json_decode($responce, true);
return $responce;

}

Using that and the API-README you can get cgminer to do anything you want, for example;-

cgminer("restart", "");

Will restart your miner and;-

$stats = cgminer("devs", "");

Will return a nicely formatted array with all of your mining devices stats.


Neil

(P.S. look at https://github.com/MineForeman/MinePeonWebUI if you want more examples)

Bitcoin News http://mineforeman.com/ || MinePeon - Bitcoin mining on the Raspberry PI http://mineforeman.com/minepeon/ || MinePeon Wiki http://minepeon.com/ || MinePeon Forums http://minepeon.com/forums/
Pages: « 1 ... 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 [566] 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 ... 830 »
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!