Skip to content

FruitOS application for reading BME280 sensor data and publishing it as HTTP GET response

License

Notifications You must be signed in to change notification settings

fruit-testbed/bme280-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Fruit Application for BME280

This FruitOS application reads a BME280 environment sensor through I2C, and returns the sensor data in JSON as a response of HTTP GET request.

Requirements

  • Raspberry Pi 1, 2 or 3
  • BME280 sensor, connected to Raspberry Pi's I2C GPIO
  • FruitOS
  • (optional) fruit-cli

To run through console:

docker run --device /dev/i2c-1 -p 8000:80 -ti herry13/fruit-bme280

The above assumes that the I2C device-tree and kernel module have been loaded, and the BME280 sensor is connected to I2C port 1 (0x76).

To run through fruit-cli:

fruit-cli run-container --node mynode -p 8000:80 \
    --kernel-module i2c-dev --device-tree i2c_arm=on --device /dev/i2c-1 \
    bme280 herry13/fruit-bme280

To deploy the container, fruit-cli is using fruit-agent, which ensures that the I2C device-tree (i2c_arm) and kernel module (i2c-dev) have been loaded before starting the container. This works under condition that the BME280 sensor is connected to I2C port 1 (0x76).

See LICENSE.

About

FruitOS application for reading BME280 sensor data and publishing it as HTTP GET response

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages