Bitcoin Forum

Alternate cryptocurrencies => Mining (Altcoins) => Topic started by: Kasmetski on May 25, 2017, 09:38:01 PM



Title: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Kasmetski on May 25, 2017, 09:38:01 PM
Hello.

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

https://raw.githubusercontent.com/Kasmetski/auto-hard-reset/master/docs/screenshot.png

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.

https://raw.githubusercontent.com/Kasmetski/auto-hard-reset/master/docs/raspberrypi-5v-relay.jpeg

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


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: chiwalfrm on May 25, 2017, 11:15:41 PM
your link didn't work, but this one does: https://github.com/Kasmetski/auto-hard-reset


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Toxicable on 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.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: JaredKaragen on 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!


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Kasmetski on May 26, 2017, 08:44:58 AM
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.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: felixbrucker on 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 :P


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Oakey22 on 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)


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: bouc on 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!


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Kasmetski on 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 :P

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 :)


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Nokia555 on May 27, 2017, 05:16:04 PM
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?


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: yoonline on May 28, 2017, 04:26:14 AM
arduino support please :)


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: JaredKaragen on 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.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Kasmetski on 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/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 :)

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


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: gsarducci on 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.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Kasmetski on 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.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: gsarducci on 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. :D

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.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Kasmetski on July 05, 2017, 05:17:19 PM
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 :)


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: joaocha on 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


https://i.imgur.com/NXb9hx6.png


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: denellum on 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?


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: NameTaken on 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.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: nikola_p on July 19, 2017, 08:53:55 PM
Hello everyone!

This is a good topic. I was thinking building the same device with Raspberry Pi. So far no enough time but I found easy solution with some TP-Link Smart Plug with energy usage monitoring. I have two rigs which are stable and this works. For many rigs this solution is good.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Kasmetski on July 29, 2017, 03:15:13 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?
The relays aren't here so I can not take a picture but you should connect the cables in NO and COM. If they are front of you this are the left and center one.
https://images-na.ssl-images-amazon.com/images/I/51ptdqJGyEL._AC_UL160_SR160,160_.jpg

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.
Yep, this is in the ToDo list.
Next week I will have a free day and will do the web server first and after that statistics and json-check.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: car1999 on July 29, 2017, 03:50:23 PM
nice job, but Raspberry Pi is too expensive, an usb watchdog can do the same work, Only 7$ or less.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: MnngSprvsr on July 30, 2017, 02:01:33 AM
USB Watchdog?
With Linux support?
Can you post a link, please?


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: car1999 on July 30, 2017, 02:23:33 AM
USB Watchdog?
With Linux support?
Can you post a link, please?
it doesn't support linux right now, but i talked to the seller,  we can control it via serial port, not very hard to implement.
IMO, linux is stabler than Windows, it doesn't need A  hardware watchdog, software watchdog works well.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Kasmetski on July 31, 2017, 03:59:59 PM
nice job, but Raspberry Pi is too expensive, an usb watchdog can do the same work, Only 7$ or less.
Is this USB watchdog for 1 PC?
I use my Raspberry Pi for many machines and you can easily extend  the number of GPIO pins to control even more. Also the RPI can control simple boards like ESP8266, which costs only $2, not $7.

Also I'm using the RPi like a main station. Connected with a simple usb cam to watch what is happening there. Also when I make the new ventilation it will be controlled from the RPI :)
Now I'm making an rearagment of the farm, but after everything is done. I have a ton of sensors to connect.. for temperature, moisture, water level if something unexpected happenes. And many more of course :)


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Mahuro on July 31, 2017, 05:50:20 PM
Thanks Kasmetski  :)


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: alred911 on August 01, 2017, 09:50:32 PM
hello,

I am currently testing your code with a rpi B+ and 5V relay.
 i am off the network  (no internet/local network)  all thinking the relays will clics since the ping will fail, but no, its says host online.
What did i do wrong ?

thanks.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Kasmetski on August 02, 2017, 02:26:16 PM
Hello,

Type in RPi terminal "ping SOME_LOCAL_IP" and paste the output here.

Thanks


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: car1999 on September 10, 2017, 01:10:25 PM
I reconsider this idea and found that it is perfect. I've bought a Raspberry Pi and a 8 way relay board to run it.

I'd like to run a web server in the Raspberry Pi, the rigs report their status (including gpu, cpu ,memory, disk usage, miner hashrates, temp, fan speed etc) to the Raspberry Pi at regular intervals. If a rig doesn't report status in minutes, Raspberry Pi knows the rig was dead, restart it.
We can add some web pages to show rig status and add some button to restart the bigs by hand.

I've never learned the go language, if it was nodejs, I can contribute codes ::).


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: goen on October 02, 2017, 03:00:58 AM
this is awesome.
thanks Kasmetski.
i'll get the material ready tomorow for testing.

btw, there are 12v and 5v version of relay board.
which one should i use?


rgds,



Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: car1999 on October 02, 2017, 06:17:29 AM
this is awesome.
thanks Kasmetski.
i'll get the material ready tomorow for testing.

btw, there are 12v and 5v version of relay board.
which one should i use?


rgds,


use 5v, this is my build:
https://imgur.com/a/VkduO


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: puwaha on October 08, 2017, 07:05:18 AM
hello,

I am currently testing your code with a rpi B+ and 5V relay.
 i am off the network  (no internet/local network)  all thinking the relays will clics since the ping will fail, but no, its says host online.
What did i do wrong ?

