Help setting up bme280 sensor

I’ve been trying to setup a bme280 with no luck. My printer is running on a ski mini e3 v2, and I have my raspi 3 b+ setup as an additional mcu. I queried the bme280 by running a py script through ssh and it works fine. I have also confirmed bus, baud in /boot/config.txt.
I keep getting: MCU ‘rpi’ error during config: Unable to open i2c device

here’s my printer.cfg sensor declaration:

[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32f103xe_35FFD6054250373725821157-if00

[mcu rpi]
serial: /tmp/klipper_host_mcu

[temperature_sensor chamber_sensor]
sensor_type: BME280
i2c_address: 118
i2c_mcu: rpi
#i2c_bus: 1 ;get error here that bus 1 is unknown;
i2c_speed: 400000

test this:

[mcu host]
serial: /tmp/klipper_host_mcu

[temperature_sensor enclosure_temp]
sensor_type: BME280
i2c_address: 118
i2c_mcu: host
i2c_bus: i2c.1

[gcode_macro QUERY_BME280]
gcode:
    {% set sensor = printer["bme280 enclosure_temp"] %}
    {action_respond_info(
        "Temperature: %.2f C\n"
        "Pressure: %.2f hPa\n"
        "Humidity: %.2f%%" % (
            sensor.temperature,
            sensor.pressure,
            sensor.humidity))}```
3 Likes

may I ask what you have isntalled on the pi to get the i2c up and running?
I already turned it on inside the /boot/config.txt

1 Like

Im also cant easy find a good script to get it up and running.

Just enable I2C interface on your raspberry and it should work. Figured It out some time ago

Thanks you saved my life

Thank you for your help. I just got around to implementing this. It works! I had to change
i2c_mcu: rpi
But other then that your config works!

Thanks!!! Great work!