Bitcoin Forum
May 11, 2024, 02:17:44 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Warning: One or more bitcointalk.org users have reported that they strongly believe that the creator of this topic is a scammer. (Login to see the detailed trust ratings.) While the bitcointalk.org administration does not verify such claims, you should proceed with extreme caution.
Pages: [1]
  Print  
Author Topic: KNC Miners - auto restart script  (Read 2319 times)
DPoS (OP)
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250



View Profile
October 14, 2013, 04:29:47 PM
 #1

A few of us have noticed that .93 will restart cgminer a fair bit when performance dips and enjoyed the better overall avg hashing
Since the other firmwares seem to not care and since there is no crontab installed....I wrote a simple shell script to auto-restart every X seconds

Place it in your /bin dir so not to care about paths, and keep a copy in your /config dir since reboots of the miner will overwrite a lot of files

I named mine tripminer.sh


#!/bin/sh
while true
do
       sh /etc/init.d/cgminer.sh restart
       sleep 9200
done


9200 seconds is about 2 1/2 hours. Change it to whatever you like.

if this helps you, a few bits in the tipjar would be nice    1Ki3sFg6bCasB6tkuMW41DCCpGFDgDHVgL



~~BTC~~GAMBIT~~BTC~~Play Boardgames for Bitcoins!!~~BTC~~GAMBIT~~BTC~~ Something I say help? Donate BTC! 1KN1K1xStzsgfYxdArSX4PEjFfcLEuYhid
1715437064
Hero Member
*
Offline Offline

Posts: 1715437064

View Profile Personal Message (Offline)

Ignore
1715437064
Reply with quote  #2

1715437064
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715437064
Hero Member
*
Offline Offline

Posts: 1715437064

View Profile Personal Message (Offline)

Ignore
1715437064
Reply with quote  #2

1715437064
Report to moderator
1715437064
Hero Member
*
Offline Offline

Posts: 1715437064

View Profile Personal Message (Offline)

Ignore
1715437064
Reply with quote  #2

1715437064
Report to moderator
1715437064
Hero Member
*
Offline Offline

Posts: 1715437064

View Profile Personal Message (Offline)

Ignore
1715437064
Reply with quote  #2

1715437064
Report to moderator
btc_uzr
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250


let's have some fun


View Profile
October 14, 2013, 04:59:46 PM
 #2

restart only in case of a crash

Code:
#!/bin/sh
while true
do
       if [ "$(pidof cgminer)" == "" ]
       then
           sh /etc/init.d/cgminer.sh restart
       fi
       sleep 10;
done


frequent restart as well as restart in case of a crash

Code:
#!/bin/sh
time=0;
restartIntervall=100; #seconds
while true
do
       if [ "$(pidof cgminer)" == "" ] || [ $(($time - $restartIntervall)) -eq 0 ]
       then
           sh /etc/init.d/cgminer.sh restart
           time=0;
       fi
       sleep 10;
       time=$(($time+10));
done

-both untested-

..and Thou shalt spread the coin in the name of cryptography for eternity
DPoS (OP)
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250



View Profile
October 14, 2013, 05:34:02 PM
 #3

nice,

I think the best way to mimic .93 would be to monitor your pool's reading of Gh and have it restart after the avg stays below a certain limit for 3 or 5 checks in a row
Or perhaps watch cgminer's Gh and HW errors & WU and make up a suitable floor for doing the same

I know Kano has a calculation that takes all this and gives an estimate of what 'paid hashing' your miner is really doing

I am currently gaining about 40Gh more on avg just by restarting every 2 1/2 hours.. of course if a miner doesn't have issues recovering cores on its own this isn't needed

~~BTC~~GAMBIT~~BTC~~Play Boardgames for Bitcoins!!~~BTC~~GAMBIT~~BTC~~ Something I say help? Donate BTC! 1KN1K1xStzsgfYxdArSX4PEjFfcLEuYhid
mininganon
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
October 15, 2013, 11:20:14 PM
 #4

BUMP, this got lost in the mix there.

I'll try to play with this a bit and let you know.
mininganon
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
October 16, 2013, 02:16:28 AM
 #5

Just restarting CGminer every so often is not bringing it back to life, it quickly loses ghs after 30min and disturbs so many cores it doesn't help. I need an auto reboot mechanism. What I need is a similar script in the init startup to reboot every 2 hours.

If anyone has suggestions
mininganon
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
October 16, 2013, 03:56:34 AM
 #6

I ran your 1st script btc_uzr got this
sh cgrestart.sh
cgrestart.sh: line 9: syntax error: unexpected "done" (expecting "then")
[1]+  Done(127)                  bash cgrestart.sh
mininganon
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
October 16, 2013, 11:15:17 AM
 #7

I have a $5 tip for someone who gives me working script to reboot my jupiter every so many hours. Obviously it has to be run at startup and survive reboot. I have it on .91 with the reboot mod added.  Thanks

It would be a bonus if it could detect ghs drop for x seconds then reboot as well.
DPoS (OP)
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250



View Profile
October 16, 2013, 04:44:09 PM
 #8

I have a $5 tip for someone who gives me working script to reboot my jupiter every so many hours. Obviously it has to be run at startup and survive reboot. I have it on .91 with the reboot mod added.  Thanks

It would be a bonus if it could detect ghs drop for x seconds then reboot as well.

you'd be better off running the reboot.cgi URL web command from a remote computer on a looped script for that.

and since it would be driven from a remote machine, it would be possible to read the value off your pool's page and then do some type of stop limit type trigger for it

I'm not much of a web coder but I've seen stuff like this in action.  probably not hard for those into that

~~BTC~~GAMBIT~~BTC~~Play Boardgames for Bitcoins!!~~BTC~~GAMBIT~~BTC~~ Something I say help? Donate BTC! 1KN1K1xStzsgfYxdArSX4PEjFfcLEuYhid
btc_uzr
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250


let's have some fun


View Profile
October 16, 2013, 09:24:36 PM
 #9

I ran your 1st script btc_uzr got this
sh cgrestart.sh
cgrestart.sh: line 9: syntax error: unexpected "done" (expecting "then")
[1]+  Done(127)                  bash cgrestart.sh

I assume you ran it on your desktop pc or similar, since the script executes fine on my KnCMiner; tested a min ago

On KnC devices there's no bash but sh.
/bin/sh -> /bin/busybox

and for example Ubuntu links it to dash
/bin/sh -> dash





..and Thou shalt spread the coin in the name of cryptography for eternity
btc_uzr
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250


let's have some fun


View Profile
October 16, 2013, 09:43:57 PM
 #10

I have a $5 tip for someone who gives me working script to reboot my jupiter every so many hours. Obviously it has to be run at startup and survive reboot. I have it on .91 with the reboot mod added.  Thanks

It would be a bonus if it could detect ghs drop for x seconds then reboot as well.

you'd be better off running the reboot.cgi URL web command from a remote computer on a looped script for that.

and since it would be driven from a remote machine, it would be possible to read the value off your pool's page and then do some type of stop limit type trigger for it

I'm not much of a web coder but I've seen stuff like this in action.  probably not hard for those into that

Good idea.

btw:
there's a nice tool/firefox plugin used for web-testing you can use with nearly zero knowledge about programming.
for reloading the status page and clicking the restart-btn in case of crash, this will do the job for you I guess
Not sure about checking a value on one page and trigger an action based on it on another webpage (check pool restart miner).
http://docs.seleniumhq.org/projects/ide/

..and Thou shalt spread the coin in the name of cryptography for eternity
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!