Bitcoin Forum
May 11, 2024, 07:59:21 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: CGMiner/BFGMiner API Question about DEV & DEVDETAILS and mapping  (Read 2508 times)
martinm (OP)
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
June 05, 2013, 03:58:45 PM
 #1

Hi,
I'm developing a windows service that controls/monitors the above mentioned mining applications by their API. Currently I facing the problem that I have to map the information that I receive from "dev" command to the information I received from "devdetails". As reponse of "devdetails" I get an unique ID, but how I can identify which device is the related in the "dev" response? I could imagine it would be possible to bypass the problem by first receiving all devices from the "devdetails" command, and then to request the information explicit by "gpu"/"cpu"/"pga" and the ID I received from "devdetails" command. Unfortunately I have no possibilities for testing it as I don't have multiple mining devices. Some advice would be highly appreciated.

Thank you very much in advance!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715457561
Hero Member
*
Offline Offline

Posts: 1715457561

View Profile Personal Message (Offline)

Ignore
1715457561
Reply with quote  #2

1715457561
Report to moderator
1715457561
Hero Member
*
Offline Offline

Posts: 1715457561

View Profile Personal Message (Offline)

Ignore
1715457561
Reply with quote  #2

1715457561
Report to moderator
1715457561
Hero Member
*
Offline Offline

Posts: 1715457561

View Profile Personal Message (Offline)

Ignore
1715457561
Reply with quote  #2

1715457561
Report to moderator
af_newbie
Legendary
*
Offline Offline

Activity: 2688
Merit: 1468



View Profile WWW
June 05, 2013, 06:46:49 PM
 #2

Hi,
I'm developing a windows service that controls/monitors the above mentioned mining applications by their API. Currently I facing the problem that I have to map the information that I receive from "dev" command to the information I received from "devdetails". As reponse of "devdetails" I get an unique ID, but how I can identify which device is the related in the "dev" response? I could imagine it would be possible to bypass the problem by first receiving all devices from the "devdetails" command, and then to request the information explicit by "gpu"/"cpu"/"pga" and the ID I received from "devdetails" command. Unfortunately I have no possibilities for testing it as I don't have multiple mining devices. Some advice would be highly appreciated.

Thank you very much in advance!

I use

sprintf_s(command, sizeof(command), "{ \"command\" : \"pga\" , \"parameter\" : \"%d\" }", pga);
sprintf_s(command, sizeof(command), "{ \"command\" : \"gpu\" , \"parameter\" : \"%d\" }", gpu);

to get device stats

and to get number of devices:

   strcpy_s(command, sizeof(command), "{ \"command\" : \"config\" }");

Not sure if that is what you want.  Take a look at my akbash code if you like.




martinm (OP)
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
June 06, 2013, 11:41:04 AM
 #3

My intention was to find the way to map/link the devices received from "dev" command to the devices received from "devdetails" command. Both commands reply an array of devices that should includes all connected devices to the miner and not just one like the "pga" "gpu" command. However, I now use the way to get all devices from "devdetails" and then request the additional data by the "cpu","gpu","pga" command.
turtle83
Sr. Member
****
Offline Offline

Activity: 322
Merit: 250


Supersonic


View Profile WWW
June 06, 2013, 12:40:25 PM
 #4

My intention was to find the way to map/link the devices received from "dev" command to the devices received from "devdetails" command. Both commands reply an array of devices that should includes all connected devices to the miner and not just one like the "pga" "gpu" command. However, I now use the way to get all devices from "devdetails" and then request the additional data by the "cpu","gpu","pga" command.

both dev and devdetails have the ID paramater.

martinm (OP)
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
June 06, 2013, 01:15:46 PM
 #5

Hi,
I'm developing a windows service that controls/monitors the above mentioned mining applications by their API. Currently I facing the problem that I have to map the information that I receive from "dev" command to the information I received from "devdetails". As reponse of "devdetails" I get an unique ID, but how I can identify which device is the related in the "dev" response? I could imagine it would be possible to bypass the problem by first receiving all devices from the "devdetails" command, and then to request the information explicit by "gpu"/"cpu"/"pga" and the ID I received from "devdetails" command. Unfortunately I have no possibilities for testing it as I don't have multiple mining devices. Some advice would be highly appreciated.