thanks.

I have a similar problem.  I have everything setup, and to run a test, I pulled the ethernet cable from one of my rigs a minute or so before the timer was finished.  It said that the host was online, but that's impossible.  If I ping the rig with the ethernet cable pulled from the raspberry pi there's nothing after the ping statement ... no replies (obviously) and no unreachable statements.  I hit CTRL+C to break out of the ping command, plug the cable back in... ping again... and I get replies.

It's odd.  I haven't examined the code yet, but how is the go program determining if a rig is alive?  What output is it looking for?  Seems to me that it should consider anything but replies as an offline condition.

EDIT:

I looked at the code that parses the ping results, and I replicated the issue by pinging a VM (easier to test with as you can yank the virtual network cable).   When I ping the VM with the virtual network cable disconnected using the parameters in the machines.go code I don't get any replies.

Code:
pi@raspberrypi:~ $ ping 192.168.2.207 -c 3 -i 3 -w 10
PING 192.168.2.207 (192.168.2.207) 56(84) bytes of data.

--- 192.168.2.207 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 9149ms


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: puwaha on October 08, 2017, 08:15:52 AM
I think I found out what the issue is with the ping not working correctly.  With the linux version of the ping command it doesn't display any "Request timed out" messages (the microsoft version does).  It will only display the "Host Unreachable" messages when the ARP cache is flushed.  But the garbage collector will not flush the ARP cache until some large thresholds are reached (minimum of 128 entries)  So unless you have 128 rigs, you aren't going to hit that minimum.

If I manually flush, then linux does then return the "Host Unreachable" message with a ping after I pull the network cable.  But the problem will still remain.  When the rig reboots, it will reply to pings and populate the ARP cache again... then it will not return a "Host Unreachable" message until you flush manually again or do a manual flush.  You could code in a manual flush in each cycle of the main routine... but I beleive a manual ARP table flush requires SUDO ability.  :(

Or... you could change the phrase the code is looking for to something like "0 received" or "100% packet loss" instead?

So I'm curious as to what testing or actual valid rig resets you are seeing?


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Kasmetski on October 09, 2017, 02:02:54 PM
Hello everyone.

I've started using ping at first, just because it was the simplest and fastest solution, until I do the JSON validation. You're right, the program thinks computers are offline only when it reads "Host Unreachable" and I will fix it to work better.

I've decided to not make a webserver, because to use it I still need to log in VNC server (If I'm not connected to the local network). That's way I've made the remote control from Telegram. Now I can control and inspect my machines very easy. I will upload the updates until end of the week after I made the telegram bot more convenient  to use.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: puwaha on October 10, 2017, 05:02:30 AM
I changed it to "100?% packet loss" and the power off time to 6 seconds... recompiled it and it seems like it worked.
 


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: car1999 on October 10, 2017, 06:16:54 AM
Hello everyone.

I've started using ping at first, just because it was the simplest and fastest solution, until I do the JSON validation. You're right, the program thinks computers are offline only when it reads "Host Unreachable" and I will fix it to work better.

I've decided to not make a webserver, because to use it I still need to log in VNC server (If I'm not connected to the local network). That's way I've made the remote control from Telegram. Now I can control and inspect my machines very easy. I will upload the updates until end of the week after I made the telegram bot more convenient  to use.
I've rewrited the codes using node js, looking forward your update :D
telegram is blocked in my country, I use a cloud server, RPi reports farm status to the server, server sends email to me if there are Some rigs were resetted.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Kasmetski on October 10, 2017, 09:42:52 AM
.....



Emails was my first idea but It's easier for remote control with Telegram.
I really don't have enough time to do everything I want, but the project is open for commits. :)

https://pbs.twimg.com/media/DLxCbLdX0AA_3df.jpg

But for now I can make only simple commands and manual control. These days I will implement it to give more info when something happens in the farm.



Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: stef_stef on November 05, 2017, 08:45:34 PM
Okay, so I am officially stuck with the installation.


I have installed golang on my PI2, and executed this command

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

However, I do not know how to go on. Any help would be appreciated.


Thanks


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: FFI2013 on November 06, 2017, 01:12:34 AM
Glad I found this I have a extra pi kicking around just a quick question I need the 5v 8 channel board and on the motherboard the pins get connected to the reset or power thanks


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: stef_stef on November 06, 2017, 11:22:20 AM
Glad I found this I have a extra pi kicking around just a quick question I need the 5v 8 channel board and on the motherboard the pins get connected to the reset or power thanks

You connect them to the reset pins :) The logic is that when the relay closes, it connects those two pins, and the rig restarts


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Kasmetski on November 09, 2017, 04:56:35 PM
Okay, so I am officially stuck with the installation.
I have installed golang on my PI2, and executed this command
go get -u -v github.com/kasmetski/auto-hard-reset
However, I do not know how to go on. Any help would be appreciated.
Thanks

You need to install golang and use "go get" only i if you want to edit the source code or build it by yourself.
If you just want to run the program, use the latest binary files from '/bin/' directoryor better use the binary
files of v0.1 - https://github.com/Kasmetski/auto-hard-reset/releases
Download the version for your RPI open folder in the terminal and start the tool with "./auto-hard-reset-arm6(7)"

After I fix some bugs with the TelegramBot, the version of the tool will be updated.


Glad I found this I have a extra pi kicking around just a quick question I need the 5v 8 channel board and on the motherboard the pins get connected to the reset or power thanks

