Bitcoin Forum
April 18, 2024, 01:29:57 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: CGMiner monitoring on your iOS/Android/Windows Phone device  (Read 7995 times)
Axadiw (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
February 27, 2014, 12:37:46 AM
Last edit: February 27, 2014, 08:07:00 AM by Axadiw
 #1

Hi,

I'd like to present CGMinerMobileAdapter simple python script that allows to monitor CGMiner via MobileMiner mobile app (http://www.mobileminerapp.com/). Actually it was BFGMiner script, called BFGMobileAdapter, but I've added some stability fixes, and added remote commands support.

Script was created and tested on BAMT, CGminer and it's forks (vertminer, sgminer).

Features of the app (when using CGMinerMobileAdapter):

- Hashrate & temperatures monitoring
- Remote start / stop / restart of mining process
- email & push notification when rig is offline / overheating
- and more Smiley

Install inscructions:
Fist make sure that you have this line in your cgminer.conf:

Code:
"api-listen" : true

1. Log in via ssh or launch terminal

2. Execute:
Code:
git clone https://github.com/Axadiw/CGMinerMobileAdapter.git
cd CGMinerMobileAdapter
./install.sh

3. Provide email, machine name and application key (get your application key from the mobile app)

Above script installs app in /opt/CGMinerMobileAdapter directory, and add its to /etc/rc.local, so it'll run at system startup.

Allupdates would available on github page:
https://github.com/Axadiw/CGMinerMobileAdapter

If you'd like to donate, please use this account: 159XDGxhDLPrxWbByzM48Y6CKv4YH9jqTT

I hope it'll be useful for somebody Smiley
1713403797
Hero Member
*
Offline Offline

Posts: 1713403797

View Profile Personal Message (Offline)

Ignore
1713403797
Reply with quote  #2

1713403797
Report to moderator
1713403797
Hero Member
*
Offline Offline

Posts: 1713403797

View Profile Personal Message (Offline)

Ignore
1713403797
Reply with quote  #2

1713403797
Report to moderator
1713403797
Hero Member
*
Offline Offline

Posts: 1713403797

View Profile Personal Message (Offline)

Ignore
1713403797
Reply with quote  #2

1713403797
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713403797
Hero Member
*
Offline Offline

Posts: 1713403797

View Profile Personal Message (Offline)

Ignore
1713403797
Reply with quote  #2

1713403797
Report to moderator
1713403797
Hero Member
*
Offline Offline

Posts: 1713403797

View Profile Personal Message (Offline)

Ignore
1713403797
Reply with quote  #2

1713403797
Report to moderator
nwoolls
Hero Member
*****
Offline Offline

Activity: 840
Merit: 1002


View Profile WWW
February 27, 2014, 12:52:33 AM
 #2

Thanks for supporting the MobileMiner API!  Grin

I just wanted to note that you can also monitor and control your miners from the HTML5 app now as well: http://web.mobileminerapp.com

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
ivanlabrie
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1000



View Profile
March 11, 2014, 04:08:58 AM
 #3

One reply!?

This is simply awesome...

It's working like a charm on 2 out of 3 rigs.

Care to see the output I get?

"[2014-03-11 05:00:16]  Getting Data from CGMiner RPC API using port:4028
2014-03-11 05:00:47,005 ERROR timed out
2014-03-11 05:00:47,005 WARNING Generic Exception: Traceback (most recent call last):
  File "/opt/CGMinerMobileAdapter/CGMinerMobileAdapter.py", line 104, in <module>
    for item in data['DEVS']:
TypeError: list indices must be integers, not str

2014-03-11 05:01:17,633 WARNING URLError = The read operation timed out
[2014-03-11 05:01:17]  Sending to MobileMiner API from miner3"

Help appreciated. If I get up and running I'll send some donations to you soon. Cheesy
Thanks!
ivanlabrie
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1000



View Profile
March 13, 2014, 02:50:23 AM
 #4

Found this: https://bitcointalk.org/index.php?topic=513400.new#new

Dev, any comments?
nwoolls
Hero Member
*****
Offline Offline

Activity: 840
Merit: 1002


View Profile WWW
March 13, 2014, 03:13:27 AM
 #5


You can view the contents of the Python script here to check for any other URLs or domains:

https://github.com/Axadiw/CGMinerMobileAdapter/blob/master/CGMinerMobileAdapter.py

As for bandwidth usage I can confirm this and already talked to the author about it. Make sure you are using his latest version from Git. It submits statistics far less frequently.

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
ivanlabrie
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1000



View Profile
March 13, 2014, 04:12:34 AM
 #6


You can view the contents of the Python script here to check for any other URLs or domains:

https://github.com/Axadiw/CGMinerMobileAdapter/blob/master/CGMinerMobileAdapter.py

As for bandwidth usage I can confirm this and already talked to the author about it. Make sure you are using his latest version from Git. It submits statistics far less frequently.

Thanks.
Riley600
Full Member
***
Offline Offline

Activity: 186
Merit: 100


View Profile
May 21, 2014, 03:21:37 PM
 #7

This is awesome but I need to get it to work on my Windows 7 based machine.  I don't have a lot of experience with Python scripts on Windows, so could someone perhaps offer me a little guidance?  It would be much appreciated Cheesy
nwoolls
Hero Member
*****
Offline Offline

Activity: 840
Merit: 1002


View Profile WWW
May 21, 2014, 04:05:58 PM
 #8

This is awesome but I need to get it to work on my Windows 7 based machine.  I don't have a lot of experience with Python scripts on Windows, so could someone perhaps offer me a little guidance?  It would be much appreciated Cheesy

What device(s) are you trying to monitor? You could use MultiMiner which may be easier to setup and also integrates with MobileMiner. It can monitor appliances on your network etc.

http://www.multiminerapp.com/

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
Riley600
Full Member
***
Offline Offline

Activity: 186
Merit: 100


View Profile
May 21, 2014, 05:08:46 PM
 #9

I'm using cgminer, bfgminer and sgminer.  I've found this gives me the best combo of stability and speed. 

Cgminer is running 5 gridseed 5 chip units (Scrypt).
Bfgminer is running 6 antminer u1s (SHA256).
Sgminer is running a 7970 (X11).

I've tried multiminer with bfgminer 3.99 but it gave me inconsistent hashing results with both the gridseeds and antminers. If you have some suggestions for me to improve my results with multiminer, I'd be happy to try them because I like the application Smiley   
nwoolls
Hero Member
*****
Offline Offline

Activity: 840
Merit: 1002


View Profile WWW
May 21, 2014, 06:17:19 PM
 #10

I'm using cgminer, bfgminer and sgminer.  I've found this gives me the best combo of stability and speed.  

Cgminer is running 5 gridseed 5 chip units (Scrypt).
Bfgminer is running 6 antminer u1s (SHA256).
Sgminer is running a 7970 (X11).

I've tried multiminer with bfgminer 3.99 but it gave me inconsistent hashing results with both the gridseeds and antminers. If you have some suggestions for me to improve my results with multiminer, I'd be happy to try them because I like the application Smiley  

You don't necessarily need to mine with MultiMiner, just run it on the same network as your other miners and ensure their RPC API is enabled. MultiMiner will pick them up and report them to MobileMiner.

If you do want to mine with MultiMiner, make sure you are using the latest GridSeed drivers from the BFGMiner repo. They were updated a day or two ago with performance improvements. Not sure what to say about AntMiner performance as MultiMiner uses BFGMiner for all the actual mining - performance should be the same.

Also, if you check http://thread.multiminerapp.com, the latest previews of 3.0 allow you to GPU mine with SGMiner.

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
Riley600
Full Member
***
Offline Offline

Activity: 186
Merit: 100


View Profile
May 21, 2014, 06:35:24 PM
 #11

Awesome! I was giving the multiminer preview a try and using it for the X11 mining too.  I'll try the new drivers or just to use multiminer to pick up my other miners and see how it works.  Thanks for the suggestions Cheesy
Riley600
Full Member
***
Offline Offline

Activity: 186
Merit: 100


View Profile
May 22, 2014, 12:23:42 AM
 #12

I'm trying not to ask for too much handholding but I can't find the new gridseed drivers that you refer to (I've tried looking pretty extensively).  I've also tried running my other miners with the API enabled (on port 4028) but Multiminer doesn't seem to pick them up Sad
nwoolls
Hero Member
*****
Offline Offline

Activity: 840
Merit: 1002


View Profile WWW
May 22, 2014, 12:33:47 AM
 #13

I'm trying not to ask for too much handholding but I can't find the new gridseed drivers that you refer to (I've tried looking pretty extensively).  I've also tried running my other miners with the API enabled (on port 4028) but Multiminer doesn't seem to pick them up Sad

Basically you need to build BFGMiner using the latest source from the official Github repo. You can get a build here, but the site has been down for IPv4 users for several days:

http://luke.dashjr.org/tmp/code/webisect/webisect.php?dobuild=bfgminer

An official build for BFGMiner 4.0 should be out Saturday if you can't get a build sooner.

The API has to be enabled plus the IP for the MultiMiner PC needs to be allowed, e.g.:

Code:
--api-listen --api-allow W:192.168.0.50 --api-port 4028

Where 192.168.0.50 is the IP of the PC that MultiMiner is running on. If MultiMiner still isn't finding it you can use the following utility to troubleshoot:

https://www.dropbox.com/s/4v0ri2ax39stgax/MultiMiner.Xgminer.Api.Client.7z

This is a simple console RPC API client. Run it on the same machine as MultiMiner, passing in the port and IP of the mining machine:

Code:
MultiMiner.Xgminer.Api.Client.exe 4028 192.168.0.100

Where 192.168.0.100 is the miner. After it has launched, try typing "version" or "devs" without the quotes. That should return information from the miner if things are setup properly.

Finally, try restarting MultiMiner. It only scans the network every 10 minutes but if you restart it will scan right away.

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
9600
Full Member
***
Offline Offline

Activity: 207
Merit: 112


View Profile
June 02, 2014, 04:11:19 PM
 #14

Can CGMinerMobileAdapter be installed successfully on an Antminer S1 directly? Would be nice to have the Ant reporting to MM.
nwoolls
Hero Member
*****
Offline Offline

Activity: 840
Merit: 1002


View Profile WWW
June 07, 2014, 01:49:42 AM
 #15

Can CGMinerMobileAdapter be installed successfully on an Antminer S1 directly? Would be nice to have the Ant reporting to MM.

While this may be possible, I just wanted to chime in and say you don't need to run it on the AntMiner S1 directly. You can run one of the Python scripts like CGMinerMobileAdapter or an application like MultiMiner on a separate PC, and then configure it to report the AntMiner S1. You will need to SSH into the AntMiner and adjust its CGMiner settings to allow API access. See this link for more information:

How-To: Use MobileMiner with Network Devices (AntMiner S1, Raspberry Pi, etc)

And this thread for more discussion about MobileMiner:

https://bitcointalk.org/index.php?topic=622655.0

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
mahowi
Full Member
***
Offline Offline

Activity: 142
Merit: 100


View Profile
August 27, 2014, 04:23:52 PM
 #16

I'm trying to run CGMinerMobileAdapter on a Raspberry Pi but it doesn't work.  Sad

I'm getting the following errors:

Code:
[ -=-=-=-=- Starting CGMinerMobileAdapter - CGMiner to MobileMiner Interface -=-=-=-=- ]
[2014-08-27 18:12:41]  Getting Data from CGMiner RPC API using port:4029
2014-08-27 18:12:41,053 WARNING Generic Exception: Traceback (most recent call last):
  File "/opt/CGMinerMobileAdapter/CGMinerMobileAdapter.py", line 148, in <module>
    device[u'CurrentHashrate'] = item[u'MHS 5s'] * 1000
KeyError: u'MHS 5s'

2014-08-27 18:12:41,060 WARNING Generic Exception: Traceback (most recent call last):
  File "/opt/CGMinerMobileAdapter/CGMinerMobileAdapter.py", line 164, in <module>
    response = urllib2.urlopen(req, json.dumps(data2), 30)
NameError: name 'req' is not defined

[2014-08-27 18:12:41]  Sending to MobileMiner API from raspi
2014-08-27 18:12:41,704 WARNING GetCommands Generic Exception: Traceback (most recent call last):
  File "/opt/CGMinerMobileAdapter/CGMinerMobileAdapter.py", line 182, in <module>
    getCommandsResponse = urllib2.urlopen(getCommandsReq, None, 30)
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 407, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 445, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 528, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 400: Bad Request

Python is version 2.7.3.

DRK: Xeojbw5gDNtvCbUK7VXaDqfyNU29ahqavB
BTC: 1K5hJ1wiRJ9mAWwn9pLzjst18jTa1benHT
LTC: LiUgyndo4sibahGEyuw8ymphciaq7tbS9a
nwoolls
Hero Member
*****
Offline Offline

Activity: 840
Merit: 1002


View Profile WWW
August 27, 2014, 06:07:25 PM
 #17

I'm trying to run CGMinerMobileAdapter on a Raspberry Pi but it doesn't work.  Sad

I'm getting the following errors:

Code:
[ -=-=-=-=- Starting CGMinerMobileAdapter - CGMiner to MobileMiner Interface -=-=-=-=- ]
[2014-08-27 18:12:41]  Getting Data from CGMiner RPC API using port:4029
2014-08-27 18:12:41,053 WARNING Generic Exception: Traceback (most recent call last):
  File "/opt/CGMinerMobileAdapter/CGMinerMobileAdapter.py", line 148, in <module>
    device[u'CurrentHashrate'] = item[u'MHS 5s'] * 1000
KeyError: u'MHS 5s'

2014-08-27 18:12:41,060 WARNING Generic Exception: Traceback (most recent call last):
  File "/opt/CGMinerMobileAdapter/CGMinerMobileAdapter.py", line 164, in <module>
    response = urllib2.urlopen(req, json.dumps(data2), 30)
NameError: name 'req' is not defined

[2014-08-27 18:12:41]  Sending to MobileMiner API from raspi
2014-08-27 18:12:41,704 WARNING GetCommands Generic Exception: Traceback (most recent call last):
  File "/opt/CGMinerMobileAdapter/CGMinerMobileAdapter.py", line 182, in <module>
    getCommandsResponse = urllib2.urlopen(getCommandsReq, None, 30)
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 407, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 445, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 528, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 400: Bad Request

Python is version 2.7.3.

Can you try using the following fork instead?

https://github.com/dreadpiratepj/CGMinerMobileAdapter

If problems persist, for the first error try running your miner with:

Code:
--log 5

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
mahowi
Full Member
***
Offline Offline

Activity: 142
Merit: 100


View Profile
August 27, 2014, 06:24:22 PM
 #18

Thanks!  Smiley

This fork works.

Can I monitor multiple miners with one script or do I have to start separate ones for every miner process?

DRK: Xeojbw5gDNtvCbUK7VXaDqfyNU29ahqavB
BTC: 1K5hJ1wiRJ9mAWwn9pLzjst18jTa1benHT
LTC: LiUgyndo4sibahGEyuw8ymphciaq7tbS9a
nwoolls
Hero Member
*****
Offline Offline

Activity: 840
Merit: 1002


View Profile WWW
August 27, 2014, 07:03:31 PM
 #19

Thanks!  Smiley

This fork works.

Can I monitor multiple miners with one script or do I have to start separate ones for every miner process?

With this script I believe you need to have an instance per miner (I'm not sure to be honest - I write the MobileMiner service and API but not this particular script).

The MobileMiner API though allows scripts to submit multiple machines instead of just one, so it is possible. You can try something like MultiMiner on one machine (which will automatically detect and monitor any other miners as long as their RPC API is open) and use MultiMiner to integrate with MobileMiner.

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
rivvs
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
September 23, 2014, 10:41:07 PM
 #20

I need help i want to use this app but i dont understand how to instal it.Can it work with cgminer instaled on windows?
Pages: [1] 2 »  All
  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!