Bitcoin Forum
December 14, 2024, 05:04:27 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Yet Another Mining Monitor  (Read 1463 times)
SkyLakeMine (OP)
Member
**
Offline Offline

Activity: 99
Merit: 11


View Profile WWW
October 28, 2017, 06:14:02 PM
Last edit: October 29, 2017, 06:14:09 PM by SkyLakeMine
Merited by bitcoin revo (1)
 #1

There are many great commercial apps and open source efforts on these forums for monitoring your mining rigs. I am going to present yet another dashboard showing hash rate and temperature for your Antminer (or any miner that supports cgminer api) with mobile support and alerts (email and text).

It's a fun simple project for the DIY crowd that I put together on a slow Friday afternoon using a python script and an existing IOT platform called Cayenne.

First, a live demo. https://cayenne.mydevices.com/shared/59f4906081d3a96b067a9bb5/project/ce744209-17a3-494c-965a-1280d18488b2
Data is updated once a minute.

Source and readme are here: https://github.com/dfoderick/Mining

Important sections of the readme are pasted below.


Use uploadhash.py to upload hash rate and miner temps to mydevices.com Cayenne dashboard.
This will make the miner stats available on mobile device or web interface where you can get alerts when your miner is in trouble.

Requirements
============
 - Any computer that can run Python
 - A miner like the Antminer S9 that supports the cgminer api.

Steps
============
1. Make sure python is set up on your computer. If you have problems then make sure you install dependencies. Do a google search.
 - sudo apt-get install build-essential python-dev python-openssl
 - sudo python setup.py install

2. install mqtt lib. This is a client to communicate with mydevices.com Cayenne back end.
 - sudo pip install paho-mqtt

3. Create your dashboard by signing up at https://mydevices.com/ and following the prompts. If you have any issues with the mydevices.com or Cayenne setup then get help on their community forum. Add a device through their site to generate a user id, password id, and client id that you will use in step 5. This will allow you to authenticate to their back end.

4. Download https://github.com/ckolivas/cgminer/blob/master/api-example.py
Save it in any folder on your rpi and rename it minerapi.py
IMPORTANT! Make one small edit to the file. Comment out the following line by putting a # at the beginning of the line.
#response = json.loads(response)
The reason is that we want the raw json string coming from the miner as output, not the python object.

5. Put the file uploadhash.py in the same directory as minerapi.py and then customize with your settings.
Edit the script uploadhash.py with the following info:
 - ip address of your miner
 - mydevices.com Cayenne user, password, and client id from step 2. IMPORTANT! You get this info from the Cayenne dashboard. These values are different than your login and password on that site.
 - modify the polling interval if you so choose.
 
6. Now run the script, "python uploadhash.py". You can add the script as a cron task by using "crontab -e" and set it up to run @reboot. Google for instructions.
If the script is running correctly then you will see the diagnostics output on the console with your miner stats, hashrate and temp.  
user@raspberrypi:~/mydevices $ python uploadhash.py
13639.64 3 60 55 59
13622.19 3 60 55 60
13634.74 3 61 56 61
...

7. Check your Cayenne dashboard and configure your widgets. Don't forget to set up Cayenne Alerts from your dashboard to get notified when hashrate falls or temps rise.

[EDIT:] Clarified that Raspberry Pi is not required. Will run on any computer.
tfbiii
Jr. Member
*
Offline Offline

Activity: 63
Merit: 1

http://ckpool.org


View Profile WWW
October 28, 2017, 06:20:46 PM
 #2

Looks pretty nice!

-Fred

http://ckpool.org
SkyLakeMine (OP)
Member
**
Offline Offline

Activity: 99
Merit: 11


View Profile WWW
October 29, 2017, 10:42:56 PM
 #3

how does this work and can this work with a phone

It works by uploading Antminer statistics (hash and temperature values) to the cloud and then displays the values in a phone or browser. The cloud platform runs rules on the values so you can get alerted when the values are not within normal operating parameters.
Cosbor
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
May 19, 2018, 08:46:20 PM
 #4

Are your scripts safe from disastrous flaws outlined in this article (about mining rigs anyone can find on Shodan)?

https://medium.com/@s3yfullah/hacking-cryptocurrency-miners-with-osint-techniques-677bbb3e0157
SkyLakeMine (OP)
Member
**
Offline Offline

Activity: 99
Merit: 11


View Profile WWW
May 20, 2018, 12:19:36 AM
 #5

Are your scripts safe from disastrous flaws outlined in this article (about mining rigs anyone can find on Shodan)?

https://medium.com/@s3yfullah/hacking-cryptocurrency-miners-with-osint-techniques-677bbb3e0157

Thank you for the link to the security article.

From the article: "The critical point is that miners need username and password to log in."

I recommend the following:
   - Do not expose your antminer to the internet. Always place it behind a firewall. In this way your miner will not be discovered by Shodan.
   - Always change the default user name and password for your miner (remember to change both web access and ssh access)
   - Monitor your mining payout address so if someone changes your pool and worker address you will notice.

Having said that, the scripts in this thread have been replaced by Full Cycle Mining (I am the author of both). I do not yet recommend any of the programming be exposed to the internet because someone could easily switch pools or reset all your miners. The best rule for security right now is to always access miners using vpn.
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!