Bitcoin Forum
May 29, 2024, 06:59:45 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 3 4 5 6 »  All
  Print  
Author Topic: [DIY] auto-hard-reset mining rigs with Raspberry Pi  (Read 8486 times)
Kasmetski (OP)
Jr. Member
*
Offline Offline

Activity: 50
Merit: 3

Searchin` perfection!


View Profile
May 25, 2017, 09:38:01 PM
Last edit: November 09, 2017, 05:26:59 PM by Kasmetski
Merited by vapourminer (1), Toughit (1)
 #1

Hello.

I want to share with you a simple program to automatically hard-reset your machines if they got stuck.



I'm using Raspberry Pi with 5V relay but you can use any other mini-computer as well (Beaglebone Black, Orange Pi & etc.). I will add better instructions with pictures soon.



Logic is: Ping machines every 33 minutes. If there is no response - Hard-reset.

Just download the binary file and edit the config.json

Soon I will add web interface for statistics

Additional information and basic instructions are available on github
Link: https://github.com/Kasmetski/auto-hard-reset

Makefinity - Unleash Your Creativity
chiwalfrm
Member
**
Offline Offline

Activity: 84
Merit: 10


View Profile
May 25, 2017, 11:15:41 PM
 #2

your link didn't work, but this one does: https://github.com/Kasmetski/auto-hard-reset

Toxicable
Newbie
*
Offline Offline

Activity: 53
Merit: 0


View Profile
May 26, 2017, 01:11:16 AM
 #3

Hello.

I want to share with you a simple program to automatically hard-reset your machines if they got stuck.

I'm using Raspberry Pi with 5V relay but you can use any other mini-computer as well (Beaglebone Black, Orange Pi & etc.). I will add better instructions with pictures soon.

Logic is: Ping machines every 33 minutes. If there is no response - Hard-reset.

There is no config file and you should edit the "main.go" file with the info about your machines (name, ip, GPIO pin, info).
Soon I will add web interface for statistics and easier configuration of the machines and binary files.

Additional information and basic instructions are available on github
Link: https://github.com/Kasmetski/auto-hard-resetHello.


Thanks! I'm actually building a very similar thing as an add on for my rig manager so I can do it all from one place, got some good ideas by seeing how you've implemented it.
JaredKaragen
Legendary
*
Offline Offline

Activity: 1848
Merit: 1165


My AR-15 ID's itself as a toaster. Want breakfast?


View Profile WWW
May 26, 2017, 02:19:43 AM
 #4

Thanks for sharing!

Ill probably borrow a few code snippets to save me the stress when I start my Pi project.... if that's fine by you.  99% of what I do stays open source FYI.

I originally planned on making a generator monitoring system for my remote mining operations.  When power goes out, it will turn on a generator, swap over the power to the miners and boot everything back up;  then once power is found on the mains again, it will kill the generator and switch over...


The secondary function was going to be a "rig resetter" of sorts...

but Mine can't be dependent on an internet connection for auto-rebooting rigs, because there are unique conditions that add hiccups in my ability to remotely send reboot commands.

My secondary project was a open-source rig monitor/reset-er.  The functionality should be very easy, and all I would need to do is make the webpage on the PI to interface with the system scripts I have in mind.


Good work!

Link to my batch and script resources here.  

DO NOT TRUST YOBIT  -JK

Donations: 1Q8HjG8wMa3hgmDFbFHC9cADPLpm1xKHQM
Kasmetski (OP)
Jr. Member
*
Offline Offline

Activity: 50
Merit: 3

Searchin` perfection!


View Profile
May 26, 2017, 08:44:58 AM
Last edit: May 26, 2017, 09:30:09 AM by Kasmetski
 #5

your link didn't work, but this one does: https://github.com/Kasmetski/auto-hard-reset
I fixed it. Thank you.

.....

There is no problem to reuse the code.

I'm building mining farm monitoring too and this is just the first part.
Next month when I have little more time, I will do the monitoring of the environment (temp, humidity, smoke detector & etc.). If temp is hotter , turn on the vents and so on. Also I will build a basic webpage for configuration and statistics.

