Coder Social home page Coder Social logo

jangocheng / auto-hard-reset Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kasmetski/auto-hard-reset

0.0 1.0 0.0 7.41 MB

Auto hard reset mining rigs with Raspberry Pi's GPIO if they got stuck. Written in Go

License: GNU General Public License v3.0

Go 100.00%

auto-hard-reset's Introduction

RPi miner auto-hard-reset

Simple Go program for automatically hard reset a computer with Raspberry Pi or other mini-computer from the GPIO pins

Still in progress

console

I'm using 5V relay and checking the miners with ping command. If there is no answer - hard-reset with the GPIO pins.

Logic

  • Ping miners at most every 30 minutes (the period is configurable).
  • if offline > send signal for 5 sec (turn off pc), pause 5 sec(wait) and send signal again for 0.108 second (turn on pc)

How-to

I'm using Raspberry Pi with 5V relay. Soon I will add detailed instruction but you can find a lot of information how to use 5v relay with Raspberry Pi. This is the basics.

console

Depending of your Raspberry Pi version, download one of the archives arm6 - (Raspberry Pi A, A+, B, B+, Zero) arm7 - (Raspberry Pi 2, 3)

Open the folder from the console and type (example with arm7)

tar -xvzf auto-hard-reset-arm7.tar.gz
chmod +x auto-hard-reset-arm7

and after you configure the config.json

./auto-hard-reset-arm7

Configuration for this program is stored in file config.json . Example config.json:

{
    "WaitSeconds": 1800, //time in seconds 
    "StartupCheck" : true, //check miners on program startup
    "Log" : true, //Output file log
    "RemoteNotify" : false, //Remote notification (Pushoverapp)
    "TgBotActivate" : false, //Telegram bot activation
    "TgAPIKey" : "", //Telegram API key
    "TgAdminUserName" : "USERNAME", //Telegram username of the admin
    "Pushover": false, //Pushover activation
    "PushoverToken": "ACCESS-TOKEN", //Pushover access token
    "PushoverUser": "USER-TOKEN", //Pushover user token
    "Miners": [
        {   "Name": "m0", "Pin": "40", "Ip": "192.168.0.100", "Info": "R9 290's"  },    
        {   "Name": "m1", "Pin": "38", "Ip": "192.168.0.101", "Info": "RX480's"   }      
    ]
}

Build

Requirements
  • Raspberry Pi
  • Golang >= 1.8.0

Type go get -u -v github.com/kasmetski/auto-hard-reset

If you are building on your Raspberry Pi, type go build *.go in the folder. If you are building on your workstation type GOARM=6(or 7) GOARCH=arm GOOS=linux go build *.go

GOARM=6 (Raspberry Pi A, A+, B, B+, Zero) GOARM=7 (Raspberry Pi 2, 3)

ToDo

  • web interface
  • JSON-check
  • instructions
  • statistics

auto-hard-reset's People

Contributors

kasmetski avatar danialmoghaddam avatar spytheman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.