pimoroni / bme680-python

Python library for the BME680 gas, temperature, humidity and pressure sensor.
https://shop.pimoroni.com/products/bme680
MIT License
260 stars 93 forks source link

chip id issue with BME680 Breakout #22

Closed StefanKreiling closed 4 years ago

StefanKreiling commented 5 years ago

Hello I'll try to get a BME680 running on breakout garden with raspberry pi 3b+ and constantly receive Traceback (most recent call last): File "temp-offset.py", line 7, in sensor = bme680.BME680() File "build/bdist.linux-armv7l/egg/bme680/init.py", line 47, in init RuntimeError: BME680 Not Found. Invalid CHIP ID: 0x00 I assume BME680 CHIPP ID should be 0x61? Is there a way to fix this? Many thanks!

Gadgetoid commented 5 years ago

It looks like you're running into IO errors for some reason- is the BME680 plugged directly into Breakout Garden, what other sensors do you have connected, and do you have an entry for i2c baudrate in your /boot/config.txt?

StefanKreiling commented 5 years ago

thanks for answering. no there is no setting for i2c baudrate. I added 40000. Tried to get a bmp280 running on breakout garden with a similar result: ~/breakout-garden-master/bmp280-python/examples $ python2 dump-calibration.py Traceback (most recent call last): File "dump-calibration.py", line 10, in bmp280.setup() File "/usr/local/lib/python2.7/dist-packages/bmp280/init.py", line 146, in setup raise RuntimeError("Unable to find bmp280 on 0x{:02x}, CHIP_ID returned {:02x}".format(self._i2c_addr, self._bmp280.CHIP_ID.get_id())) RuntimeError: Unable to find bmp280 on 0x76, CHIP_ID returned 00 Moreover, the oled I planned to use doesn't work, too - getting a dotted line. Any idea much appreciated. Many thanks

GeCr1988 commented 5 years ago

@StefanKreiling you can try to use the secondary address of the BME680 which is 0x77. It worked for me. But just to be sure if the device is connected properly you can write in the REPL the following command.

>>> from machine import I2C
>>> i2c = I2C(0, I2C.MASTER,pins=('P22','P21'), baudrate=100000)
>>> i2c.scan()
[8, 16, 30, 119]
>>>

The value 119 = 0x77. Hope this help you

The BME680 - CHIP_ID is 0x61 indeed … however I saw the the get_chip ID method returns the b'a'. If you compare b'a'[0] == 0x61 the result will be True.

StefanKreiling commented 5 years ago

solved. fresh installation of raspbian did help. Don't know what the issue was but must have been a software issue. The only difference was probably a) installation of python2 & 3 and b) double installation of BME680 (package with breakout garden & single install?) thanks for the help -