Comments (2)
Hi there,
Started playing with bme280 - I can't initialise it correctly on my RPI + Breakout Garden + BME280 (and a few others breakout)
#!/usr/bin/env python3 # std lib imports import os import logging import argparse import sys import time # extra imports try: from smbus2 import SMBus except ImportError: from smbus import SMBus from bme280 import BME280 # Set logs logger = logging.getLogger('bme280') logger.setLevel(logging.INFO) # Log format formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') # Console Handler ch = logging.StreamHandler() ch.setLevel(logging.INFO) ch.setFormatter(formatter) logger.addHandler(ch) def temperature(): # Initialise the BME280 bus = SMBus(1) bme280 = BME280(i2c_dev=bus) temperature = bme280.get_temperature() pressure = bme280.get_pressure() humidity = bme280.get_humidity() print('{:05.2f}*C {:05.2f}hPa {:05.2f}%'.format(temperature, pressure, humidity)) time.sleep(1) def main(): """ parser = argparse.ArgumentParser() parser.add_argument('--url', default="http://localhost", help="url") args = parser.parse_args() """ temperature() if __name__ == "__main__": main()Leads to:
Traceback (most recent call last): File "/home/pi/airborne/airborne/environment.py", line 52, in <module> main() File "/home/pi/airborne/airborne/environment.py", line 49, in main temperature() File "/home/pi/airborne/airborne/environment.py", line 36, in temperature temperature = bme280.get_temperature() File "/home/pi/.local/lib/python3.9/site-packages/bme280/__init__.py", line 264, in get_temperature self.update_sensor() File "/home/pi/.local/lib/python3.9/site-packages/bme280/__init__.py", line 250, in update_sensor self.setup() File "/home/pi/.local/lib/python3.9/site-packages/bme280/__init__.py", line 228, in setup raise RuntimeError("Unable to find bme280 on 0x{:02x}, CHIP_ID returned {:02x}".format(self._i2c_addr, chip.id)) RuntimeError: Unable to find bme280 on 0x76, CHIP_ID returned 58
whereas it's on 0X76:
i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- 10: 10 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- 38 -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- 76 --
Any changes on the chip that should be updated in the lib ?
Thanks
hello, did you solve this problem I'm facing the same thing, Thanks
from bme280-python.
Chip ID 0x58
is for a BMP280 not a BME280, this library is not compatible with that device.
You'll need: https://github.com/pimoroni/bmp280-python
from bme280-python.
Related Issues (19)
- test.py example is broken HOT 3
- Correct links on PyPi from https://pypi.org/project/pimoroni-bme280/ HOT 2
- ImportError: No module named bme280 when running all-values.py HOT 10
- bme280 HOT 1
- Breakout board BME280 HOT 2
- Double call of update_sensor() when getting altitude HOT 2
- Should setup() be called on each update? HOT 1
- ValueError: Invalid format specifier when running allvalues.py HOT 1
- ROCK 4 C+
- Binho Nova adapter instructions
- Raspberry Pi hangs in forced mode HOT 5
- ImportError HOT 11
- Add temperature offset function HOT 2
- bug in install.sh script - closing square bracket on line 64
- No module named bme280 HOT 1
- install.sh error HOT 2
- Remind user to turn on I2C if using raspi HOT 2
- Syntax error in local_altitude.py example HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bme280-python.