Skip to content

Commit

Permalink
binary files + updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasmetski committed Jun 11, 2017
1 parent e5d6eeb commit f623aa4
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 9 deletions.
34 changes: 25 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
# RPi miner auto-hard-reset
Simple Go program for auto-hard-reset computer with Raspberry Pi or other mini-computer
Simple Go program for automatically hard reset a computer with Raspberry Pi or other mini-computer from the GPIO pins
#### Still in progress
![console](screenshot.png)

First commit is the prototype. I'm using 5V relay and checking the miners with ping command. If there is no answer - hard-reset with the GPIO.
![console](screenshot.png)

### Requirements
* Raspberry Pi
* Golang >= 1.8.0
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 this is the basics.
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](raspberrypi-5v-relay.jpeg)
Soon binary files.

Use `go get -u -v github.com/kasmetski/auto-hard-reset` instead of `git clone`
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:
Expand All @@ -33,6 +43,12 @@ Example config.json:
```

### 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)
Expand Down
Binary file added bin/auto-hard-reset-arm6
Binary file not shown.
Binary file added bin/auto-hard-reset-arm7
Binary file not shown.
17 changes: 17 additions & 0 deletions bin/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"WaitSeconds": 1800,
"Miners": [
{ "Name": "machine 1", "Pin": "40", "Ip": "192.168.0.100", "Info": "R9 290's" },
{ "Name": "machine 2", "Pin": "38", "Ip": "192.168.0.101", "Info": "RX480's" },
{ "Name": "machine 3", "Pin": "37", "Ip": "192.168.0.102", "Info": "RX480's" },
{ "Name": "machine 4", "Pin": "36", "Ip": "192.168.0.103", "Info": "RX480's" },
{ "Name": "machine 5", "Pin": "35", "Ip": "192.168.0.104", "Info": "RX480's" },
{ "Name": "machine 6", "Pin": "33", "Ip": "192.168.0.105", "Info": "RX480's" },
{ "Name": "machine 7", "Pin": "32", "Ip": "192.168.0.106", "Info": "RX480's" },
{ "Name": "machine 8", "Pin": "31", "Ip": "192.168.0.107", "Info": "RX480's" },
{ "Name": "machine 9", "Pin": "29", "Ip": "192.168.0.108", "Info": "RX480's" },
{ "Name": "machine 10", "Pin": "22", "Ip": "192.168.0.109", "Info": "RX480's" },
{ "Name": "machine 11", "Pin": "18", "Ip": "192.168.0.110", "Info": "RX480's" },
{ "Name": "machine 12", "Pin": "16", "Ip": "192.168.0.111", "Info": "RX480's" }
]
}

0 comments on commit f623aa4

Please sign in to comment.