Skip to content

Logs 60 sec median values of temperature and pressure (time shift consistent) to log file. Tested on an OrangePi One.

License

Notifications You must be signed in to change notification settings

kriete/bmp280_median_logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BMP280 Median Logger

This python package logs data from the I2C connected Bosch BMP280. It runs read and write threads in daemon mode. The read-and-write processes are indepent of time-shifting. The package is configured as follows:

  • send a read-command of temperature and pressure every second to BMP280 for 60 seconds
  • take the median value and store it into the specified file

Since the child-threads are daemons, they will terminate itself when the parent thread is killed. See example usage.

OrangePi setup with BMP280:

Installation

Requirements

This package requires numpy and pandas to run. Besides, it uses the Adafruit BMP280 python library (originating from https://github.com/bastienwirtz/Adafruit_Python_BMP). This file is included in the package. However, this module uses the Adafruit Python GPIO https://github.com/adafruit/Adafruit_Python_GPIO. To install it: clone the Adafruit Python GPIO repository and install it with:

$ git clone https://github.com/adafruit/Adafruit_Python_GPIO.git
$ cd Adafruit_Python_GPIO
$ sudo python setup.py install
BMP280 Logger

Navigate to the median logger directory and run the pip install with the -e flag (or not - just useful in case of own changes to the package)

$ pip install -e .
Note on OrangePi

Beware, which SMBUS is used (check with i2cdetect). The OrangePi uses SMBUS(0) (not 1). This must be edited in the Adafruit Python GPIO library in the source I2C.py before compiling.

Example Run

To start the logging, just navigate to the main directory and start the main.py. It keeps the daemon threads running until the main thread gets killed by a kill command or a Keyboard Interuption (CTRL-C) applies.

$ python main.py

or specify the filename with

$ python main.py bmpdata.txt

Example Logfile:

CSV 1-minute logfile:

About

Logs 60 sec median values of temperature and pressure (time shift consistent) to log file. Tested on an OrangePi One.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages