Skip to content

logging and visualizing temperature, humidity, pressure powered by the BME280, Sinatra, Vue and chart.js

License

Notifications You must be signed in to change notification settings

lukasjapan/bme280-web

Repository files navigation

BME280 - Web

Build Status Coverage Status

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)

BME280

Installation

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

Raspberry Pi

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)

Development

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

Production

# 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)

TODO

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.

About

logging and visualizing temperature, humidity, pressure powered by the BME280, Sinatra, Vue and chart.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages