kmitz / Regul

Bash Script for Antminer S5 Temperature Regulation
https://jomcflyatwork.wordpress.com/2015/07/13/shell-script-for-antminer-s5-temperature-regulation/
8 stars 14 forks source link

Unbounded frequency regulation #4

Open kmitz opened 8 years ago

kmitz commented 8 years ago

'newFreq' value can be incorrect when downclocking below 100MHz or when overclocking above 500MHz.

The issue is caused by these two lines: newFreq=$(cat freqList | grep -A "$FREQ_STEP" "$freq:" | tail -n 1) newFreq=$(cat freqList | grep -B "$FREQ_STEP" "$freq:" | head -n 1)

newFreq values shall be limited to the valid frequencies contained in Freqlist file.

I don't have my Antminer anymore so I won't issue the fix myself.

davidshumway commented 8 years ago

Yes. Noticed this before... This has worked thus far (has not been extensively tested). For min: if [ $maxtemp -gt $TMAX ] && [ $freq'' != "100" ] For max: elif [ $maxtemp -lt $TMIN ] && [ $freq'' != "500" ]

kmitz commented 8 years ago

Actually I just noticed that grep -B (resp. grep -A) will return the first (resp. last) line of freqList when looking for "out of boundaries" values.

For instance: *input: FREQ_STEP=4; freq=100; newFreq=$(cat freqList | grep -A "$FREQ_STEP" "$freq:" | tail -n 1); echo $newFreq;

*output: 10 : 100 : 0783

It seems that the issue was (unintentionally) already taken care of! What do you think about it?

davidshumway commented 8 years ago

Looks correct. But won't it restart cgminer unnecessarily at this point?

kmitz commented 8 years ago

That's right, I missed that point.