Connect them like a power button.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: dsclemente on November 27, 2017, 05:34:32 PM
Hi !

Might you kindly provide more information about the telegram interface ?

I can help to improve some features in the project such as web interface and dashboards...

Thank you!


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: jp26jp on December 06, 2017, 06:29:17 PM
Sorry for the super noob questions but when you say:

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

Are you saying to download an archive from here: https://archlinuxarm.org/about/downloads ?

And then when you say:

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

Are you referring to the folder of the downloaded archive? Or are you referring to a folder in the repo?


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: stef_stef on December 09, 2017, 10:24:05 PM
Are there any updates on this project? :)


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: VyprBTC on December 09, 2017, 10:55:54 PM
Hope to see some more development on it, lots of cool potential here!


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: stef_stef on December 10, 2017, 04:23:59 PM
I have the script up and running on mi pi2, however I am trying to set up Telegram.

Would anyone offer some hints? I'd really appreciate that. I have set up the bot, edited the config file with the bot API and my telegram username as admin, but I am not getting any response in return.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: stef_stef on December 13, 2017, 10:47:23 PM
Cmoon guys, I am desperate for some help.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: puwaha on December 14, 2017, 03:49:49 AM
Sorry, I don't use Telegram, so I can't help... not a helpful post... I know.   :-\


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: stef_stef on December 17, 2017, 02:22:14 PM
Sorry, I don't use Telegram, so I can't help... not a helpful post... I know.   :-\
Kind of disappointed from the lack of support in this thread, but it is what it is


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: puwaha on December 18, 2017, 01:21:26 AM
Sorry, I don't use Telegram, so I can't help... not a helpful post... I know.   :-\
Kind of disappointed from the lack of support in this thread, but it is what it is

Sorry, I'm not the developer, nor do I use Telegram.  You might try to PM the developer.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: stef_stef on December 18, 2017, 03:00:14 PM
Sorry, I don't use Telegram, so I can't help... not a helpful post... I know.   :-\
Kind of disappointed from the lack of support in this thread, but it is what it is

Sorry, I'm not the developer, nor do I use Telegram.  You might try to PM the developer.

Figured it out by myself by now. I PM'ed the developer a long time ago.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Kasmetski on December 20, 2017, 11:15:34 PM
Hello, I'm back after some shitty things happened IRL and I will try to be more active in the forum.
II need to click mail notifications for this thread but If you need something urgent you can always find me on twitter with the same name.

'm starting to answer question I see.
Might you kindly provide more information about the telegram interface ?
I can help to improve some features in the project such as web interface and dashboards...
Be more specific? I will describe in general.. you need to make a Telegram bot. Write to BotFather https://telegram.me/botfather and follow the instructions there.
After that edit the config file with the bot-username and api key.

About the web interface I will be happy if someone make it.
First I need to refactor the code a little bit and make everything in modules,

Sorry for the super noob questions but when you say:

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

Are you saying to download an archive from here: https://archlinuxarm.org/about/downloads ?

And then when you say:

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

Are you referring to the folder of the downloaded archive? Or are you referring to a folder in the repo?

The download link is going to archlinux? But I can guess you ask about the Release page?
If yes, the only difference between Release archive and /bin/ directory in the repo is the second one is latest build from code but have some bugs. Binary files in the release page are older and don't have Telegram and Pushover integration.



If you need some help
 I'm here if something is urgent - twitter - https://twitter.com/Kasmetsk1


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: stef_stef on December 22, 2017, 06:35:13 PM
Just so that someone does not get lost like me :)

The config.json file that needs to be edited is located in the /bin folder.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: stef_stef on January 07, 2018, 03:42:10 PM
I've been trying to make the script run on start up, but I am kind a lost. Has anyone done it?


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Kasmetski on January 08, 2018, 12:41:26 PM
Did you try to put the file and config here "~/.config/lxsession/LXDE-pi/autostart"?



Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Golempl on January 08, 2018, 01:32:17 PM
I can preffer ubnt mpower , just add proper crontab script and thats all. You get power meter here also.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: huntingthesnark on January 22, 2018, 11:51:56 AM
Great project folks! On the telegram side, I've created a bot, and added the api key and admin details to the config file. I see there's a list of commands here: https://github.com/Kasmetski/auto-hard-reset/commit/0c370ced9ffe2c7156d353b83e66333082d67f99

but nothing seems to work. Is there another activation step I've missed? Thanks in advance...


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Kasmetski on January 25, 2018, 09:46:18 PM
Hello, did you change the tgactivate config.json option to true?
Also do you see any errors in the config file when you start the tool?
If you wrote everything correctly in the config you should see information in the log, or if there is problem with the api you will see error too.

Cheerz


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: huntingthesnark on January 29, 2018, 12:29:44 PM
Thanks for the response! I've set tg activate to true, and I'm not getting any errors - altho my log files appear to be blank/empty. They're being created, but not filled.

This is my config:

"WaitSeconds": 60,
    "Log": true,
    "StartupCheck": true,
    "TgBotActivate": true,
    "TgAPIKey": "xxxx"
    "TgAdminUserName": "xxxxx",
    "Miners": [

I'm clearly missing something basic!


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Kasmetski on January 30, 2018, 10:18:56 AM
What version did you download?
Is it the one from "release" pages or vie bin folder in the source?
When you start the tool, you should see message in the terminal like this:
12:18:04.231 ▶ NOTIC 00b ▶  TelegramBot Authorteleized on account XXXXXXXXXXXXXX


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: huntingthesnark on January 30, 2018, 05:49:57 PM
Excellent spot! Idiot here had downloaded your first version. Spent hours checking the code thinking I'd missed a space or something...duh.

Really appreciate the help - Telegram remote is up and running!

Just have to test the relays and I'll be in business... Thanks again!


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: tuanvu01 on February 05, 2018, 09:44:44 AM
Good job!
I run it on Orange Pi Pc, but it cannot run relay signal on PIN 40
Please help me


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: huntingthesnark on February 05, 2018, 02:06:35 PM
Worth mentioning that the (most excellent) developer has used physical GPIO pinout definitions in the Go code.
(I started using BCM, which obviously didn't work)

Make sure you're using the right ones! Handy guide: https://tr.pinout.xyz/




Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: hashestohashes on February 09, 2018, 07:01:37 PM
I just messed with this for probably five hours (learning curve). I got it up and going now though, at least half, really awesome idea and it may or may not be "that difficult" for someone already experienced. It's a massive help here. So, thanks! I have been meaning to dive into a micro controller for a while, figured now is a good spot to start.

Now I just keep getting an error "Problem with the API key. Fix the problem or disable the TelegramBot from the config file" seems like the api key (around 32 letters/numbers) is correct to me..... I'll mess with it later

Ok, made it past that, now when I send a message from my phone to the bot it just says you're not my master. Skimming through the code it seems it checks something and says this before it can go further. So that's what I'm working on now, step by step pretty good learning experience.

Journey continues, bot now accepts commands, bot name, vs username changes, and everything else lol.

So, a question: Is telegram suppose to send me a message when a rig goes down? I looked through the code some more and I don't think it does currently, but I can't be sure lol

OK, Pushover notifications worked lol


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: bobster316 on February 20, 2018, 01:49:34 PM
Can someone help/guide me to set this up on raspberry pi3, i have purchased the relay switch and have connected it to the appropriate gpio pins as shown in the diagram.

The raspberry pi3 running raspbian


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: bobster316 on February 20, 2018, 03:25:41 PM
anyone please?


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: puwaha on February 21, 2018, 05:48:34 AM
Can someone help/guide me to set this up on raspberry pi3, i have purchased the relay switch and have connected it to the appropriate gpio pins as shown in the diagram.

The raspberry pi3 running raspbian

Look at the config.json file.  In this file is where you setup the IP address and the GPIO pin that it's connected to.  Find a pin-out of your pi3, select some GPIO pins and match them up in your JSON file.



Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: bobster316 on February 21, 2018, 09:24:54 AM
Can someone help/guide me to set this up on raspberry pi3, i have purchased the relay switch and have connected it to the appropriate gpio pins as shown in the diagram.

The raspberry pi3 running raspbian

Look at the config.json file.  In this file is where you setup the IP address and the GPIO pin that it's connected to.  Find a pin-out of your pi3, select some GPIO pins and match them up in your JSON file.



I have setup the following -

 
GPIOI 39 - GND – Red                                         
GPIO 16 (pin36) – IN1- Yellow >>>>>>> MiningRig01
GPIO 12 (pin32) – IN2 – Green >>>>>>> MiningRig02
GPIO 36 – IN3 – Orange  >>>>>> Free
GPIO 29 – IN4 – Blue >>>>>>>>> Free
GPIO 4  - VCC – Black

 

What pins do I need to connect between motherboard and the switch

I have configured the config.json as follows (what other changes do i need to make to this) –

{
    "WaitSeconds": 1800,
    "StartupCheck" : true,
    "Log" : true,
    "RemoteNotify" : false,
    "TgBotActivate" : false,
    "TgAPIKey" : "API-KEY",
    "TgAdminUserName" : "USERNAME",
    "Pushover": false,
    "PushoverToken": "ACCESS-TOKEN",
    "PushoverUser": "USER-TOKEN",
    "Miners": [
        {   "Name": "machine 0", "Pin": "36", "Ip": "192.168.0.16", "Info": "MiningRig01"  },   
        {   "Name": "machine 1", "Pin": "32", "Ip": "192.168.0.38", "Info": "MiningRig02"   },   
    ]
}

How do i configure the raspberry pi with this config? i have seen mention of "Go" ?


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: bobster316 on February 22, 2018, 08:49:55 AM
Any help from anyone?


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: puwaha on February 22, 2018, 03:42:11 PM
What kind of help are you looking for?  You’ve setup the JSON file, I’m assuming you’ve connected the relays to the matching GPIO pins in the JSON file.  From there you just follow the install instructions from the Github page and run it.  I would suggest you not connect the relays to your rigs until you know that it’s working.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: sunder54 on February 22, 2018, 03:49:41 PM
Nice share about this, I think cheaper if we buy usb watchdog. It’s also can reset our computer if they have a problem maybe GPU hang, our operating system especially windows that compatible with usb watchdog software. But I’m appreciate you guys who want to learn for your knowledge.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: kainplan on February 22, 2018, 09:52:10 PM
At first: Thanks for the nice work!
I got it running now, just need to figure out how to easily remote control the pi desktop itself. Since i'm a few thousand kilometers away the next weeks i would feel better having the possibility to restart/stop the reset tool manually. I don't like the theoretical possibility of getting my rigs rebooted continuously for weeks ;)

Concerning the telegram bot: You have to set your telegram username (i had to choose one at first) as admin name in the json file. Not the Bots admin name! Got the "not my master" message, too. After that you are able to ask the bot via /status, /ping Rig, /help, ... (see commands in telegram.go switch)

For my opinion a notification each time a rig reboots would be great, too. But anyways - great work so far!

I just messed with this for probably five hours (learning curve). I got it up and going now though, at least half, really awesome idea and it may or may not be "that difficult" for someone already experienced. It's a massive help here. So, thanks! I have been meaning to dive into a micro controller for a while, figured now is a good spot to start.

Now I just keep getting an error "Problem with the API key. Fix the problem or disable the TelegramBot from the config file" seems like the api key (around 32 letters/numbers) is correct to me..... I'll mess with it later

Ok, made it past that, now when I send a message from my phone to the bot it just says you're not my master. Skimming through the code it seems it checks something and says this before it can go further. So that's what I'm working on now, step by step pretty good learning experience.

Journey continues, bot now accepts commands, bot name, vs username changes, and everything else lol.

So, a question: Is telegram suppose to send me a message when a rig goes down? I looked through the code some more and I don't think it does currently, but I can't be sure lol

OK, Pushover notifications worked lol


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: bobster316 on February 25, 2018, 12:21:04 PM
What kind of help are you looking for?  You’ve setup the JSON file, I’m assuming you’ve connected the relays to the matching GPIO pins in the JSON file.  From there you just follow the install instructions from the Github page and run it.  I would suggest you not connect the relays to your rigs until you know that it’s working.

Thanks, have switching working now, can you please advise which if i have the outputs connected correctly (going to power on/off)

https://imgur.com/a/NFC49


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: puwaha on February 25, 2018, 09:42:13 PM
What kind of help are you looking for?  You’ve setup the JSON file, I’m assuming you’ve connected the relays to the matching GPIO pins in the JSON file.  From there you just follow the install instructions from the Github page and run it.  I would suggest you not connect the relays to your rigs until you know that it’s working.

Thanks, have switching working now, can you please advise which if i have the outputs connected correctly (going to power on/off)

https://imgur.com/a/NFC49

It's pretty easy to test.  Just unplug your ethernet cable on your rig.  When the time is up, this program should initiate the hard-reboot sequence.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: huntingthesnark on March 08, 2018, 04:20:32 PM
Slightly weird one. Have had this up and running with just one rig for ages. Just trying to add a second, and telegram doesn't seem to recognise commands for different rigs. So /restart m1 restarts m0... (I've named machines m0, m1, etc in the config)...

