Simple NodeJS server and SQLite3 logger for the DS18B20 digital temperature sensor on the Raspberry Pi.
- load_gpio.sh - bash commands to load kernel modules
- server.js - NodeJS server, returns temperature as JSON, logs to database and serves other static files
- temperature_plot.htm - example client front-end showing live temperatures
- temperature_log.htm - example client front-end showing time-series from database records
- build_database.sh - shell script to create database schema
- sample_database.db - example database with real world data from the Pi recorded in UK Jan-Feb 2013
npm installin this directory
load_gpio.shscript as root to load kernel modules for the sensor
- Run the
build_database.shscript to create "piTemps.db". Note this wil drop any existing database of the same name in the directory
- Open "server.js" and edit line 35 to read the serial number of your sensor in /sys/bus.
- In a terminal run "node server.js" to start the server.
- Open a web browser on the Pi and go to http://localhost:8000/temperature_plot.htm to see a plot of current temperature. Go to http://localhost:8000/temperature_log.htm to see a plot of logged temperature.