Unable to set configurations with bme688?

I am trying to use the bme688 with the pi pico. The sensor is reading some of the data wrong therefore I want to calibrate some of the settings. I am refering to the funciton reference on github but the code does not seem to recognize the “bme.configure” line:

from breakout_bme68x import BreakoutBME68X
import breakout_bme68x
from pimoroni_i2c import PimoroniI2C
import time


PINS_PICO_TUFTY = {"sda": 4, "scl": 5}

i2c = PimoroniI2C(**PINS_PICO_TUFTY)
bme = BreakoutBME68X(i2c)


while True:
    temperature, pressure, humidity, gas_resistance, status, gas_index, meas_index = bme.read()
    bme.configure()
    print (temperature)
    time.sleep(0.2)
  File "<stdin>", line 15, in <module>
AttributeError: 'BreakoutBME68X' object has no attribute 'configure'
>>>

reference: pimoroni-pico/micropython/examples/breakout_bme68x at main · pimoroni/pimoroni-pico · GitHub

Try importing like this instead

from breakout_bme68x import *

You probably need an updated version of the firmware. There was a fix for the configure()-method in January. At least in the repos. Don’t know if it is already baked in.

I’m not sure if it helps but this what i use for a BME280 on my Tufty

from breakout_bme280 import BreakoutBME280
from pimoroni_i2c import PimoroniI2C
i2c = PimoroniI2C(sda=(4), scl=(5))
bme = BreakoutBME280(i2c)

I don’t think you need that second import statement.
import breakout_bme68x

pimoroni-pico/bme68x_demo.py at main · pimoroni/pimoroni-pico (github.com)

I see this in the what’s changed for 1.19.12. Should also be in the latest 1.19.14 release.

Fix BME68x configure function by @helgibbons

1 Like

Yep, I fixed this one a while back so if you grab a newish release configure should (hopefully) behave itself :)