Glad people are getting it working, add these lines to /var/www/collectd/index.html above the line that reads “ day ]” to get one hour and six hour graphs
<a href="#" onclick="switchView('1h')"> hour ]</a>
<a href="#" onclick="switchView('6h')"> 6 hour ]</a>
The one hour graph is especially useful when making changes to your gain settings. You will see results in 10 minutes or less.
To get (almost) immediate results, run
cd /home/pi/dump-tools/collectd
sudo make-graphs.sh 1h
sudo make-graphs.sh 6h
After you add the lines to index.html, add the following lines to root’s crontab (use ‘sudo crontab -e’)
*/5 * * * * sudo /home/pi/dump-tools/collectd/make-graphs.sh 1h >/dev/null
*/10 * * * * sudo /home/pi/dump-tools/collectd/make-graphs.sh 6h >/dev/null
To change from Metric to Imperial values, add these lines in /home/pi/dump-tools/collectd/make-graphs.sh
imperial_range_graph(){
rrdtool graph \
"$1" \
--start end-$4 \
--width 480 \
--height 200 \
--step "$5" \
--title "$3 max range" \
--vertical-label "Miles" \
--lower-limit 0 \
--units-exponent 0 \
"DEF:rangem=$2/dump1090_range-max_range.rrd:value:MAX" \
"CDEF:rangekm=rangem,1000,/" \
"CDEF:rangeml=rangekm,0.621371192,*" \
"LINE1:rangeml#0000FF:max range"
}
imperial_temp_graph() {
rrdtool graph \
"$1" \
--start end-$4 \
--width 480 \
--height 200 \
--step "$5" \
--title "Core Temperature" \
--vertical-label "Degrees Fahrenheit" \
--lower-limit 32 \
--upper-limit 212 \
--rigid \
--units-exponent 1 \
"DEF:traw=$2/gauge-cpu_temp.rrd:value:MAX" \
"CDEF:tta=traw,1000,/" \
"CDEF:ttb=tta,32,+" \
"CDEF:ttc=ttb,1.8,*" \
"AREA:ttc#ffcc00"
}
Commend out the metric_temp_graph and metric_range_graph lines near the bottom of the script (add a # at the beginning of the line) and add these lines
imperial_temp_graph /var/www/collectd/table-$2-core_temp-$4.png /var/lib/collectd/rrd/$1/table-$2 "$3" "$4" "$5"
imperial_range_graph /var/www/collectd/dump1090-$2-range-$4.png /var/lib/collectd/rrd/$1/dump1090-$2 "$3" "$4" "$5"
A “commented out” line will look like this
# metric_range_graph /var/www/collectd/dump1090-$2-range-$4.png /var/lib/collectd/rrd/$1/dump1090-$2 "$3" "$4" "$5"
I hope I answered all the questions and got the lines exactly right. I did a lot of copying and pasting. Let me know if these changes don’t work for you.