Bitcoin Forum
July 24, 2024, 04:46:18 PM *
News: Help 1Dq create 15th anniversary forum artwork.
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [Solved] Where is the current Hash Rate stored on Antminer S1's? (Linux FS?)  (Read 2258 times)
PaintShopPro6 (OP)
Full Member
***
Offline Offline

Activity: 150
Merit: 100


View Profile
January 29, 2014, 05:44:12 PM
Last edit: January 29, 2014, 06:35:37 PM by PaintShopPro6
 #1

I'd like to create a cron job on my S1's that fire off the current hash rate very so often to a web service which can then determine whether an email or text alert needs to go out.

Does anybody know where, or if, current hash rate data is stored?

The Web GUI is getting it from somewhere! I suppose I could analyze the web GUI code and sort it out, but figured I should ask here first.

Thanks!
mitty
Sr. Member
****
Offline Offline

Activity: 359
Merit: 250



View Profile
January 29, 2014, 06:16:43 PM
 #2

The web UI is getting all the mining stats from the cgminer API, not from anywhere on the filesystem.  It connects to the cgminer API via a TCP socket (I think), requests the info, then displays it on the webpage.
You can use something like ncat to grab the info and write a script to grab the info and then use wget or curl to send it to the web service.

More info on the cgminer API: https://github.com/ckolivas/cgminer/blob/master/API-README

Edit: I'm not sure if the OpenWRT firmware on the AntMiner has netcat and/or ncat, but you can give it a try
PaintShopPro6 (OP)
Full Member
***
Offline Offline

Activity: 150
Merit: 100


View Profile
January 29, 2014, 06:35:17 PM
 #3

Excellent information mitty! I should be able to use that API to access the information. In fact, I bet there are some good code samples laying around the Internet for using that API.

Much appreciated!
darkjed
Member
**
Offline Offline

Activity: 68
Merit: 10


View Profile
January 29, 2014, 07:56:49 PM
 #4

Just thought i might add a bit. This is how i pull hashrate out of my miner. Mind you it's on a stadard ubuntu box...

/opt/bfgminer/api-example.py | awk '/MHS av/ {print "Hashrate.value " substr($3, length($3) -8, 7)}'


I have that line incorporated into a munin plugin, but there's no reason you can't incorporate it into a shell script and cron it...
PaintShopPro6 (OP)
Full Member
***
Offline Offline

Activity: 150
Merit: 100


View Profile
January 29, 2014, 08:03:24 PM
 #5

Great!! Thank you!
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!