Any thoughts anybody?

Edit: I assume in telegram "/restart m1" is being received as just "/restart"... so far tried /restartm1 /restart,m1... machine 0 is getting a bashing...


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: polymer_city2 on March 08, 2018, 04:56:09 PM
I was thinking about doing a Windows 10 IoT version in c#.

Do you need to externally power the relay?


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: puwaha on March 09, 2018, 05:28:26 AM
I was thinking about doing a Windows 10 IoT version in c#.

Do you need to externally power the relay?

The PI supplies the power for the relay.  The 5V from pin 2 or 4 on the GPIO pins power the VCC input on the relay.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: huntingthesnark on March 09, 2018, 11:51:29 AM
Has anyone got Telegram commands working for multiple rigs, and if so what exact commands work? My setup appears to not recognise "Name": "machine 0"...

Everything else works, so must be some kind of code/punctuation cockup I'm making...


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: kuupea on March 12, 2018, 10:42:25 AM
I set it up, the pi and relay worked fine i think, I saw lights blink in accordance on relay with it had to reset, but it didnt.
I think because I had to put few of those jumper cables together the current didnt make it to the motherboard.
What cables are recommended ?


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: ChrisTaylor on March 12, 2018, 10:59:02 AM
i know this is not he correct place to ask this but.. is there any chance of a non so much tech savy people to join mining? I undestand the value that i can generate from it, but sadly im not geek out to the max in this matter.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: puwaha on March 13, 2018, 03:39:38 AM
I set it up, the pi and relay worked fine i think, I saw lights blink in accordance on relay with it had to reset, but it didnt.
I think because I had to put few of those jumper cables together the current didnt make it to the motherboard.
What cables are recommended ?

Just buy a pack or two of these project cables like these:

https://www.amazon.com/gp/product/B01EV70C78/ref=oh_aui_detailpage_o05_s01?ie=UTF8&psc=1 (https://www.amazon.com/gp/product/B01EV70C78/ref=oh_aui_detailpage_o05_s01?ie=UTF8&psc=1)



Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: kuupea on March 13, 2018, 04:56:23 AM
I set it up, the pi and relay worked fine i think, I saw lights blink in accordance on relay with it had to reset, but it didnt.
I think because I had to put few of those jumper cables together the current didnt make it to the motherboard.
What cables are recommended ?

Just buy a pack or two of these project cables like these:

https://www.amazon.com/gp/product/B01EV70C78/ref=oh_aui_detailpage_o05_s01?ie=UTF8&psc=1 (https://www.amazon.com/gp/product/B01EV70C78/ref=oh_aui_detailpage_o05_s01?ie=UTF8&psc=1)



Cheers.
Turns out the relay is dead, it does not 'click' , so I'm getting a new board. Also grabbed some wire and going to solder together the wires with jumper cables instead of daisy-chaining.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: huntingthesnark on March 13, 2018, 08:36:11 AM
I set it up, the pi and relay worked fine i think, I saw lights blink in accordance on relay with it had to reset, but it didnt.
I think because I had to put few of those jumper cables together the current didnt make it to the motherboard.
What cables are recommended ?

