Include config.php in model.php.
Script now creates proper sql inserts. Also, measurement interval in script is 600 seconds.