adafruit / Adafruit_BME280_Library

Arduino Library for BME280 sensors
Other
328 stars 301 forks source link

Adafruit BME280 library does not work on Raspberry Pi Pico - runtime crashes #106

Closed sallevan closed 1 year ago

sallevan commented 1 year ago
  1. make some kind of meteosensor board attaching BME280 via I2C level shifter to Raspberry Pi Pico pins 6 and 7;
  2. install Arduino IDE from official site;
  3. install Raspberry Pi Pico runtime environment from boards manager;
  4. install Adafruit BME280 library with its dependencies via library manager;
  5. install DFRobot BME280 library with its dependencies via library manager;
  6. compile and upload official demo sketch from Adafruit (f.e, bme280_unified);
  7. compile and upload official demo sketch from DFRobot (f.e, raedDataI2C).

If you make board correctly (I did :), both sketches, in theory, should work. Really, Adafruit's just crashes immediately signalling SOS via built-in LED while DFRobot's work like a charm.

sallevan commented 1 year ago

Just to test I've changed Core to alternate one - LED does not show anything, but serial output does not show anything too. So, I consider that sketch hang. DFRobot's works with alternate Core just fine. :)

caternuson commented 1 year ago

Please post in the forums with photos of your setup showing how everything is connected: https://forums.adafruit.com/

Could not recreate. Running the bme280test example from library on a Pi Pico gives expected output.

Screenshot from 2022-12-23 12-49-54

image

sallevan commented 1 year ago

It was my error, I have put sensor address into constructor arguments instead of begin() method. It might be questionable why library does not check SPI pin given in constructor for validity (I know no microcontroller with pin number 0x76, it must have about 140 pins for it - power, ground, etc...).