Author

Topic: Reboot Antminer S1 Automatically The Instant It Stops Hashing ***UPDATED (Read 4254 times)

newbie
Activity: 2
Merit: 0
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
newbie
Activity: 28
Merit: 0

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.
full member
Activity: 127
Merit: 100
Here is my experience, S1 restart generally two reasons, 1: bad power supply 2: The network connection to the mine pool is unstable.
member
Activity: 78
Merit: 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!
member
Activity: 69
Merit: 10
Just want to say thanks for this sticky.
hero member
Activity: 728
Merit: 500
cryptoshark

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...
hero member
Activity: 784
Merit: 504
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/
member
Activity: 83
Merit: 10
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.....
hero member
Activity: 728
Merit: 500
cryptoshark
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
hero member
Activity: 728
Merit: 500
cryptoshark
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...
legendary
Activity: 1722
Merit: 1000
Same problem.. alas not brave enough to try that.
member
Activity: 83
Merit: 10
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  ??
newbie
Activity: 18
Merit: 0
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)
Jump to: