Heres how you use the make-shift stat collector with the tools currently available, please note that this is a work in progress. But asfar as I can see it works:
ssh in to your bitfury-pi
make a folder /home/pi/logs
in the folder: nano logger.sh
paste the following code in, modify the board count and desired data collection time and save the file.
#!/bin/bash
# Bitfury chainminer logfile consolidation script
# Jlsminingcorp and Isokivi, September 2013
# Version 1.3
# User configurable variables
# $logfile is the path to the bitfury chainminer log file
# $output is the path to the board-data output file that you would like to write to
# $outputdir is the directory to store output in
# $logtime is the time (in minutes) to collect data for
# $numboards is the number of H-boards your the miner
logfile="/run/shm/.stat.log"
output="./boards.log"
outputdir="."
logtime="20"
numboards="2"
# Timestamps
datestamp=$(ls --full-time "$logfile" | awk '{print $6}')
timestamp=$(ls --full-time "$logfile" | awk '{print $7}' | awk -F"." '{print $1}')
# If log file or output files don't exist then take appropriate action
if [ ! -e "$logfile" ]; then
echo "$(date)"" : ""Logfile does not exist in the specified location"
echo "$(date)"" : ""Logfile does not exist in the specified location" >> "$output"
exit 1
fi
if [ ! -e "$output" ]; then
echo "Date,Time,Board Position,Speed,Noncerate [GH/s],Hashrate [GH/s],Good,Errors,SPI-Errors,Miso-Errors" > "$output"
fi
for (( i=1; i<="$numboards"; i++)); do
chipout="$outputdir""/chips_board_""$i"
if [ ! -e "$chipout" ]; then
echo "Chip stats for board: ""$i" > "$chipout"
echo "Date,Time,Chip,ProgParams,Speed,Noncerate,Hashrate,Nonces/round,False nonce,SPIerr,MISOerr,Jobs/5min (hash rate),ChipID,CoresOK" >> "$chipout"
fi
done
echo "Starting to log data"
echo "Time to collect data for: ""$logtime"" minutes"
# During the data collection period (set by $logtime) parse data from the logfile to the output files
let countdown="$logtime"*"60"
while [ "$countdown" -ge "0" ]; do
# If timestamp in the log file is the same as the timestamp on the last entry in the output file then sleep for a while
# Should make sure that we're somewhere in the middle of the 5 minute chainminer logging period
# Could use "while" here, but risk getting stuck in a never-ending loop if log file is not being updated
prevtimestamp=$(tail -n 1 "$output" | awk -F"," '{print $2}')
if [ "$timestamp" == "$prevtimestamp" ]; then
echo "Chainminer log file not yet updated. Will now sleep for a short while."
echo "Chainminer log file not yet updated. Will now sleep for a short while." >> "$output"
sleep 60
timestamp=$(ls --full-time "$logfile" | awk '{print $7}' | awk -F"." '{print $1}')
fi
# Strip board data out of the chainminer log file and copy to the output file
IFS=$'\r\n' datalines=($(grep -A "$numboards" record "$logfile" | tail -n "$numboards" ))
for i in "${datalines[@]}"; do
echo -ne "$datestamp","$timestamp", >> "$output"
echo "$i" | tr ":" " " | awk '{$1=$1}1' OFS="," >> "$output"
done
# Strip chip data out of the chainminer log file and copy to chip output files (one for each H-board)
for (( i=1; i<="$numboards"; i++)); do
chipout="$outputdir""/chips_board_""$i"
let startline="$i"*"16"-"15"
let endline="$i"*"16"
while read line; do
echo -ne "$datestamp","$timestamp", >> "$chipout"
echo "$line" | awk '{for (i=1; i<=12; i++) printf("%s%s", $(i), i<12 ? OFS="," : "\n"); }' >> "$chipout"
done < <(awk 'NR==v1,NR==v2' v1="${startline}" v2="${endline}" "$logfile")
done
echo "Time remaining: ""$countdown"" seconds"
if [ "$countdown" -gt "0" ]; then
sleep 300
fi
let countdown="$countdown"-"300"
timestamp=$(ls --full-time "$logfile" | awk '{print $7}' | awk -F"." '{print $1}')
done
echo "Finished logging data"
exit 0
chmod +x logger.sh
./logger.sh
Once it has finished: less chips_board_1
Copy the contents and paste it to
http://anduck.net/bfsb/#Press go.
Repeat above three for the next board.
Enjoy!
If you feel like tipping the people who contributed jlsminingcorp (the script) 1JNeDQsT6Jh9XGqhcQPHZkpKzA9YASvNTT and Anduck (the web-app) 1Anduck6bsXBXH7fPHzePJSXdC9AEsRmt4 are the proper recipients.