• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Firebase Web App with ESP32 and ESP8266 – Could not find a valid BME280 sensor, check wiring!

Q&A Forum › Category: ESP32 › Firebase Web App with ESP32 and ESP8266 – Could not find a valid BME280 sensor, check wiring!
0 Vote Up Vote Down
Kaspars asked 3 years ago

Hi,
Stuck on page 65 with this tutorial about testing BME280 sensor readings. On serial monitor I have: Could not find a valid BME280 sensor, check wiring! I have chenged with other exemplar of BME280, but receive the same. Also checked the adress of BME280, it is: 118 (0x76), also googled about this problem, but not found solution.
I have BME type for either SPI or I2C communication (with 6 pins).
Work with windows version in VSC. Basic comunication with database works.
Any suggestions?
 

Question Tags: #Esp32 #BME280 #Sensor readings
19 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.
Have you tested the sensor with a simple sketch?
Like the one in this tutorial: https://randomnerdtutorials.com/esp32-bme280-arduino-ide-pressure-temperature-humidity/
Just to check that everything is fine with the sensor.
Regards,
Sara

0 Vote Up Vote Down
Kaspars answered 3 years ago

hi, I tested simple sketch also, the same result. Moreover – in this sketch function printValues(); gives error as undefined:

void loop() {
printValues(); // error – undefined
delay(delayTime);
}
When comment this function out – the same output about wrong wiring.
Maybe something wrong with hardware, I will change parts and try once more. 🙂

0 Vote Up Vote Down
Kaspars answered 3 years ago

Changed hwiringardware, but result the same. Pls see attached pictures of wiring.

0 Vote Up Vote Down
Kaspars answered 3 years ago

I have this board:
https://www.az-delivery.de/en/products/esp-32-dev-kit-c-v4
pins are bit diferent than in your tutorials.
Anyway I was able to read the address of sensor …

0 Vote Up Vote Down
Anders Carlsson answered 3 years ago

You have to set the SDO pin to gnd then you will get readings. Se this https://rntlab.com/question/bme280-faulty-readings/ were I had the same issue. You can get the adress of the sensor 0x76 but you will get no readings. If you get 0x77 you don`t need to set the SDO to ground
//Anders

0 Vote Up Vote Down
Kaspars answered 3 years ago

Hi Anders, I readed about your case, and tried it. Unfortunately it not changed my result.
Just now one more time tried it. Also one more time checked that device address is: 118 (0x76).
Thanks for your answer!

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.
 
If you’re using VS Code, you need to copy the printValues() function before the setup().
 
The board you’re using should work just fine as long as you use GPIO 22 and GPIO 21 for I2C communication.
 
Can you show me a picture of your sensor? Are you sure you have a BME280 sensor? Some vendors sell BMP280 instead of BME280. A BMP280 won’t work with BME280 sketches.
To share a picture share a link to imgur, google drive or dropbox, for example.
 
Regards,
Sara
 
 
 

0 Vote Up Vote Down
Kaspars answered 3 years ago

I bought following:

My picture: https://failiem.lv/u/pvkcxnkt9

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi again.
The sensor is a little different from the ones I have.
So, I’m not sure if it is a “real” BME280 sensor.
Can you try to run an example sketch for the BMP280 just to check if that’s the sensor that you have?
Use the following library:

  • https://github.com/adafruit/Adafruit_BMP280_Library

And use this example: https://github.com/adafruit/Adafruit_BMP280_Library/blob/master/examples/bmp280test/bmp280test.ino
 
Regards,
Sara
 
 

0 Vote Up Vote Down
Hartmut Wohllaib answered 3 years ago

Hi
It was working when I changed in the program “Send_Data_Database_” from <Adafruit_BME280.h> to <Adafruit_BMP280.h> and Adafruit_BME280 bme; to Adafruit_BMP280 bme; and have learned the BMP280 does not deliver any pressure.
Now I’ve been trapped on page 138 for some time.
When entering http: // localhost: 5000 I do not get the page “ESP IoT Firebase APP” but “index.html” is displayed in full in the browser.
What’s wrong, what did I do wrong?
Thanks for your answer!
 

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.
Do you have all the files in the project folder (see page 131)?
Did you copy the HTML provided to the index.html file?
Did you run the following command?