Of course I think to add another functionality to check miners from the miners statistics.
FIrst check ping, second check the hashrate of the machines. If the miner is stuck, hard-reset again.,

but Mine can't be dependent on an internet connection for auto-rebooting rigs, because there are unique conditions that add hiccups in my ability to remotely send reboot commands.

I don't understand why the internet connection is problem. My code is pinging the machines in the local network, so even without working internet it will show that machines are working, because they are on the local network.

Makefinity - Unleash Your Creativity
felixbrucker
Hero Member
*****
Offline Offline

Activity: 700
Merit: 500


View Profile WWW
May 26, 2017, 10:26:21 AM
 #6

Next month when I have little more time, I will do the monitoring of the environment (temp, humidity, smoke detector & etc.). If temp is hotter , turn on the vents and so on. Also I will build a basic webpage for configuration and statistics.

you might want to check out openhab for such things, or just implement them yourself Tongue
Oakey22
Sr. Member
****
Offline Offline

Activity: 488
Merit: 322


View Profile
May 26, 2017, 11:29:01 AM
 #7

i have made an auto resetter out of an esp8266, has a wifi chip and only needs 3 wires coming from the motherboard, one to 5v,gnd and the power switch. It checks to see if there is a ping to the mining rig, if not then sends a signal to the power pin. Cost is around £3 ($5)
bouc
Jr. Member
*
Offline Offline

Activity: 44
Merit: 1


View Profile
May 26, 2017, 01:14:29 PM
 #8

i have made an auto resetter out of an esp8266, has a wifi chip and only needs 3 wires coming from the motherboard, one to 5v,gnd and the power switch. It checks to see if there is a ping to the mining rig, if not then sends a signal to the power pin. Cost is around £3 ($5)

hi
could you share your work please? (schematic and code)

thanks!
Kasmetski (OP)
Jr. Member
*
Offline Offline

Activity: 50
Merit: 3

Searchin` perfection!


View Profile
May 26, 2017, 01:24:05 PM
 #9

i have made an auto resetter out of an esp8266, has a wifi chip and only needs 3 wires coming from the motherboard, one to 5v,gnd and the power switch. It checks to see if there is a ping to the mining rig, if not then sends a signal to the power pin. Cost is around £3 ($5)
If you have 1 machine is a good option, like arduino. But for 20 machines you will need to buy a lot of them. I have worked with esp8266 but it's just a micro controller. I will use them (arduinos & esp8266) for some of the devices (vents & etc) but I prefer to use the RPi like the computer-brain which controls all devices and micro-controllers.

....
you might want to check out openhab for such things, or just implement them yourself Tongue

Thank you. I'm familiar with OpenHAB, Home-automation.io & etc but probably I will do it by myself. I recently started learning a new language - Go, so it's a good project for practice Smiley

Makefinity - Unleash Your Creativity
Nokia555
Sr. Member
****
Offline Offline

Activity: 392
Merit: 266

EthMonitoring.com


View Profile WWW
May 27, 2017, 05:16:04 PM
Last edit: May 27, 2017, 05:26:29 PM by Nokia555
 #10

RPI will do good with it yes, i have been coding for home automation stuff for years. It's pretty easy to make a cloud based solution for relay checks and management/monitoring from phone/web.

Mby i but together some cloud monitoring/handling for this kind of software?

yoonline
Newbie
*
Offline Offline

Activity: 51
Merit: 0


View Profile
May 28, 2017, 04:26:14 AM
 #11

arduino support please Smiley
JaredKaragen
Legendary
*
Offline Offline

Activity: 1848
Merit: 1165


My AR-15 ID's itself as a toaster. Want breakfast?


View Profile WWW
May 28, 2017, 05:19:26 AM
 #12

arduino support please Smiley

I'll have to buy an Ethernet shield and try and port the code at some point....  idk if the OP will....  the network libraries will be the hard part to transpose possibly.

Link to my batch and script resources here.  

DO NOT TRUST YOBIT  -JK

Donations: 1Q8HjG8wMa3hgmDFbFHC9cADPLpm1xKHQM
Kasmetski (OP)
Jr. Member
*
Offline Offline

Activity: 50
Merit: 3

Searchin` perfection!


