Bitcoin Forum
May 02, 2024, 05:54:56 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Mining software (miners) / Re: CGMINER ASIC FPGA miner monitoring RPC linux/win/osx/mips/arm/r-pi 3.10.0 on: January 23, 2014, 03:42:26 AM
The php function I'm using is from the MinePeon OS for the Raspberry Pi and I just used it as it worked and I managed to get all other functions to work just this 'zero' that caused the problem.
https://github.com/MineForeman/minepeon-base/blob/master/http/inc/miner.inc.php

AddPool works fine using:
cgminer("addpool",$poolAddress . "," . $poolUser . "," . $poolPass);


EDIT: GOT IT!
cgminer('zero','all,true');
Returns "[Msg] => ZeroedAllstatswithsummary" and has indeed reset the stats to '0'

I was misreading the "|" as if it was asking for "zero,all","true" but instead its the other way around "zero","all,true" Roll Eyes
2  Bitcoin / Mining software (miners) / Re: CGMINER ASIC FPGA miner monitoring RPC linux/win/osx/mips/arm/r-pi 3.10.0 on: January 23, 2014, 03:19:27 AM
=== is the same as == but also compares the type as well value, and must be the same to return 1 otherwise it'll return 0 regardless if the value is the same.


"cgminer(zero)" returns "[Msg] => Missingzeroparameters" Obviously Smiley
"cgminer(zero,all)" returns "[Msg] => Missingparameter:true/false"

But adding the true/false parameter still returns the same Msg..
"cgminer(zero,all,false)" returns "[Msg] => Missingparameter:true/false"

I've gone through pretty much every other API command and they all seem to work but for the life of me this one just won't work Huh
3  Bitcoin / Mining software (miners) / Re: CGMINER ASIC FPGA miner monitoring RPC linux/win/osx/mips/arm/r-pi 3.10.0 on: January 23, 2014, 12:53:19 AM
Hi, I'm having trouble getting one of the API commands to work..
All other commands I've tried and used work perfectly but I cannot get the 'zero' command to work?

Quote
zero|Which,true/false (*)  none          
There is no reply section just the STATUS section
stating that the zero, and optional summary, was done

If Which='all', all normal cgminer and API statistics will be zeroed other than the numbers displayed by the usbstats and stats commands
If Which='bestshare', only the 'Best Share' values
are zeroed for each pool and the global 'Best Share'
The true/false option determines if a full summary is shown on the cgminer display like is normally displayed on exit.

How do I specify what to zero using the 'which' parameter?
I've tried:
cgminer('zero|which=all',false);
cgminer('zero|which="all"',false);
cgminer('zero|all',false);
cgminer('zero',which=all,false);
cgminer('zero',all,false);

and probably all other variants of that.. From what I can make out, all other commands only have one parameter and work fine, like restart or switchpool etc..

Any help would be greatly appreciated!

EDIT: I should mention I'm using MinePeon on the Raspberry Pi and the 'cgminer' function above is this:
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) {
                return false;
        }
        fwrite($client, $jsonCmd);
        $response = stream_get_contents($client);
        fclose($client);
        $response = preg_replace("/[^[:alnum:][:punct:]]/","",$response);
        $response = json_decode($response, true);
        return $response;
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!