So....long story short, I have a total of Eighteen S3+ Antminers that are in a building that for most of the time is not used. Every once in a while, however, it is used, so I want to be able to easily drop the fan noise down via a scripted approach. I have Teamviewer access to a live system there and I've used Putty to SSH into individual miners to change frequency on individual units. What would be a good scripted approach to change them en masses from say 250M to 212.5M and back? Sequential IPs and all same username/PW...
Thanks in advance!
I would setup a script on each one and then modify the web interfaces adding another page like 192.168.1.99/slowdown and 192.168.99/speedup that runt he scripts
then you could just do it all over port 80 via lynx.
assuming you know how to code etc...
web interfaces root is /www by the way...
Well, I used to program my TRS-80 many years ago and do some work in PowerShell automation, but I wouldn't say I'm proficient at all. Was hoping there was a fairly easy way to automate, but I can research what you noted above, thanks!
basically you need 2 copies of /etc/config/asic-freq one with the higher frequency and one with the lower frequency. and of course in the script copying one over the other and issuing a /etc/init.d/cgminer restart command. or maybe a /etc/init.d/cgminer stop slight wait then /etc/init.d/cgminer start. as I have observed the restart command sometimes does not restart cgminer
the hardest part is most likely getting html or cgi script to run the script, but im sure if u looked over the cgi of how the web client issues the reboot command that code could be copied and modified to run your script
actually after looking at it, it is simpler than i thought...
just put your script in /www/cgi-bin
low.sh
#!/bin/sh -f
----script code here---
echo "Content-type: text/html"
echo ""
echo "<HTML>"
echo "<img src=../luci-static/resources/icons/antminer_logo.png>"
echo "<h1>low executed</h1>"
echo "</HTML>"
dont forget chmod 777 low.sh
execute that with
http://antminersiphere/cgi-bin/low.shand it will execute that script.
then do the same for adjusting back to hi hi.sh
then if using windows or unix you can just install lynx and run a batch file that executes the 19 lynx url requests to each miner
Thanks for the detailed response...this may be beyond my current coding abilities but I've been meaning to learn this stuff more so I may take it on as a challenge anyway. I'll post if I can get it working...
Well it is pretty much complete cept for the script here which would be this
cp /etc/config/asic-freq.low /etc/config/asic-freq
/etc/init.d/cgminer stop
wait
/etc/init.d/cgminer start
so low.sh would be
low.sh
#!/bin/sh -f
cp /etc/config/asic-freq.low /etc/config/asic-freq
/etc/init.d/cgminer stop
wait
/etc/init.d/cgminer start
echo "Content-type: text/html"
echo ""
echo "<HTML>"
echo "<img src=../luci-static/resources/icons/antminer_logo.png>"
echo "<h1>low executed</h1>"
echo "</HTML>"
hi.sh would be
#!/bin/sh -f
cp /etc/config/asic-freq.hi /etc/config/asic-freq
/etc/init.d/cgminer stop
wait
/etc/init.d/cgminer start
echo "Content-type: text/html"
echo ""
echo "<HTML>"
echo "<img src=../luci-static/resources/icons/antminer_logo.png>"
echo "<h1>hi executed</h1>"
echo "</HTML>"
and of course before this you would edit /etc/config/asic-freq to use the overclocked values then cp asic-freq to asic-freq.hi. then modify it for the lower ones and cp asic-freq asic-freq.low
this all wont work on the newer firmware though because they changed how the frequencies are changed. it is in the gui interface. but I bet there is an easy way to modify it too.
I just threw the antminer logo in there for the hell of it.
then I guess u can run a batch file that executes
lynx -dump
http://antminerup/cgi-bin/low.sh > null
Wow, thanks! You have a good point about the newer firmware...since these are S3+ units I'm on the latest rev, which doesn't respect the settings in the asic-freq file. Does anyone know a way to change frequency in the latest firmware without using the GUI?
I would think modifying the DEFAULT line on this file. I dont have any with the newer firmware but its an easy thing it looks too
/usr/lib/lua/luci/model/cbi/cgminer/cgminer.lua
that has the frequencies that are available via the user interface ( I am just guessing changing that will do it, I cant test it )
conf:tab("advanced", translate("Advanced Settings"))
pb = conf:taboption("advanced", ListValue, "freq", translate("Frequency"))
pb.default = "18:218.75:1106"
pb:value("16:250:0982", translate("250M"))
pb:value("17:243.75:1306", translate("243.75M"))
pb:value("17:237.5:1286", translate("237.5M"))
pb:value("17:231.25:1206", translate("231.25M"))
pb:value("18:225:0882", translate("225M (S3+ default)"))
pb:value("18:218.75:1106", translate("218.75M (S3 default)"))
pb:value("18:212.5:1086", translate("212.5M"))
pb:value("19:206.25:1006", translate("206.25M"))
pb:value("20:200:0782", translate("200M"))
pb:value("20:196:1f07", translate("196M"))
pb:value("20:193:0f03", translate("193M"))
pb:value("23:175:0d83", translate("175M"))
pb:value("27:150:0b83", translate("150M"))
pb:value("33:125:0983", translate("125M"))
pb:value("40:100:0783", translate("100M"))
edit /usr/lib/lua/luci/model/cbi/cgminer/cgminer.lua change default to hi value save it out
cp /usr/lib/lua/luci/model/cbi/cgminer/cgminer.lua /usr/lib/lua/luci/model/cbi/cgminer/cgminer.lua.hi
do same for low
cp /usr/lib/lua/luci/model/cbi/cgminer/cgminer.lua /usr/lib/lua/luci/model/cbi/cgminer/cgminer.lua.low
then change the line
cp /etc/config/asic-freq.hi /etc/config/asic-freq
to
cp /usr/lib/lua/luci/model/cbi/cgminer/cgminer.lua.hi /usr/lib/lua/luci/model/cbi/cgminer/cgminer.lua
and the low one too
cp /usr/lib/lua/luci/model/cbi/cgminer/cgminer.lua.low /usr/lib/lua/luci/model/cbi/cgminer/cgminer.lua