Kasmetski (OP)
Jr. Member
Offline
Activity: 50
Merit: 3
Searchin` perfection!
|
|
May 25, 2017, 09:38:01 PM Last edit: November 09, 2017, 05:26:59 PM by Kasmetski Merited by vapourminer (1), Toughit (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
Activity: 84
Merit: 10
|
|
May 25, 2017, 11:15:41 PM |
|
|
|
|
|
Toxicable
Newbie
Offline
Activity: 53
Merit: 0
|
|
May 26, 2017, 01:11:16 AM |
|
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
Activity: 1848
Merit: 1166
My AR-15 ID's itself as a toaster. Want breakfast?
|
|
May 26, 2017, 02:19:43 AM |
|
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!
|
|
|
|
Kasmetski (OP)
Jr. Member
Offline
Activity: 50
Merit: 3
Searchin` perfection!
|
|
May 26, 2017, 08:44:58 AM Last edit: May 26, 2017, 09:30:09 AM by Kasmetski |
|
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
|
|
May 26, 2017, 10:26:21 AM |
|
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
|
|
|
|
Oakey22
|
|
May 26, 2017, 11:29:01 AM |
|
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
Activity: 44
Merit: 1
|
|
May 26, 2017, 01:14:29 PM |
|
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
Activity: 50
Merit: 3
Searchin` perfection!
|
|
May 26, 2017, 01:24:05 PM |
|
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 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
|
Makefinity - Unleash Your Creativity
|
|
|
Nokia555
|
|
May 27, 2017, 05:16:04 PM Last edit: May 27, 2017, 05:26:29 PM by Nokia555 |
|
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
Activity: 51
Merit: 0
|
|
May 28, 2017, 04:26:14 AM |
|
arduino support please
|
|
|
|
JaredKaragen
Legendary
Offline
Activity: 1848
Merit: 1166
My AR-15 ID's itself as a toaster. Want breakfast?
|
|
May 28, 2017, 05:19:26 AM |
|
arduino support please 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.
|
|
|
|
Kasmetski (OP)
Jr. Member
Offline
Activity: 50
Merit: 3
Searchin` perfection!
|
|
June 12, 2017, 03:12:53 PM |
|
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/releasesMby i but together some cloud monitoring/handling for this kind of software?
I didn't understand the question, could you clarify? arduino support please 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
Activity: 9
Merit: 0
|
|
June 22, 2017, 12:32:05 AM |
|
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
Activity: 50
Merit: 3
Searchin` perfection!
|
|
June 22, 2017, 07:06:53 AM |
|
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
Activity: 9
Merit: 0
|
|
June 25, 2017, 10:25:27 PM |
|
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. 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.
|
|
|
|
|
joaocha
|
|
July 05, 2017, 07:38:08 PM |
|
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
Activity: 5
Merit: 0
|
|
July 19, 2017, 06:25:00 PM |
|
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
|
|
July 19, 2017, 07:34:51 PM |
|
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.
|
|
|
|
|