Pages:
Author

Topic: CGMiner monitoring on your iOS/Android/Windows Phone device (Read 8015 times)

newbie
Activity: 6
Merit: 0
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

this is a great chance to know how and its time to check my bit coin....
full member
Activity: 154
Merit: 100
Thx for information. Now i can monitoring my mining bitcoin
full member
Activity: 196
Merit: 100
Big Bit Mine
Ok, this one is doing my head in.  How can I find the API port for the S1.  I'm using S3's as well and they were all 4028.  I've heard of some SSH wizardry to get into the miner but I'm not technical enough.  Does anyone know the easy way to see what port it uses?

They use port 4028 like the S3. You can find steps for configuring the S1 and S3 for monitoring here:

https://github.com/nwoolls/MultiMiner/wiki/Network-Devices#antminer-s1

Thanks for the info. It was like a foreign language to me. Guess I'll leave it.
hero member
Activity: 840
Merit: 1002
Ok, this one is doing my head in.  How can I find the API port for the S1.  I'm using S3's as well and they were all 4028.  I've heard of some SSH wizardry to get into the miner but I'm not technical enough.  Does anyone know the easy way to see what port it uses?

They use port 4028 like the S3. You can find steps for configuring the S1 and S3 for monitoring here:

https://github.com/nwoolls/MultiMiner/wiki/Network-Devices#antminer-s1
full member
Activity: 196
Merit: 100
Big Bit Mine
Ok, this one is doing my head in.  How can I find the API port for the S1.  I'm using S3's as well and they were all 4028.  I've heard of some SSH wizardry to get into the miner but I'm not technical enough.  Does anyone know the easy way to see what port it uses?
newbie
Activity: 28
Merit: 0
When i run the install.sh it say that it have an syntax error.
newbie
Activity: 28
Merit: 0
That is the one that i am using.
I need to run the install.sh scrypt in python?
hero member
Activity: 840
Merit: 1002
I want to use cgminer.
When i run the python script it open a window then it close.
I know nothing about programing so i am a little lost.
can you help me?

What fork are you using? This is the latest / most maintained version of the script:

https://github.com/dreadpiratepj/CGMinerMobileAdapter

You could also try a platform like Minera or MinePeon. Both support CGMiner and both have MobileMiner support.
newbie
Activity: 28
Merit: 0
I want to use cgminer.
When i run the python script it open a window then it close.
I know nothing about programing so i am a little lost.
can you help me?
hero member
Activity: 840
Merit: 1002
I am mining litecoin with a zeusminer thunder x6

Those work fine with MultiMiner. There's help at:

http://help.multiminerapp.com
newbie
Activity: 28
Merit: 0
I am mining litecoin with a zeusminer thunder x6
hero member
Activity: 840
Merit: 1002
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?

Yes - you'll need to install Python for Windows and then run the including Python script.

If you are looking for a GUI solution you may be able to use MultiMiner.

What sort of hardware are you mining with?
newbie
Activity: 28
Merit: 0
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?
hero member
Activity: 840
Merit: 1002
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.
full member
Activity: 142
Merit: 100
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?
hero member
Activity: 840
Merit: 1002
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
    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
    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
    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
full member
Activity: 142
Merit: 100
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
    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
    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
    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.
hero member
Activity: 840
Merit: 1002
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://bitcointalksearch.org/topic/mobileminer-monitor-control-your-farm-from-your-browser-or-phone-wopen-api-622655
full member
Activity: 207
Merit: 112
Can CGMinerMobileAdapter be installed successfully on an Antminer S1 directly? Would be nice to have the Ant reporting to MM.
hero member
Activity: 840
Merit: 1002
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.
Pages:
Jump to: