The Python Script to send BME280 data to Ambient.
- Raspbian
- Python 3
- Python Library: smbus2
- Python Library: RPi.bme280
- AmbientDataInc/ambient-python-lib
$ cd ~/ambient_device
(py36) $ python ambient_device.py
-
Clone this project
$ cd ~ $ git clone https://github.com/KeitetsuWorks/ambient_device.git $ cd ambient_device
-
Install dependent libraries
$ pyenv virtualenv 3.6.6 py36 (py36) $ pyenv local py36 (py36) $ pip install smbus2 (py36) $ pip install RPi.bme280 (py36) $ pip install git+https://github.com/AmbientDataInc/ambient-python-lib.git
-
Make the configuration file,
ambient.json
(py36) $ vi ambient.json
Please write your channel ID and your write key in JSON format.
{ "ambient": { "channelId": "your_channel_id", "writeKey": "your_write_key" } }
-
(Optional) Edit cron for periodic execution
$ crontab -e
ambient_device.sh
is shell script to runambient_device.py
using pyenv environment from crond.2-57/5 * * * * cd ~/ambient_device; ./ambient_device.sh
- MIT