Post
Topic
Board Mining support
Re: Antminer S2 Support and Overclocking Thread
by
Hyacin75
on 06/08/2014, 16:17:05 UTC
I think I'm going to do some scripting on my GPU miner to monitor the S2 w/ Kano's firmware and when it resets to stock, put my config back on it and restart cgminer ...

Code:
#!/usr/bin/perl

use strict;

my $s2pooldata = `echo "pools|" | nc 192.168.1.99 4028`;
chomp($s2pooldata);

if ( $s2pooldata =~ /btcguild/ ) {
        system("sshpass -p 'admin' scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no s2-cgminer.conf root\@192.168.1.99:/config/cgminer.conf 2>/dev/null");
        system("sshpass -p 'admin' ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root\@192.168.1.99 /etc/init.d/cgminer.sh stop 2>/dev/null");
        sleep 5;
        system("sshpass -p 'admin' ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root\@192.168.1.99 /etc/init.d/cgminer.sh start 2>/dev/null");
}

Requires perl, obviously, sshpass which on ubuntu can be installed with "sudo apt-get install sshpass", and nc which on ubuntu can be installed with "sudo apt-get install netcat-openbsd" ...

Save it as whateveryoudlike.pl and add it to your crontab to run every minute or five minutes or whatever you'd like (chmod 755 after creating the file, obviously)

If you use btcguild in your config file, other things you can look for to see if it's flipped back to (Kano) stock are -

nezumikun.kant
167.160.36.2
juros_kant
stratum.ozco.in

And as you can see you have to have the desired s2 config file in the same directory as the script, and named s2-cgminer.conf ... it'd probably be wise to update that to use a full path ...

This is for stock clocks, just duplicate the scp line and update the file name to asic-freq.config if you want to copy over a custom clock file as well.  You can add another ssh line as well if desired to copy it from /config to /etc.