51) { echo "channel must be between 2 and 51 (inclusive"; exit; } $nextstart = $start; $max = array (); while ($nextstart < $end) { if ($start < 1381561201) { // Oct 12 midnight -> switch to save in one file per day $in = fopen("rf_$c.json", "r"); if (!$in) { echo "no data"; exit; } $nextstart = $end; } else { $file = date("$c/Y/m/d.\j\s\o\\n", $nextstart); $in = @fopen($file, "r"); $nextstart = mktime(0,0,0, date("m", $nextstart), date("d", $nextstart) + 1, date("Y", $nextstart)); if (!$in) { continue; } } $line = 0; while (($buffer = fgets($in)) !== false) { ++$line; $x = json_decode($buffer, true); if (empty($x)) { echo "bad data on line $line"; error_log("chart: bad data line $line, rf_$c.json"); } if ($x['end'] < $start) { continue; } if ($x['end'] > $end) { break; } if ($x['streaminfo'] !== $laststreaminfo) { $laststreaminfo = $x['streaminfo']; $streamchanges[$x['start']] = $x['streaminfo']; } if (!empty($x['streaminfo2']) and $x['streaminfo2'] !== $laststreaminfo) { $laststreaminfo = $x['streaminfo2']; $streamchanges[$x['end']] = $x['streaminfo2']; } $dp = array($x['end']); $i = 0; foreach ($columns as $metric) { ++$i; // average the readings for the data point (30 readings for each sample) $dp[$i] = array_sum($x['data'][$metric]) / count($x['data'][$metric]); } // calculate the maximum for error columns, so we can squeeze into 0-100 range later foreach ($error_columns as $metric) { $point = $x['data'][$metric][count($x['data'][$metric]) - 1] - $x['data'][$metric][0]; ++$i; $dp[$i] = $point; if (!isset($max[$i]) || $point > $max[$i]) { $max[$i] = $point; } } $data[] = $dp; } } $strength = array_search('strength', $columns) + 1; $missed_packets = array_search('missed_packets', $error_columns) + count($columns) + 1; foreach ($max as $i => $m) { if ($m > 100) { if ($i == $missed_packets && $m > 1000) { $m = 1000; } foreach ($data as &$row) { $v = $row[$i] * 100.0 / $m; if ($v > 100) { $v = 100; } $row[$i] = array ('v' => $v, 'f' => "$row[$i]"); } } } foreach ($data as &$row) { // display signal strength into dBmV, instead of a percentage on mouseover $row[$strength] = array ('v' => $row[$strength], 'f' => (($row[$strength] - 100) * 3 / 5) . 'dBmV'); } $title = "Signal Data for RF $c (measured at toast0's garage)"; echo << $title

I'm moving out of the area the week of June 25th, 2018

I will leave this site as an archive, but the data will become stale. Check out Mike's broadcast monitors to replace some of the charts from here.

Instructions: Please wait for the graph to appear. To change to a different channel scroll down to "Change channel: Start:______ End:______" Click on the RF channel box and select the desired RF channel from the list. You can usually leave start and end blank, then click on the "change channel" button, and wait patiently. HEAD; echo ""; echo '

Graph loading... if nothing comes up, I messed up!
'; echo '

Change channel: '; if ($start) { echo 'Start: '; } else { echo 'Start: '; } if ($end < time()) { echo 'End: '; } else { echo 'End: '; } echo '

'; echo '

During the week of May 22nd, 2016, the antenna has been moved around a bit during roofing work.

'; echo "

Please check out Larry's Channel List for the SF Bay Area for more information about what's being broadcast.

"; echo ""; $streamchanges = array_reverse($streamchanges, true); foreach ($streamchanges as $start => $id) { echo ""; } echo "
TimeStreams
", strftime("%F %T %Z", $start), "", nl2br($id), "
"; echo "

Some more info on how the data is collected. Raw Data

"; echo <<< EOS EOS;