Thank you very much in advance!

In the response for "devdetails" I get the property "ID" for every device. For my GPU its 0. Where do you see the ID in the response for dev command?

Code:
{"command":"dev"}
{"STATUS":[{"STATUS":"S","When":1369551768,"Code":9,"Msg":"1 GPU(s) - 0 ASC(s) -
 0 PGA(s) - ","Description":"cgminer 3.1.1"}],"DEVS":[{"GPU":0,"Enabled":"Y","St
atus":"Alive","Temperature":0.00,"Fan Speed":0,"Fan Percent":0,"GPU Clock":0,"Me
mory Clock":0,"GPU Voltage":0.000,"GPU Activity":0,"Powertune":0,"MHS av":63.17,
"MHS 5s":63.27,"Accepted":122,"Rejected":0,"Hardware Errors":0,"Utility":0.83,"I
ntensity":"D","Last Share Pool":0,"Last Share Time":1369551716,"Total MH":556876
.3003,"Diff1 Work":122,"Difficulty Accepted":122.00000000,"Difficulty Rejected":
0.00000000,"Last Share Difficulty":1.00000000,"Last Valid Work":1369551715}],"id
":1}
af_newbie
Legendary
*
Offline Offline

Activity: 2688
Merit: 1468



View Profile WWW
June 06, 2013, 02:31:19 PM
 #6

My intention was to find the way to map/link the devices received from "dev" command to the devices received from "devdetails" command. Both commands reply an array of devices that should includes all connected devices to the miner and not just one like the "pga" "gpu" command. However, I now use the way to get all devices from "devdetails" and then request the additional data by the "cpu","gpu","pga" command.

Martin,

config command will give you number of devices (N) for each type, then just loop 0 to N and call cpu, gpu or pga command. You don't need device "ID".  They are numbered 0 to N.  You can map them to whatever you like in your program.

turtle83
Sr. Member
****
Offline Offline

Activity: 322
Merit: 250


Supersonic


View Profile WWW
June 06, 2013, 02:39:15 PM
 #7


In the response for "devdetails" I get the property "ID" for every device. For my GPU its 0. Where do you see the ID in the response for dev command?


Maybe they dont have the per item ID if its only one device... or  maybe something for GPU.

For FPGA :-
{"command": "devs"} : http://pastie.org/private/iprck8etln9dhpgh8ibuq
{"command": "devdetails"} : http://pastie.org/private/xxflvwbemisy5hqhjsyvq


martinm (OP)
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
June 06, 2013, 03:55:31 PM
 #8


In the response for "devdetails" I get the property "ID" for every device. For my GPU its 0. Where do you see the ID in the response for dev command?


Maybe they dont have the per item ID if its only one device... or  maybe something for GPU.

For FPGA :-
{"command": "devs"} : http://pastie.org/private/iprck8etln9dhpgh8ibuq
{"command": "devdetails"} : http://pastie.org/private/xxflvwbemisy5hqhjsyvq



Great! Thank you very much Smiley
dbaicz
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
June 15, 2014, 05:34:33 PM
 #9

Hi everybody! I'm working on some web interface for bfgminer using API and I can't to figure how I can get information which pool is actually used for mining. There is not such information in POOLS, SUMMARY, STATS etc. Could anyone advise me?
bhai
Member
**
Offline Offline

Activity: 93
Merit: 10


View Profile
June 24, 2014, 07:32:18 PM
 #10

Im no devver but did you read the API-README:

https://github.com/ckolivas/cgminer/blob/master/API-README

It has all the API calls that are supported and [correct me if Im wrong] bfgminer should have the same API calls.

Also in the cgminer repo there is a few api-example.X to get you going.

rgdz,
bhai
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!