firebase serve --only hosting

What did you get in response?
Regards,
Sara

0 Vote Up Vote Down
Hartmut Wohllaib answered 3 years ago

Hi, 
Visual Studio shows this:
FIREBASE-PROJECT
Public
404html
index.html
logo.png
scripts
js auth.js
js index.js
.firebaserc
.gitignore
database.rules.json
firebase.json
I did > Download index.html file
did configuration in the highlighted lines in a different color.
I did > Terminal > New Terminal. Then, run the following command. firebase serve –only hosting
something like this turned up > hosting: local server http://localhost:5000
when i set http://localhost:5000 the same happend as if i would have executed
Download index.html file
BUT NOW AFTER TRYING AGAIN today this turns up
PS C:\Users\Hartmut\Documents\A_Firebase_ESP_32_8266\Firebase-Project> firebase
serve –only hosting
Error: Failed to make request to https://firebase-public.firebaseio.com/cli.jsonPS C:\Users\Hartmut\Documents\A_Firebase_ESP_32_8266\Firebase-Project>
Thank you
Regards
Hartmut

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.
It seems related to this: https://github.com/firebase/firebase-tools/issues/2927
A workaround for this issue is to deploy your project instead of creating a local server.
So, run the following command instead:

firebase deploy

It will return a URL where you can access the web page app.
Regards,
Sara

0 Vote Up Vote Down
Kaspars answered 3 years ago

Hi, Sara,
Would it be possible that various scan bots can try attack ESP32 communication instead of Firebase? Is this safe arhitecture?
 

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.
What do you mean?
If you’re worried about security, you can use SSL certificate with ESP32.
It is described on the ESP Firebase Client library how to do that.

For server SSL authentication by providing the server root certificate.
Server SSL certificate verification is the process to ensure that the server that client is being connected is a trusted (valid) server instead of fake server.
The Google’s GlobalSign R2 root certificate can be download from https://pki.goog/repository/
Select the .PEM (base-64 encoded string) or .DER (binary) file to download.
From the test as of July 2021, GlobalSign Root CA was missing from Google server, the certificate chain, GTS Root R1 can be used instead of root certificate.

Here’s the link: https://github.com/mobizt/Firebase-ESP-Client
Regards,
Sara

0 Vote Up Vote Down
Joe Margevicius answered 3 years ago

I know this is an old post, but I had the same problem with “cheapie” BMP280s I bought (they cost 1/5 the price of BME280s I bought – $2 versus $10 . Note that the P means it measures only Temp + Pres, while the E means it also measures Humidity). 
 
The issue with the cheapies is that the chipID is not 0x60, which is what the #include <Adafruit_BME280.h>” library will look for and return a status of False.  The cheapies have chipID = 0x58, which according to the spec for all these devices, is an ID for the “mass production” version of the chip.  (samples given to developers have ID = 0x56 or 0x57)
 
So, what I did to use these cheapies is to modify a file in the Adafruit_BME280_library, specifically the Adafruit_BME280.cpp file.  You need to change the command in the init() function from if (_sensorID != 0x60) to if (_sensorID != 0x58).   It then works fine.
 
A solution is to change the command to: if(_sensorID != 0x60 and _sensorID != 0x58) … however, this does change the Adafruit BME280 library.  A more perfect solution is building a new library, which isn’t hard if you know what you’re doing 😉  … .depends on how badly you want to use these cheapies ! (I’m not a “proper software” person, so there is no doubt a better way to accommodate these cheapie chips).  

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Maybe you have a BMP280.
See this article: https://randomnerdtutorials.com/solved-could-not-find-a-valid-bme280-sensor/#fake-bme280
Regards,
Sara

0 Vote Up Vote Down
Joe Margevicius answered 3 years ago

Hi Sara … yes I specifically bought BMP’s … at the price of 1/5 of the BME’s … what I didn’t know was that there was a different library for the P’s versus the E’s, and on using the E’s library, it took me a while to figure out that the P’s were not being initialized because of the chipID being different from the E’s.  Changing the code in the E library fixed the problem.  Thanks for the clarification on this – I downloaded the E library per your tutorial, and will use that instead 🙂

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

That’s great!
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.