Bitcoin Forum

Bitcoin => Mining software (miners) => Topic started by: Axadiw on February 27, 2014, 12:37:46 AM



Title: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: Axadiw on February 27, 2014, 12:37:46 AM
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 :)

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 (https://github.com/Axadiw/CGMinerMobileAdapter)

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

I hope it'll be useful for somebody :)


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: nwoolls on February 27, 2014, 12:52:33 AM
Thanks for supporting the MobileMiner API!  ;D

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


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: ivanlabrie on March 11, 2014, 04:08:58 AM
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. :D
Thanks!


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: ivanlabrie on March 13, 2014, 02:50:23 AM
Found this: https://bitcointalk.org/index.php?topic=513400.new#new

Dev, any comments?


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: nwoolls on March 13, 2014, 03:13:27 AM
Found this: https://bitcointalk.org/index.php?topic=513400.new#new

Dev, any comments?

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.


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: ivanlabrie on March 13, 2014, 04:12:34 AM
Found this: https://bitcointalk.org/index.php?topic=513400.new#new

Dev, any comments?

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.


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: Riley600 on May 21, 2014, 03:21:37 PM
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 :D


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: nwoolls on May 21, 2014, 04:05:58 PM
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 :D

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/


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: Riley600 on May 21, 2014, 05:08:46 PM
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 :)   


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: nwoolls on May 21, 2014, 06:17:19 PM
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 :)  

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.


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: Riley600 on May 21, 2014, 06:35:24 PM
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 :D


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: Riley600 on May 22, 2014, 12:23:42 AM
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 :(


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: nwoolls on May 22, 2014, 12:33:47 AM
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 :(

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.


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: 9600 on June 02, 2014, 04:11:19 PM
Can CGMinerMobileAdapter be installed successfully on an Antminer S1 directly? Would be nice to have the Ant reporting to MM.


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: nwoolls on June 07, 2014, 01:49:42 AM
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 (https://github.com/Axadiw/CGMinerMobileAdapter) or an application like MultiMiner (http://www.multiminerapp.com/) 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) (http://talk.multiminerapp.com/t/how-to-use-mobileminer-with-network-devices-antminer-s1-raspberry-pi-etc/149)

And this thread for more discussion about MobileMiner:

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


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: mahowi on August 27, 2014, 04:23:52 PM
I'm trying to run CGMinerMobileAdapter on a Raspberry Pi but it doesn't work.  :(

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.


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: nwoolls on August 27, 2014, 06:07:25 PM
I'm trying to run CGMinerMobileAdapter on a Raspberry Pi but it doesn't work.  :(

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


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: mahowi on August 27, 2014, 06:24:22 PM
Thanks!  :)

This fork works.

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


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: nwoolls on August 27, 2014, 07:03:31 PM
Thanks!  :)

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 (http://www.mobileminerapp.com/#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 (https://github.com/nwoolls/MultiMiner/wiki/Network-Devices) detect and monitor any other miners as long as their RPC API is open) and use MultiMiner to integrate (https://github.com/nwoolls/MultiMiner/wiki/Remote-Management#mobileminer) with MobileMiner.


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: rivvs on September 23, 2014, 10:41:07 PM
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?


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: nwoolls on September 23, 2014, 10:58:40 PM
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 (http://multiminerapp.com).

What sort of hardware are you mining with?


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: rivvs on September 24, 2014, 08:11:53 PM
I am mining litecoin with a zeusminer thunder x6


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: nwoolls on September 24, 2014, 08:14:29 PM
I am mining litecoin with a zeusminer thunder x6

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

http://help.multiminerapp.com


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: rivvs on September 25, 2014, 09:56:33 PM
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?


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: nwoolls on September 25, 2014, 10:03:43 PM
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.


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: rivvs on September 26, 2014, 04:36:59 PM
That is the one that i am using.
I need to run the install.sh scrypt in python?


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: rivvs on September 26, 2014, 09:44:07 PM
When i run the install.sh it say that it have an syntax error.


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: bigbitmine on October 01, 2014, 12:50:46 PM
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?


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: nwoolls on October 01, 2014, 01:09:35 PM
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


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: bigbitmine on October 02, 2014, 02:35:41 AM
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.


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: hobala on October 18, 2014, 09:53:00 AM
Thx for information. Now i can monitoring my mining bitcoin


Title: Re: CGMiner monitoring on your iOS/Android/Windows Phone device
Post by: FrancisEDumas on November 08, 2014, 01:46:43 PM
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 :)

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 (https://github.com/Axadiw/CGMinerMobileAdapter)

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

I hope it'll be useful for somebody :)

this is a great chance to know how and its time to check my bit coin....