Skip to content

awitwicki/MMM-BME280

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MMM-BME280

This is an extension for the MagicMirror². It monitors temperature, humidity and air pressure from BME-280 sensor.

Installation

  1. Navigate into your MagicMirror's modules folder
  2. Clone repository git clone https://github.com/awitwicki/MMM-BME280
  3. Go to newly created directory (cd MMM-BME280)
  4. Execute npm install to install the node dependencies.
  5. Connect the BME280 to your Raspberry Pi

Using the module

Add it to the modules array in the config/config.js file:

modules: [
	...
	{
		module: 'MMM-BME280',
		position: 'top_left',
		config: {
			updateInterval: 5 //seconds
			}
	},
	...
]

Configuration options

Configurations properties

Property Description
titleText Widget title text
Type: string
Default: Home weather
updateInterval Wait interval between readings of BME280 sensor values in seconds
Type: int
Default: 100
deviceAddress BME280 I2C address, default is 0x76
Type: hex string
Default: "0x76"
temperatureScaleType Different temperature scales
Type: int
Default: 0
Scale types: 0 Celsius, 1 Fahrenheit
pressureScaleType Different pressure scales
Type: int
Default: 0
Scale types: 0 hPa, 1 inHg

Developer Notes

For more details about BCM pin numbers check here

Dependencies

  • python3 (should be installed on Raspberry Pi)
  • smbus (Python library, install via pip3 install smbus )

Test BME280 module

  1. Navigate into your MagicMirror/modules/MMM-BME280 folder
  2. Run script python3 bme280.py <"optional I2C address">
    • If you get FileNotFoundError: [Errno 2] No such file or directory you habe to enable i2c interface (raspi-config nonint do_i2c 0)
    • If script prints OSError: [Errno 121] Remote I/O error then you are using wrong I2C address. Try to run i2cdetect -y 1 console command to find out your device address.
  3. Script should print sensor values like this 24.7 38.3 996.6 - that means temperature humidity pressure
    • If you only see 0 0 0 make sure you are not setting the PINs you are using in another program.

Thanks

MMM-DHT-Sensor module

Using the BME280 I2C Temperature and Pressure Sensor in Python