• 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

Problems with ESP32/ESP8266: Firebase Web App to Display Sensor Readings

Q&A Forum › Category: ESP32 › Problems with ESP32/ESP8266: Firebase Web App to Display Sensor Readings
0 Vote Up Vote Down
amal jacob asked 2 years ago

Hi, Need help.
When I uploaded the code and compiled it successfully. The sensor data are not updated to the firebase. I can see all JSON data in the serial monitor. The updates from “digital, message, and pvm are updated n the serial monitor. I’m using DHT11 and made the necessary changes in the code for that particular sensor. Please help. Thanks
DHT 11 code 

#include <Arduino.h>
#include <WiFi.h>
#include <Firebase_ESP_Client.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <DHT.h> // Add DHT library
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

// DHT11 sensor
#define DHTPIN 4 // Define the pin where the DHT sensor is connected
#define DHTTYPE DHT11 // Define the DHT sensor type
DHT dht(DHTPIN, DHTTYPE);
float temperature;
float humidity;

 

void setup(){
Serial.begin(115200);

// Init DHT sensor, OLED, and WiFi
initOLED();
initWiFi();

// Initialize DHT sensor
dht.begin();

 

void loop(){

// Get latest sensor readings from DHT sensor
temperature = dht.readTemperature();
humidity = dht.readHumidity();

Serial Monitor

0, Type: object, Name: digital, Value: {"2":0,"12":20}
1, Type: object, Name: 2, Value: 0
2, Type: object, Name: 12, Value: 20
3, Type: object, Name: message, Value: "its working"
4, Type: object, Name: pwm, Value: {"13":0,"14":0}
5, Type: object, Name: 13, Value: 0
6, Type: object, Name: 14, Value: 0
 
Received stream payload size: 112 (Max. 112)
 
FAILED
REASON: Invalid data; couldn't parse JSON object, array, or value.
Question Tags: ESP32 Firebase webapp
1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
You’re just sharing a regular DHT code.
Share the firebase code that is giving you issues,
Thanks.
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.