Bitcoin Forum
May 05, 2024, 06:26:30 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: VB .Net pull hashrate from CGMiner  (Read 1724 times)
hey101 (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
January 18, 2014, 07:17:23 PM
 #1

I am trying to either use VB .Net to connect via a socket to CGMiner and pull just the hashrate in kh/s. I have only one GPU attached that I need it from. I would want to get it quite frequently if possible but I have no idea how to. The rest of my program is made (vb app to pull information about balances and such and sends it to arduino to be displayed on a 3.2in tft lcd). This is just the one part I am missing. The one thing I have noticed is that the hashrate displayed in CGminer is in kh and updated extremely often with good accuracy, but the api only shows in mh and practically never changes or atleast I never have seen it change.


Is there any info that you guys can give to have the api display in kh or somehow hook into cgminers window and retrieve the hashrate with good accuracy? I also have no idea how to parse the information retrieved from the summary command in vb .net, so any kind of information or help with that would be appreciated.


Thank you very much for your time
1714933590
Hero Member
*
Offline Offline

Posts: 1714933590

View Profile Personal Message (Offline)

Ignore
1714933590
Reply with quote  #2

1714933590
Report to moderator
The grue lurks in the darkest places of the earth. Its favorite diet is adventurers, but its insatiable appetite is tempered by its fear of light. No grue has ever been seen by the light of day, and few have survived its fearsome jaws to tell the tale.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
nwoolls
Hero Member
*****
Offline Offline

Activity: 840
Merit: 1002


View Profile WWW
January 18, 2014, 07:21:31 PM
 #2

You can use this .NET assembly to interact with the RPC API in both bfgminer and cgminer:

https://github.com/nwoolls/MultiMiner/tree/master/MultiMiner.Xgminer.Api

There's some example code here:

https://github.com/nwoolls/MultiMiner/blob/master/MultiMiner.Api.Example/Program.cs

It's Open Source, has a lot of use and testing, and pull requests are welcome.

MultiMiner: Any Miner, Any Where, on Any Device |  Xgminer: Mine with popular miners on Mac OS X
btc: 1BmXY4ZZQh1iHSVre658gM1gPAEtDnq8rv  |  ltc: LP1SsHZTDexndkvRKsqAkXNsienPHwaMb5  |  hardware: nwoolls at gmail dot com
hey101 (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
January 18, 2014, 08:01:34 PM
 #3

It looks like everything in it has to do with bfgminer. Do I just change anything that says bgminer to cgminer? Or is there something else that I need to change?
nwoolls
Hero Member
*****
Offline Offline

Activity: 840
Merit: 1002


View Profile WWW
January 18, 2014, 08:34:51 PM
 #4

It looks like everything in it has to do with bfgminer. Do I just change anything that says bgminer to cgminer? Or is there something else that I need to change?

The Xgminer API Assembly has nothing specific to bfgminer in it. The example code does use bfgminer though.

MultiMiner: Any Miner, Any Where, on Any Device |  Xgminer: Mine with popular miners on Mac OS X
btc: 1BmXY4ZZQh1iHSVre658gM1gPAEtDnq8rv  |  ltc: LP1SsHZTDexndkvRKsqAkXNsienPHwaMb5  |  hardware: nwoolls at gmail dot com
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!