View Profile
June 12, 2017, 03:12:53 PM
 #13

Uploaded binary files for Raspberry Pi and easy configuration from json file.

You can download them from here - https://github.com/Kasmetski/auto-hard-reset/releases

Mby i but together some cloud monitoring/handling for this kind of software?

I didn't understand the question, could you clarify?

arduino support please Smiley

I don't plan to build arduino version, only to use them as extension of the RPi.
I can code a simple script to reset computers, but I don't have Ethernet shield to test it

Makefinity - Unleash Your Creativity
gsarducci
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
June 22, 2017, 12:32:05 AM
 #14

Kasmetski thanks for this!  I think it is ALMOST exactly what I am looking for. The only thing I would like is to hook it through the reset button vs the power button, which means instead of a "press-hold, reset, press" I just simply need the "press" part of the reset sequence. I'm no programmer at all, but looking at the code you have am i right that I could simply remove the "ForceShutDown" portion and leave the "TurnOn" portion and it will just run that part? Or is it more complicated then that?

Is there a way to embed this logic into a PHP form so that in addition to this I can also log in and see the status in real time and manually reset or shut down the servers via the webpage?

P.
Kasmetski (OP)
Jr. Member
*
Offline Offline

Activity: 50
Merit: 3

Searchin` perfection!


View Profile
June 22, 2017, 07:06:53 AM
 #15

Thank you for the comment.

Machines are not here with me so I can't test the logic you want. Please test it by yourself and I will tell you how to mod the code (take a screwdriver and see how many seconds you need to hold for reset). If you want just to "click" the button for 0.1 sec... the code will be just turn-off and tun-on with 0.1 sec delay between the two.

About the webserver soon I will have more free time and will make a web page with statistics, easy config and manual control.

Makefinity - Unleash Your Creativity
gsarducci
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
June 25, 2017, 10:25:27 PM
 #16

Outstanding. Like I mentioned, I'm no programmer, but your code is certainly well labeled and logical so I feel I can make some sense out of it.. Last time I really did any programming Applesoft was all the rage! Yeah, I'm old... Don't judge. Cheesy

Reset requires just a quick short of the reset pins on the motherboard, no longer than 1 second, but 500ms should prove more then adequate. Really just long enough to close and open the relay.
Kasmetski (OP)
Jr. Member
*
Offline Offline

Activity: 50
Merit: 3

Searchin` perfection!


View Profile
July 05, 2017, 05:17:19 PM
 #17

To turn on the machine after that hard reset, the program makes quick short for about 0.108 sec.
You can edit the code very easy. Open machines.go and edit line 26
https://github.com/Kasmetski/auto-hard-reset/blob/master/machines.go#L26

from
Code:
	r[i].Restarter()
to this
Code:
	r[i].TurnOn()

This should work Smiley

Makefinity - Unleash Your Creativity
joaocha
Full Member
***
Offline Offline

Activity: 254
Merit: 100


View Profile
July 05, 2017, 07:38:08 PM
 #18

I've made a remote power rig manager, so i can send commands to my pi, that send command to my relay and the magic happens
I can press the power button for soft On/Off, i can pres the reset so the machine shut off and turn on again, or i can press Hard button, for a hard reset if the machine is stuck( it ill hold power for 6 seconds, wait 10 seconds, and them start the machine again

the design is pretty bad , but it works


denellum
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
July 19, 2017, 06:25:00 PM
 #19

This is awesome, going to set this up tonight. I do have one question : what of the 3 pins goes into positive and negative of the relay goes into the motherboard?
NameTaken
Hero Member
*****
Offline Offline

Activity: 630
Merit: 502


View Profile
July 19, 2017, 07:34:51 PM
 #20

I've had computers before that would crash but still respond to ICMP requests. All the popular miners have an API so using an HTTP GET should be more reliable.
Pages: [1] 2 3 4 5 6 »  All
  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!