Just buy a pack or two of these project cables like these:

https://www.amazon.com/gp/product/B01EV70C78/ref=oh_aui_detailpage_o05_s01?ie=UTF8&psc=1 (https://www.amazon.com/gp/product/B01EV70C78/ref=oh_aui_detailpage_o05_s01?ie=UTF8&psc=1)



Cheers.
Turns out the relay is dead, it does not 'click' , so I'm getting a new board. Also grabbed some wire and going to solder together the wires with jumper cables instead of daisy-chaining.

I used the project cables into the MB, then soldered on some of this: http://amzn.to/2Ht70zr Cheap as chips, ideal for longer runs.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Kasmetski on March 13, 2018, 01:23:26 PM
Looks like most of the problems are with the initial setup and all connections between RPI and the relay.
This week I will move some machines to the farm and I will take pictures of the whole setup to be easier for new people.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: heavyarms1912 on March 16, 2018, 03:44:05 PM
I am planning to use energy monitoring capabilities of smartplug to auto-reboot rigs based. 
Have observed typically on miner/OS crashes the power consumption would drop.  Thankfully haven't faced a hard hang with GPUs running at max clocks/volts.

I have figured out how to do this remotely on tp-link HS110.  (Doesn't even have to be in same network)


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: polymer_city2 on March 17, 2018, 01:47:49 PM
Update on Windows IoT version.

2 day in and I have it all plugged in and working with a basic UI.

Windows IoT is surprisingly easy to work with.

I had problems with my 8 channel “5v” board.

Turns out it only ran with 12v! So that is powered off a PSU now.

I ping claymore port, then turn relay on if no response.

I had to check firewall settings for claymore too, that gave me some silly problems.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Lunga Chung on March 17, 2018, 01:59:32 PM
Don't want to troll the thread but isn't this solution easier to use for vast majority of miners ?

https://www.aliexpress.com/item/LAN-RJ45-interface-Industrial-Network-16-Channels-relay-board-controller-for-home-automation-remote-control-switch/32661796157.html?spm=2114.search0104.3.2.5a427fc3RpXEX1&ws_ab_test=searchweb0_0,searchweb201602_3_10152_10151_10065_10344_10068_10342_10343_10340_10341_10696_10084_10083_10618_10307_5711213_10313_10059_10534_100031_10103_10624_10623_443_10622_10621_10620_5711313_5722413,searchweb201603_1,ppcSwitch_5&algo_expid=9c395e60-8d94-4d6f-a988-8b8f28690f76-0&algo_pvid=9c395e60-8d94-4d6f-a988-8b8f28690f76&priceBeautifyAB=0

There is also a source code available


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: slv1221 on March 17, 2018, 02:07:37 PM
is there any way to add a telegram bot?


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: puwaha on March 17, 2018, 03:15:53 PM
I am planning to use energy monitoring capabilities of smartplug to auto-reboot rigs based. 
Have observed typically on miner/OS crashes the power consumption would drop.  Thankfully haven't faced a hard hang with GPUs running at max clocks/volts.

I have figured out how to do this remotely on tp-link HS110.  (Doesn't even have to be in same network)

I have built something like this... It works very well:

https://bitcointalk.org/index.php?topic=2866608 (https://bitcointalk.org/index.php?topic=2866608)


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: heavyarms1912 on March 17, 2018, 06:01:57 PM
I am planning to use energy monitoring capabilities of smartplug to auto-reboot rigs based. 
Have observed typically on miner/OS crashes the power consumption would drop.  Thankfully haven't faced a hard hang with GPUs running at max clocks/volts.

I have figured out how to do this remotely on tp-link HS110.  (Doesn't even have to be in same network)

I have built something like this... It works very well:

https://bitcointalk.org/index.php?topic=2866608 (https://bitcointalk.org/index.php?topic=2866608)

Good one.  What happens if the OS crashes?  How does the awesome miner send a signal then?

What I have tested so far is use GET/POST curl command requests so basically needs no signal from the Rig actually.  All I am doing is communicating with the smart plug and monitoring power consumption.  Reboot if the power consumption falls below a threshold level for sometime.  I can see a point of failure still - authentication token expires for my curl command requests (smart plug goes bad and network is down can't be handled anyways)


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: puwaha on March 17, 2018, 07:29:35 PM
I am planning to use energy monitoring capabilities of smartplug to auto-reboot rigs based. 
Have observed typically on miner/OS crashes the power consumption would drop.  Thankfully haven't faced a hard hang with GPUs running at max clocks/volts.

I have figured out how to do this remotely on tp-link HS110.  (Doesn't even have to be in same network)

I have built something like this... It works very well:

https://bitcointalk.org/index.php?topic=2866608 (https://bitcointalk.org/index.php?topic=2866608)

Good one.  What happens if the OS crashes?  How does the awesome miner send a signal then?

You wouldn't run Awesome Miner on your rig, it should be a separate machine or virtual machine.  Otherwise, like you thought... how could it reboot a rig?



Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: huntingthesnark on March 19, 2018, 01:45:34 PM
is there any way to add a telegram bot?

Can anybody share the telegram commands they use for multiple rigs?


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: heavyarms1912 on March 19, 2018, 02:38:57 PM
I am planning to use energy monitoring capabilities of smartplug to auto-reboot rigs based.  
Have observed typically on miner/OS crashes the power consumption would drop.  Thankfully haven't faced a hard hang with GPUs running at max clocks/volts.

I have figured out how to do this remotely on tp-link HS110.  (Doesn't even have to be in same network)

I have built something like this... It works very well:

https://bitcointalk.org/index.php?topic=2866608 (https://bitcointalk.org/index.php?topic=2866608)

Good one.  What happens if the OS crashes?  How does the awesome miner send a signal then?

You wouldn't run Awesome Miner on your rig, it should be a separate machine or virtual machine.  Otherwise, like you thought... how could it reboot a rig?



I see.  And I am guessing it needs to be running on the same network?
Also,  I have observed instances where the ping requests work even though miner would've crashed.  how does it tackle those situations?

EDIT: I have tested the following components for my script so far.

1.  get power readings for my rigs
2.  reboot rig if power is below a threshold and notify via. an email
3.  script can run remotely.  I was actually trying to figure out to keep this running on a cellphone.

Just need to workout all these with wait time before/after reset.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: puwaha on March 20, 2018, 03:36:46 AM
You wouldn't run Awesome Miner on your rig, it should be a separate machine or virtual machine.  Otherwise, like you thought... how could it reboot a rig?



I see.  And I am guessing it needs to be running on the same network?

Yes, same network for simplicity, or you have a VPN connection between locations if your miners are at a different location than the Awesome Miner computer.


Quote
Also,  I have observed instances where the ping requests work even though miner would've crashed.  how does it tackle those situations?

You have other rules in Awesome Miner that will take care of restarting the miner if it crashes.  You can even have it reboot the rig if you think it's necessary.

We should probably discuss it on the other thread and not junk up this thread about using Raspberry Pis.


Quote
EDIT: I have tested the following components for my script so far.

1.  get power readings for my rigs
2.  reboot rig if power is below a threshold and notify via. an email
3.  script can run remotely.  I was actually trying to figure out to keep this running on a cellphone.

Just need to workout all these with wait time before/after reset.


Use my script in the other thread as a guide.  You definitely want a few 60 second waits to allow the rig to boot back up so that Awesome Miner doesn't run the rule again because the rig hasn't fully rebooted to start responding to pings.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: ne0x86 on March 22, 2018, 12:52:29 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


https://i.imgur.com/NXb9hx6.png

Hi, can you share this html?

Thanks!

And thanks @Kasmetski for this awesome tool.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: polymer_city2 on March 30, 2018, 06:34:45 AM
I have uploaded my Windows IoT rig rebooter for Rpi

https://github.com/ColossusFX/RigRebooter-UWP (https://github.com/ColossusFX/RigRebooter-UWP)


https://prnt.sc/iyd3ci (https://prnt.sc/iyd3ci)


Just add your IP address and corresponding GPIO pins


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: RigMaster on April 17, 2018, 10:49:35 PM
Hi Guys

Firstly, @Kasmetski for the amazing work on this rig resetter. It's exactly what I was looking for after weeks of headache with my rig hanging and I must drive 40 miles to reboot!.

I have purchased a Raspberry Pi 3 Model B and installed Raspbian just now. I have also enabled SSH and changed the password for user Pi for security.

Now, I am on Github but I'm not sure what to do from here...

Should I run:
Code:
sudo curl -O https://github.com/Kasmetski/auto-hard-reset/archive/master.zip
to download the file to the default directory?

After this, github mention to run:
Code:
tar -xvzf auto-hard-reset-arm7.tar.gz
chmod +x auto-hard-reset-arm7

But I checked in Github file list I don't see any auto-hard-reset-arm7.tar.gz filename.

Please help, sorry for the noob question... I'm sure I am overlooking something.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: mercoinz on April 21, 2018, 03:52:18 AM
I have uploaded my Windows IoT rig rebooter for Rpi

https://github.com/ColossusFX/RigRebooter-UWP (https://github.com/ColossusFX/RigRebooter-UWP)


https://prnt.sc/iyd3ci (https://prnt.sc/iyd3ci)


Just add your IP address and corresponding GPIO pins

this is great! going to give this a shot, thank you so much!


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: Godm0de on June 06, 2018, 01:22:21 PM
Hi,

thx for the github project, works like a charm. :)

I have a few questions, maybe someone has an answer to it:

- I want to connect 3 relais boards (2x8 channel + 1x4 channel). I have connected the 2 relais with 8 channels to the 5v pins of my raspbery pi and the 4 channel relais to the 3.3v pin. The relais are all 5v, but I've connect the 1x4 channel relais to the 3.3v pin and it also works. Is this dangerous, or is it ok, to connect a 5v relais to the 3.3v pin?

- I have read somewhere, that you should use a resister between PI and relais boards, to limit the current. Is this really necessary?

- Some LEDs on my relais boards are lit very dim at startup and stays at this level. I think this is because of the default GPIO levels, after startup of the PI. If the relais is swichted one time, the LEDs are dark. Maybe you should initialize all the pins, at startup to LOW voltage state.



Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: RigMaster on June 16, 2018, 01:31:30 PM
Hi Guys

Firstly, @Kasmetski for the amazing work on this rig resetter. It's exactly what I was looking for after weeks of headache with my rig hanging and I must drive 40 miles to reboot!.

I have purchased a Raspberry Pi 3 Model B and installed Raspbian just now. I have also enabled SSH and changed the password for user Pi for security.

Now, I am on Github but I'm not sure what to do from here...

Should I run:
Code:
sudo curl -O https://github.com/Kasmetski/auto-hard-reset/archive/master.zip
to download the file to the default directory?

After this, github mention to run:
Code:
tar -xvzf auto-hard-reset-arm7.tar.gz
chmod +x auto-hard-reset-arm7

But I checked in Github file list I don't see any auto-hard-reset-arm7.tar.gz filename.

Please help, sorry for the noob question... I'm sure I am overlooking something.

It's ok I've now got it working and Telegram working also.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: RigMaster on June 16, 2018, 04:57:12 PM
I've got a strange issue...

I ssh into my raspberry pi and i run the script using:

cd Downloads
./auto-hard-reset-arm7

Then it starts... it pings the rig then it goes to timer "300s" because I made the timer for 5min rather than 30min. It works perfectly while my ssh connection is live and the telegram bot responds fine if I check /status

Soon as I kill ssh connection to the raspberry pi, the script stops working and even the bot is not responding in telegram... it's as if, when i kill the ssh connection it stops the script.

Can anyone help with this issue?


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: puwaha on June 16, 2018, 06:34:43 PM
I've got a strange issue...

I ssh into my raspberry pi and i run the script using:

cd Downloads
./auto-hard-reset-arm7

Then it starts... it pings the rig then it goes to timer "300s" because I made the timer for 5min rather than 30min. It works perfectly while my ssh connection is live and the telegram bot responds fine if I check /status

Soon as I kill ssh connection to the raspberry pi, the script stops working and even the bot is not responding in telegram... it's as if, when i kill the ssh connection it stops the script.

Can anyone help with this issue?

Use the screen utility in linux to keep the script running even if you close your ssh session.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: sockpuppet1911 on June 16, 2018, 07:28:47 PM
Was wondering if someone had come up with something like this the other day. When my script restarts cast-xmr after a drop in hashrate it sometimes jams the whole system. Thank you


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: RigMaster on June 16, 2018, 10:21:12 PM
I've got a strange issue...

I ssh into my raspberry pi and i run the script using:

cd Downloads
./auto-hard-reset-arm7

Then it starts... it pings the rig then it goes to timer "300s" because I made the timer for 5min rather than 30min. It works perfectly while my ssh connection is live and the telegram bot responds fine if I check /status

Soon as I kill ssh connection to the raspberry pi, the script stops working and even the bot is not responding in telegram... it's as if, when i kill the ssh connection it stops the script.

Can anyone help with this issue?

Use the screen utility in linux to keep the script running even if you close your ssh session.


Thank you! That worked perfectly.
The script is now running like a dream and Telegram bot is functional :)
Tomorrow I will replace my faulty risers and then hopefully this rig is finished and i can move to the next.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: urnzwy on June 30, 2018, 10:26:52 PM
You connect your relay in NO & COM to the PWR pins or the Reset pins?


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: buddyleex on July 22, 2018, 08:10:31 PM
Does anyone know the max cable lengths for the 5v run from the pi to the relay, the gpio runs from the pi to the relay, and from the relay to the motherboard reset pins?

I have my rigs in 3 separate racks and would like to utilize 1 pi in total and 1 relay per rack (3 relays total). The cable lengths from the pi to the racks would be 18 ft, 14 ft, & 16 ft respectively and the cable lengths from the 5v relays to the motherboards would be 3 ft, 4 ft, 5 ft, 6 ft & 7 ft respectively. I'm not too concerned about the runs from the relays to the boards but I'm worried that 14-18 runs from the pi to the relay are too long. Can anyone weigh in?


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: puwaha on July 23, 2018, 08:43:13 AM
Does anyone know the max cable lengths for the 5v run from the pi to the relay, the gpio runs from the pi to the relay, and from the relay to the motherboard reset pins?

I have my rigs in 3 separate racks and would like to utilize 1 pi in total and 1 relay per rack (3 relays total). The cable lengths from the pi to the racks would be 18 ft, 14 ft, & 16 ft respectively and the cable lengths from the 5v relays to the motherboards would be 3 ft, 4 ft, 5 ft, 6 ft & 7 ft respectively. I'm not too concerned about the runs from the relays to the boards but I'm worried that 14-18 runs from the pi to the relay are too long. Can anyone weigh in?

Those lengths shouldn't be a problem.  If you were talking about hundreds of feet, then maybe.  The relay boards can also be powered separately.


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: buddyleex on August 01, 2018, 11:02:57 PM
Ok I figured out the wiring, I'm guessing LOW(relay light on) = not triggering reset and HIGH= (light off) = triggers reset button. Is there anyway to reverse this?


Title: Re: [DIY] auto-hard-reset mining rigs with Raspberry Pi
Post by: RigMaster on October 06, 2019, 01:06:49 AM
is there any way to add a telegram bot?

Can anybody share the telegram commands they use for multiple rigs?

Sorry to drag up an old topic but it's relevant for whoever else may be having this same issue...
Today I've setup a second Raspberry Pi using this script - absolutely love this script!!

I've got 6 rigs connected to it on an 8CH 5V Relay Board and noticed the same... no matter the command, the Telegram Bot would only trigger Rig 0:
/ping m0, m1, m2 etc
/restart m0, m1, m2 etc
/turnon m0, m1, m2 etc

After some digging... I found the cause... remove the 'm'

/restart 0
/restart 1
/restart 2

Without the 'm' it works perfectly... because in the code it looks for machine NUMBER not anything else.

I hope this helps.