https://github.com/fruit-testbed/bme280-app
FruitOS application for reading BME280 sensor data and publishing it as HTTP GET response
https://github.com/fruit-testbed/bme280-app
bme280 fruitos raspberry-pi
Last synced: about 2 months ago
JSON representation
FruitOS application for reading BME280 sensor data and publishing it as HTTP GET response
- Host: GitHub
- URL: https://github.com/fruit-testbed/bme280-app
- Owner: fruit-testbed
- License: cc-by-sa-4.0
- Created: 2018-06-14T13:44:04.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-09-11T15:28:07.000Z (almost 7 years ago)
- Last Synced: 2025-05-21T20:45:27.523Z (about 1 year ago)
- Topics: bme280, fruitos, raspberry-pi
- Language: Python
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
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](https://github.com/fruit-testbed/fruitos)
- (optional) [fruit-cli](https://github.com/fruit-testbed/fruit-cli)
To **run through console**:
```shell
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**:
```shell
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](https://github.com/fruit-testbed/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](LICENSE.txt).