Author

Topic: CGMiner/BFGMiner API Question about DEV & DEVDETAILS and mapping (Read 2531 times)

member
Activity: 93
Merit: 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
newbie
Activity: 16
Merit: 0
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?
newbie
Activity: 42
Merit: 0

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
sr. member
Activity: 322
Merit: 250
Supersonic

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

legendary
Activity: 2702
Merit: 1468
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.
newbie
Activity: 42
Merit: 0
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}
sr. member
Activity: 322
Merit: 250
Supersonic
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.
newbie
Activity: 42
Merit: 0
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.
legendary
Activity: 2702
Merit: 1468
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.



newbie
Activity: 42
Merit: 0
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!
Jump to: