Bitcoin Forum
September 17, 2019, 07:56:11 PM *
News: Latest Bitcoin Core release: 0.18.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: AntGuardian - 100% LIBRE Free Software Watchdog for all Bitmain AntMiners  (Read 121 times)
rsolano60
Newbie
*
Offline Offline

Activity: 4
Merit: 11


View Profile
August 21, 2019, 12:54:59 AM
Merited by frodocooper (10), NotFuzzyWarm (1)
 #1

For all of us reluctant to run proprietary software anywhare near our miners, let alone controlling them. Now we have an alternative!

https://github.com/rsolano60/AntGuardian

AntGuardian
AntMiner monitor and auto-restart tool

Compatible with all AntMiners

Scans the local network for miners. Once connected, restarts any miner when accepted shares do not increase in SECONDS_4_CHECKS seconds, given that there is an active internet connection (checks with google.com).

This software and all its dependencies are free and open source. Free as in free speach not as in free beer, meaning it respects your freedom! Please star on GitHub and share with your miner friends!

Prerequisites
NMap
Download and install NMap. Link: https://nmap.org/download.html

Python
Most Mac and Linux distributions come with Python pre-installed. For windows and other systems, you may need to download and install Python first. Link: https://www.python.org/downloads/

Installation
Download the AntGuardian repository and unzip it. Link: https://github.com/rsolano60/AntGuardian

Install Python requirements
Using the command prompt, navigate to directory Downloads/AntGuardian and run the command:

(Mac and Linux) COMMAND:
Code:
pip install -r requirements.txt

(Windows) COMMAND:
Code:
py -m pip install -r requirements.txt

Setup
If you have changed the password of your miners from the default "root", you must change the PASS varieble in the script file AntGuardian.py Otherwise, you are ready to run the script.

Code:
#SETUP:
#---------SETUP-----------------SETUP-----------------SETUP-----------------SETUP-----------------SETUP-------
USER = 'root'
PASS = 'root' # Replace with your miner's password
SECONDS_4_CHECKS = 95 # you need at least 6 seconds per miner, increase this number if monitoring 16 miners or more
SECONDS_TO_INTERNET = 60
REBOOT_TIME = 300
#--------END-SETUP-------------END-SETUP-------------END-SETUP-------------END-SETUP-------------END-SETUP----
Running
Using the command prompt, while in the directory Downloads/AntGuardian, run the program by entering the command:

(Mac & Linux) RUN COMMAND:
Code:
python3 AntGuardian.py

(Windows) RUN COMMAND:
Code:
py AntGuardian.py

Options
You may also change the time intervals (seconds):

SECONDS_4_CHECKS: Time to wait between each check for accepted shares.
REBOOT_TIME: Lead time given to miners to start mining once they are rebooted by AntGuardian.
SECONDS_TO_INTERNET: Lead time given to miners to start mining again when internet connection is lost and recovered.


License
This project is licensed under the GNU GPL V3 License - see the LICENSE file for details

Please Donate to the project!
1 every 5 users have donated an average of $50, but even $1 helps!!! it would not be possible without you!!!

BITCOIN (BTC) address:
Code:
35w2Zmuj9Y83vb8uFvfjxQQfuzVYKwY4Dd

Happy LIBRE mining!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1568750171
Hero Member
*
Offline Offline

Posts: 1568750171

View Profile Personal Message (Offline)

Ignore
1568750171
Reply with quote  #2

1568750171
Report to moderator
NotFuzzyWarm
Legendary
*
Online Online

Activity: 1932
Merit: 1327


Evil beware: We have waffles!


View Profile
August 21, 2019, 01:12:54 PM
 #2

Looks interesting. I'd give it a try but I stopped using Bitmain miners several years ago in favor of far more reliable gear from Canaan.
Can it work with any miner that uses Kano's cgminer API?

For bitcoin to succeed the community must police itself - Joshua Zipkin aka Joshua Alexander leaked AMT A1 miner skype chats
How a miner mfgr SHOULD operate: HaggsFIN trip to Canaan My info useful? Donations welcome! 1Fuzzyk398kDWVjuC5qPX5v6CjSkvbgAbd
-Support Sidehacks miner development. Donations to:   1BURGERAXHH6Yi6LRybRJK7ybEm5m5HwTr
rsolano60
Newbie
*
Offline Offline

Activity: 4
Merit: 11


View Profile
August 21, 2019, 03:02:54 PM
 #3

Looks interesting. I'd give it a try but I stopped using Bitmain miners several years ago in favor of far more reliable gear from Canaan.
Can it work with any miner that uses Kano's cgminer API?

We can make it work with any API pretty easily. I do not have miners to test tho.
Earlier versions of antGuardian use BMMiner API through SSH but since ssh was closed we started just using the web interface.

I would give it a try for CGMiner API but I currently do not have any miner to test...
Im looking forward to anyone joining development. You can even create a pull request on github and start de conversation going.
Anyway thanks for your reply!!
Please STAR on GitHub and Share!! Lets promote freedom respecting software!
NotFuzzyWarm
Legendary
*
Online Online

Activity: 1932
Merit: 1327


Evil beware: We have waffles!


View Profile
August 21, 2019, 03:22:05 PM
Last edit: August 23, 2019, 01:02:33 PM by NotFuzzyWarm
 #4

Bitmains API - and for that matter just about every other mfgr of miners API - are all based on or actually using the CGminer API written by Kano back when he and -ck were still working together. While BM may have added a few new commands specific to their miners (I doubt it) if this works on one make of miner then in theory it should work on all of them.

For bitcoin to succeed the community must police itself - Joshua Zipkin aka Joshua Alexander leaked AMT A1 miner skype chats
How a miner mfgr SHOULD operate: HaggsFIN trip to Canaan My info useful? Donations welcome! 1Fuzzyk398kDWVjuC5qPX5v6CjSkvbgAbd
-Support Sidehacks miner development. Donations to:   1BURGERAXHH6Yi6LRybRJK7ybEm5m5HwTr
rsolano60
Newbie
*
Offline Offline

Activity: 4
Merit: 11


View Profile
August 21, 2019, 06:19:51 PM
Last edit: August 21, 2019, 11:15:48 PM by frodocooper
 #5

OK, maybe you can try version 0.1.1 then,, it is a fairly simple script. The only difference with the current version is you have to enter the list of IPs for your miners (not very convenient when using DHCP).

https://github.com/rsolano60/AntGuardian/blob/master/Old%20Versions/AntGuardian0.1.1.py

Hope this works for you.
kano
Legendary
*
Offline Offline

Activity: 2912
Merit: 1193


Linux since 1997 RedHat 4


View Profile
August 23, 2019, 11:27:58 AM
Merited by frodocooper (2)
 #6

If you read the API-README and can access the full config file of the miner, you can turn on mcast so the API of every miner, with mcast enabled, will respond to a single mcast message on the network ...

The miner.php can also use that so that the php finds all your miners, with mcast enabled, without you having to tell it their IPs

https://github.com/kanoi/cgminer/blob/master/API-README

Pool: https://kano.is Here on Bitcointalk: Forum BTC: 1KanoPb8cKYqNrswjaA8cRDk4FAS9eDMLU
Discord support invite at https://kano.is/ Majority developer of the ckpool code
Help keep Bitcoin secure by mining on pools with full block verification on all blocks - and NO empty blocks!
rsolano60
Newbie
*
Offline Offline

Activity: 4
Merit: 11


View Profile
August 24, 2019, 12:31:23 AM
Last edit: August 24, 2019, 03:33:51 AM by frodocooper
 #7

If you read the API-README and can access the full config file of the miner, you can turn on mcast so the API of every miner, with mcast enabled, will respond to a single mcast message on the network ...

The miner.php can also use that so that the php finds all your miners, with mcast enabled, without you having to tell it their IPs

https://github.com/kanoi/cgminer/blob/master/API-README

COOL !!!
Should have read this before I developed my script!
However I think this can´t restart the system OS like the HTTP GUI approach can, can it?
IDK if that is usefull at all
Thank You!!!
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!