adafruit / Adafruit_CircuitPython_BME680

CircuitPython driver for BME680
MIT License
56 stars 39 forks source link

The GAS values is slow to update and is not accurate #12

Closed saraceni-andrea closed 4 years ago

saraceni-andrea commented 5 years ago

https://forums.adafruit.com/viewtopic.php?f=60&t=132231

[mod edit - removed key word highlighting from url]

caternuson commented 5 years ago

Probably related to #11

saraceni-andrea commented 5 years ago

Also on SPI no improvement ... :-( https://forums.adafruit.com/viewtopic.php?f=60&t=132231&p=736089&hilit=bme680#p736089

ladyada commented 5 years ago

not surprising, the SPI is still reading the same data. you could try to compare what the arduino or espruino is sending for commands and let us know if you see any differences in data?

markpatterson27 commented 4 years ago

Someone correct me if I'm wrong, but it looks like the gas heating duration isn't being set.

https://github.com/adafruit/Adafruit_CircuitPython_BME680/blob/f1b9e6c7539abdda5810ccdc70625981ddc2c5ec/adafruit_bme680.py#L107-L108

If I understand _write() correctly, the above is just writing [0x73, 0x64, 0x65] into incrementing registers 0x5A to 0x5C and not setting the heating duration. It should be changed to something like:

        _BME680_BME680_RES_HEAT_0 = const(0x5A)
        _BME680_BME680_GAS_WAIT_0 = const(0x64)

        self._write(_BME680_BME680_RES_HEAT_0, [0x73])   # approx 320 degrees
        self._write(_BME680_BME680_GAS_WAIT_0, [0x65])   # 148ms
saraceni-andrea commented 4 years ago

Hi, the latest update of adafruit_bme680.py (release 3.1.3) on CircuitPython 5.0 and Bundle 20200307 works perfectly!

Tested via i2c on:

THANK YOU VERY MUCH