O'Reilly logo

Raspberry Pi Home Automation with Arduino by Andrew K. Dennis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing our Arduino shield with our database

Now that we have a way to write data to our database, we can now start taking and storing readings from our Raspberry Pi to Arduino hardware.

From the command line, run the thermostat application located in the arduPi directory. Once this is running, the shield will start to take temperature readings.

In turn, the Arduino code references the Python script we have just written and will start to send the temperature data to it for the room you associated with the ID 1.

Note

Make sure that both Apache and the HTSQL server are running!

The Python script will then generate a connection to the SQLite database and execute the query inserting the temperature data, timestamp, and the room ID.

We can test that our ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required