richard-to
7/2/2014 - 11:45 PM

Quick and dirty script to generate fake sensor data for testing

Quick and dirty script to generate fake sensor data for testing

function r(min, max) {
    return Math.floor(Math.random() * (max - min + 1)) + min;
}

var type = 's';
var start_time = 1404313860;
var interval = 2;
var readings = 10;
for (var g = 0; g < 10; g++)
{
    var message = type + " " + start_time + " " + r(50, 180) + " " + r(18,23);
    for (var i = 1; i < readings; ++i)
    {
      start_time += (interval * 60);
      message += ";" + (interval * i) + " " + r(50, 180) + " " + r(18,23);
    }
    start_time += (4 * 60)
    console.log(message);
}