Bitcoin Forum

Bitcoin => Mining support => Topic started by: psp4804 on July 22, 2018, 01:16:04 AM



Title: On-board auto reboot with Antminer S9 (daily reboots)
Post by: psp4804 on July 22, 2018, 01:16:04 AM
I've struggled a long time with Antminers that work for a few days and then eventually need a reboot. Since I keep my miners away from home, this has been a hassle. Additionally, the environment I keep them in doesn't have much in terms of remote access or other running machines on the network that I can schedule reboots on.

Articles like https://blockoperations.com/make-antminer-s9-reboot-every-30-minutes/ detail consistent reboot schedules, utilizing separate computers to run cron jobs on. For an onboard solution, I've been doing this though:

Code:
#ssh onto the device
> ssh root@xx.xx.xx.xx
#modify the bmminer’s daemon file to include a reboot
>vi /etc/init.d/bmminer.sh #(@ line 44)

killall -9 bmminer || true
/sbin/shutdown -r -f +1440 “daily reboot” & #add this line in -- 1440 is 1440 min per reboot (1day)
/usr/bin/bmminer –fixed-freq –no-pre-heat –version-file /usr/bin/compile_time –api-listen –default-config /config/bmminer.conf &

#save file w/ escape + wq

at next reboot, the miner will automatically schedule a reboot after 1440 minutes before it begins to mine.
i’ve just started doing this on my miners and see no ill effects on S9s running firmware from 2017050318838 (Antminer-S9-all-201705031838-650M-user-Update2UBI-NF.tar.gz)

i might be way off base about how to properly do this, but i couldn't find anything about a decent on-board solution until I hacked this together myself. from my experience, this doesn't work on some of the other miners (like d3, l3) since they wipe files every reboot, but this works fine on s9 for me.


Title: Re: On-board auto reboot with Antminer S9 (daily reboots)
Post by: BitMaxz on July 22, 2018, 04:18:43 PM
Never heard if there is a way to make s9 miner to setup it on daily reboot on-board but I think you can use awesome miner to schedule s9 to reboot it daily.

Here is their official thread https://bitcointalk.org/index.php?topic=676942.0

I also found this thread https://bitcointalk.org/index.php?topic=596620.0
And it has also feature to schedule auto reboot or restart your miner.


Title: Re: On-board auto reboot with Antminer S9 (daily reboots)
Post by: PassThePopcorn on July 22, 2018, 09:28:40 PM
If you just want to restart the mining process, I haven't checked on the S9 but I know older units have a cron tab, this command was used to restart cgminer every 12 hours.

Code:
0 */12  *   *   *     /etc/init.d/cgminer restart

A few edits would be to change cgminer to bmminer as they now go on bmminer instead of cgminer, and to change /12 to /24.

Code:
0 */24  *   *   *     /etc/init.d/bmminer restart

I'm not entirely sure if the command is correct for every 24 hours but I do know the 12 hour one worked. If there is no crontab in the ui, their is a cron file somewhere on the system, add the line to that and it should work.


Title: Re: On-board auto reboot with Antminer S9 (daily reboots)
Post by: psp4804 on July 23, 2018, 02:11:48 AM
[...]

This isn't functional on the S9 at least without some additional setup, hence the process I went through. (i.e., running crontab itself threw an error and i was too lazy to diagnose it)

Never heard if there is a way to make s9 miner to setup it on daily reboot on-board but I think you can use awesome miner to schedule s9 to reboot it daily.

This defeats the purpose of doing it without having any external software / computers running, although is certainly a valid solution for many.


Title: Re: On-board auto reboot with Antminer S9 (daily reboots)
Post by: Ameador1 on July 26, 2018, 11:49:38 AM
Are you running the most current firmware for your miners?

I have an S9 that I bought back last November (I think) and was having trouble with it needing a reboot every day or two, but after upgrading to the latest firmware earlier this year - that has stopped. It still seems like I need to reboot them every couple of weeks now, but much better than before.

I know this isn't the solution you are asking for, but could you put in a RaspberryPi in the network there to run these scheduled reboots - not a full-scale desktop/laptop system - small and cheap. Just a thought if the firmware is not a viable solution.


Title: Re: On-board auto reboot with Antminer S9 (daily reboots)
Post by: PassThePopcorn on August 01, 2018, 12:36:39 AM
This isn't functional on the S9 at least without some additional setup, hence the process I went through. (i.e., running crontab itself threw an error and i was too lazy to diagnose it)

Yeah you're right. I did some checking and did locate a cron file that the S9 uses to sync the time, but I wasn't able to get it working with the reboots.


Title: Re: On-board auto reboot with Antminer S9 (daily reboots)
Post by: fanatic26_ on August 15, 2018, 03:28:23 PM
Another option is to run a raspberry Pi and use scripting to do it. Ansible works great for something like this, you can just pass raw SSH commands directly to each unit to reboot it


Title: Re: On-board auto reboot with Antminer S9 (daily reboots)
Post by: elmaestro on November 04, 2018, 03:08:46 AM
Note:  I'm working on resolving a script that reboots when hashrate is lower than 10 TH/s or the miner stops reporting hashrates.

Here is a script that reboots bitmain s9 miners every 2 hours.  

1. Create a file names S80autorestartbmminer.sh
2. Copy paste the code below.
3. Make it executable with chmod +x S80autorestartbmminer.sh
4. Copy the S80autorestartbmminer.sh file to your s9 with scp or sftp (ssh) into /etc/rcS.d/

If you use windows, you may need to run this command on the s9 while logged in as root via ssh:  
chmod +x /etc/rcS.d/S80autorestartbmminer.sh

There are no additional requirements.

Code:
#!/bin/sh
sleep 7200
reboot

Donate BTC for this script if you like it:  1CtQg2h6KE7Z8oppYsBgACisoC4YJA5sAB