Bitcoin Forum
November 10, 2024, 05:52:17 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Reboot Antminer S1 Automatically The Instant It Stops Hashing ***UPDATED  (Read 4254 times)
rotediablo (OP)
Newbie
*
Offline Offline

Activity: 18
Merit: 0


View Profile
April 28, 2014, 10:02:54 PM
Last edit: April 28, 2014, 10:24:34 PM by rotediablo
 #1

Every once in awhile my Antminer S1's will stop hashing.
I am not sure why there is no rhyme or reason or pattern.
I just know that I have to babysit them and reboot or power cycle when they stop hashing.
This seems to be a common problem. The reason has yet to be identified.

I don't have time to be a babysitter and I also need to sleep.

So I wrote a small script to check for hashing and set it to run every minute. If the S1 has stopped hashing it will automatically reboot.


1. SSH into your miner. I use putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
2. enter your login credentials
3. type cd /bin
4. type vi hashcheck
5. type the following code (shown below in bold) into the vi editor

    #!/bin/ash
      var=$(cat /proc/loadavg | grep . | cut -c 1)
      if [ $var -lt 1 ]
      then
      /sbin/reboot
      else
      fi


6. Press the Esc key
7. Type :x and then press enter
8. Close putty
9. Now access your miner via the web interface
10. Click the system tab
11. Click Scheduled Tasks
12. Under */3 *  *   *   *     /usr/bin/cgminer-monitor add the following on the next line */5 *  *   *   *    /usr/bin/hashcheck
13. Click Submit in the bottom right hand corner

That's it. Now your miner will run this script every 5 minutes. If the miner has stopped hashing the script will return a value of 0 causing the miner to reboot automatically.
As long as the miner is hashing the script will return the number 2 and nothing will happen and she will keep chugging away.

To see if the script is running, wait 10 minutes or so then go back to the Status Tab then System Log. Scroll way to the bottom.
You should see a line like this: Mon Apr 28 16:58:01 2014 cron.info crond[576]: crond: USER root pid 3223 cmd /usr/bin/hashcheck

If you see this at the bottom of the System Log then you know the cron job is running correctly.

I know this has helped me tremendously. I hope it helps you too.

As always if this helped you and you feel so inclined send me a BTC donation.

I can help anyone too on a personal basis if needed. Send me a PM. I will talk you through it.
MODS This might be one worth pinning. :0)
SecureErase
Member
**
Offline Offline

Activity: 83
Merit: 10


View Profile
May 05, 2014, 11:33:18 AM
 #2

Thanks rotediablo great script,

One of my Ant's has just developed a random powering off 'feature', not sure your script will help that issue for me. I have used a different PSU but same problem  ??

spazzdla
Legendary
*
Offline Offline

Activity: 1722
Merit: 1000


View Profile
May 05, 2014, 12:42:00 PM
 #3

Same problem.. alas not brave enough to try that.
bbxx
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


cryptoshark


View Profile WWW
May 06, 2014, 10:53:04 PM
 #4

Thanks rotediablo great script,

One of my Ant's has just developed a random powering off 'feature', not sure your script will help that issue for me. I have used a different PSU but same problem  ??

i think you need andurino, just connect wires to psu directly instead a paperclip, use pool api to check if unit stopped hashing, if yes terminate virtual paperclip and connect it again by andurino...
bbxx
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


cryptoshark


View Profile WWW
May 07, 2014, 09:49:57 PM
 #5

Every once in awhile my Antminer S1's will stop hashing.
...
3. type cd /bin
4. type vi hashcheck
5. type the following code (shown below in bold) into the vi editor

    #!/bin/ash
      var=$(cat /proc/loadavg | grep . | cut -c 1)
      if [ $var -lt 1 ]
      then
      /sbin/reboot
      else
      fi


12. Under */3 *  *   *   *     /usr/bin/cgminer-monitor add the following on the next line */5 *  *   *   *    /usr/bin/hashcheck


great that you have used my line cat /proc/loadavg | grep . | cut -c 1 Smiley i mentioned in other thread

unfortunatelly script does not work

1)
you are creating file /bin/hashcheck not /usr/bin/hashcheck so reference in crontab should be modified
2)
Syntax error near unexpected token 'fi' is given when you are launching script by hand
it is becouse of line with "else", it is not needed.
3)
you have to change permissions to execute hashcheck file

to sum up:
point 3
type cd /bin
type cd /usr/bin
point 5
else
point 5.5
chmod 775 /usr/bin/hashcheck

anyway thanks for great effort. my antminer just stopped hashing, i wrote your script and now it is hashing again Smiley
SecureErase
Member
**
Offline Offline

Activity: 83
Merit: 10


View Profile
May 08, 2014, 01:38:26 AM
 #6

Thanks rotediablo great script,

One of my Ant's has just developed a random powering off 'feature', not sure your script will help that issue for me. I have used a different PSU but same problem  ??

i think you need andurino, just connect wires to psu directly instead a paperclip, use pool api to check if unit stopped hashing, if yes terminate virtual paperclip and connect it again by andurino...

What is Andurino? As of now the Ant won't even power up.....

allcoinminer
Hero Member
*****
Offline Offline

Activity: 784
Merit: 504


View Profile
May 08, 2014, 04:48:01 AM
 #7

Thanks rotediablo great script,

One of my Ant's has just developed a random powering off 'feature', not sure your script will help that issue for me. I have used a different PSU but same problem  ??

i think you need andurino, just connect wires to psu directly instead a paperclip, use pool api to check if unit stopped hashing, if yes terminate virtual paperclip and connect it again by andurino...

What is Andurino? As of now the Ant won't even power up.....

Its Arduino.
Quote
ARDUINO IS AN OPEN-SOURCE ELECTRONICS PROTOTYPING PLATFORM BASED ON FLEXIBLE, EASY-TO-USE HARDWARE AND SOFTWARE. IT'S INTENDED FOR ARTISTS, DESIGNERS, HOBBYISTS AND ANYONE INTERESTED IN CREATING INTERACTIVE OBJECTS OR ENVIRONMENTS.
http://www.arduino.cc/
bbxx
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


cryptoshark


View Profile WWW
May 08, 2014, 08:46:33 AM
 #8


Its Arduino.
Quote
ARDUINO IS AN OPEN-SOURCE ELECTRONICS PROTOTYPING PLATFORM BASED ON FLEXIBLE, EASY-TO-USE HARDWARE AND SOFTWARE. IT'S INTENDED FOR ARTISTS, DESIGNERS, HOBBYISTS AND ANYONE INTERESTED IN CREATING INTERACTIVE OBJECTS OR ENVIRONMENTS.
http://www.arduino.cc/

sorry for my lame spelling...
Haskel85
Member
**
Offline Offline

Activity: 69
Merit: 10


View Profile
May 08, 2014, 10:09:15 AM
 #9

Just want to say thanks for this sticky.

dulac97
Member
**
Offline Offline

Activity: 78
Merit: 10


View Profile
May 09, 2014, 12:13:46 PM
 #10

One of my Ants has been having the "I forgot how to hash" problem so I just installed this script with the suggested modifications.
Got it to appear in my system log, so I think I did it right.
Keeping fingers crossed that this keeps my Ant from sleeping while I am away at work!

Thanks so much!
Angela8488
Full Member
***
Offline Offline

Activity: 127
Merit: 100


View Profile
May 09, 2014, 04:31:14 PM
 #11

Here is my experience, S1 restart generally two reasons, 1: bad power supply 2: The network connection to the mine pool is unstable.
haaggus
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile WWW
July 01, 2014, 03:47:03 PM
 #12


When you typed "5.5" as in, step five-and-a-half, what did you mean by "chmod 775" and where does it go?


#!/bin/ash
      var=$(cat /proc/loadavg | grep . | cut -c 1)
      if [ $var -lt 1 ]
      then
      /sbin/reboot
      else
      fi

and you wrote:

point 3
type cd /bin
type cd /usr/bin
point 5
else
point 5.5
chmod 775 /usr/bin/hashcheck


So does that mean, the correct script looks like this?

cd /usr/bin
vi hashcheck

#! /usr/bin/ash
var=$(cat /proc/loadavg | grep . | cut -c 1)
      if [ $var -lt 1 ]
      then
      /sbin/reboot
      fi
chmod 775 /usr/bin/hashcheck
escape
:x


Is that the full script? Thanks.
Ni6HTH4wK
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
April 12, 2015, 04:04:47 PM
Last edit: April 12, 2015, 04:15:19 PM by Ni6HTH4wK
 #13

Old thread but I still have an S1 and this works.

Compilation of all editions above since it was a bit confusing.

1. SSH into your miner using Putty. (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
2. Enter your login credentials
3. Type cd /usr/bin, press Enter
4. Type vi hashcheck, press Enter
5. Type a, then type the following code into the vi editor
Code:
#!/bin/ash
var=$(cat /proc/loadavg | grep . | cut -c 1)
if [ $var -lt 1 ]
then
  /sbin/reboot
fi
6. Press Esc, then type :x, press Enter
7. Type chmod 775 /usr/bin/hashcheck, press Enter
8. Close putty
9. Now access your miner via the web interface
10. Click the System Tab > Scheduled Tasks
11. Paste the following code inside the textbox
Code:
*/3 *  *   *   *     /usr/bin/cgminer-monitor
*/5 *  *   *   *     /usr/bin/hashcheck
12. Click Submit in the bottom right hand corner
13. Click on Status tab > System Log and wait 10 min
14. Refresh the page, scroll down to the bottom and look for something like this
     Mon Apr 28 16:58:01 2014 cron.info crond[576]: crond: USER root pid 3223 cmd /usr/bin/hashcheck

Newbies with vi can use this cheat sheet - http://www.lagmonster.org/docs/vi.html
Pages: [1]
  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!