[Rpi server] First launch

A project log for Home automation - Trinket Sensing

TJTJ 06/16/2015 at 12:150 Comments

I've installed the raspbian image on the sd card.

With Apache 2, PHPMyAdmin, MySQL (,

The database trinket_sensing now contains the temperature table:

In my case the RPI IP address is (local address)

With the script below (insertTemp.php) I can add a value.

$servername = "localhost";
$username = "root";
$password = "password";
$dbname = "trinket_sensing";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);

$sql = "INSERT INTO temperature (id, ts, value) VALUES (NULL, CURRENT_TIMESTAMP, '".$_GET['temp']."')";

if ($conn->query($sql) === TRUE) {
    echo "New record created successfully";
} else {
    echo "Error: " . $sql . "<br>" . $conn->error;


I now have a working database test link. I will add all others later.