Code Monkey home page Code Monkey logo

Comments (7)

yoursunny avatar yoursunny commented on July 24, 2024

I have Heltec WiFi_Kit_32 and a cheap BME280 from eBay.
I2C pins are 21,22. Since ESP32 implements I2C in hardware, there's no need to specify in library.
i2c_scanner says the I2C address of my sensor is 0x76 instead of 0x77. Successful scanner return also indicates hardware wiring is correct.
The problem seems to be

if (read8(BME280_REGISTER_CHIPID) != 0x60)
return false;
that asserts chipID must be 0x60.
The other guy's library allows both 0x60 and 0x58, and my sensor is detected correctly.
(although the readings are all wrong, and I'm still investigating)

from adafruit_bme280_library.

ladyada avatar ladyada commented on July 24, 2024

this isnt a library issue, its a hardware issue. please contact your ebay seller for support

from adafruit_bme280_library.

zachfi avatar zachfi commented on July 24, 2024

@ladyada I think I purchased the BME280 from Adafruit. @yoursunny got theirs from Ebay. I have issues with reliability when codiing. Sometimes, the I2C device is not detected, and sometimes it is. When the code does run, sometimes it just stops at some point and I have to restart the device.

from adafruit_bme280_library.

ladyada avatar ladyada commented on July 24, 2024

xaque - you can post in the adafruit forums for tech support but we know that esp32 i2c has some bugs and is not stable as other chipsets :)

from adafruit_bme280_library.

zachfi avatar zachfi commented on July 24, 2024

Okay cool. I'll have a look over the forums. Thanks @ladyada. There is also espressif/arduino-esp32#741

from adafruit_bme280_library.

MartinHannah avatar MartinHannah commented on July 24, 2024

I have Heltec WiFi_Kit_32 and a cheap BME280 from eBay.
I2C pins are 21,22. Since ESP32 implements I2C in hardware, there's no need to specify in library.
i2c_scanner says the I2C address of my sensor is 0x76 instead of 0x77. Successful scanner return also indicates hardware wiring is correct.
The problem seems to be

Adafruit_BME280_Library/Adafruit_BME280.cpp

Lines 92 to 93 in 4a84ebc

if (read8(BME280_REGISTER_CHIPID) != 0x60)
return false;
that asserts chipID must be 0x60.
The other guy's library allows both 0x60 and 0x58, and my sensor is detected correctly.
(although the readings are all wrong, and I'm still investigating)

This is the missing information I have been searching for thanks.
I have been trying to get ESP32 I2C to work reliably for days, trying different boards, I2C pins the works.
Not when I remove this line in Adafruit_BME280.cpp it all works..
So you need to make sure you have done the following to et I2C working on ESP32 :
a) Use the correct wiring (duh)
b) Use the default I2C pins SDO_pin 22 and SCK_pin 21
c) status = bme.begin(0x76);
d) Comment out lines in Adafruit_BME280.cpp
//if (read8(BME280_REGISTER_CHIPID) != 0x60)
// return false;

ALSO: Tested using TTGO SX1276 LoRa ESP32 Bluetooth WI-FI Internet
The BME280 is an important 3 in one sensor for Lora use-cases and it needs to use I2C because on TTGO and Heltec boards (I am evaluating) SX1276 and OLED displays use other pins.ESP

from adafruit_bme280_library.

yoursunny avatar yoursunny commented on July 24, 2024

I have several authentic Adafruit BME280 boards now. This library works unchanged.

The unit from eBay appears to be BMP280 and it never worked. I got a refund.

from adafruit_bme280_library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.