Temperature, Humidity and Air pressure logging/visualization with the Bosch BME280 sensor. The frontend is reactive and does live updates.
The following libraries are used:
- Sinatra (Minimalistic Ruby framework)
- Vue.js (Frontend reactive framework)
- Element (GUI element library for Vue.js)
- Chart.js (Graphs in an HTML5 canvas)
The BME280 must be connected via the I2C interface.
On default, the device it is expected to be available at /dev/i2c-1
. (for details refer to the BME280 ruby driver)
git clone git@github.com:lukasjapan/bme280-web.git
cd bme280-web/
bundle install
yarn install
Make sure you have a new version of Ruby available. Install rbenv or similar if needed.
Check the I2C Pin layout. (BCM mode works well for me)
I recommend to develop on a desktop machine. The BME280 hardware does not need to be available in development mode.
# Initialize DB schema
bundle exec rake db:migrate
# Webpack development server for on-the-fly js updates
./bin/webpack-dev-server
# Start the logger - in development mode random data is inserted into the database
./bin/bme280-logger
# Start the web frontend
./bin/bme280-web
Default URL: http://localhost:4567
# Initialize DB schema
RACK_ENV=production bundle exec rake db:migrate
# Compile minified js pack
yarn run build
# Start the logger - will be daemonized
RACK_ENV=production ./bin/bme280-logger
# Start the web frontend
RACK_ENV=production ./bin/bme280-web
Default URL: http://localhost:4567 (server listens on 0.0.0.0)
Aggregation of data. Currently, raw data will be pulled from the database in 1s steps, even for large time ranges. Averaged results should be used in that case.