Skip to content

This C++ Firebase library for ESP-IDF is a reliable and non-blocking solution designed for IoT development on the ESP32 platform. It provides seamless support for streaming data to Firebase and offers various features to enhance your IoT projects.

Notifications You must be signed in to change notification settings

tharushaudana/esp-idf-firebase-with-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Firebase C++ Library for ESP-IDF (with Stream support)

License ESP-IDF

This C++ Firebase library for ESP-IDF is a reliable and non-blocking solution designed for IoT development on the ESP32 platform. It provides seamless support for streaming data to Firebase and offers various features to enhance your IoT projects.

Features

  • Non-blocking: Our library is designed to be non-blocking, allowing your ESP32 to perform other tasks while interacting with Firebase. This is crucial for building responsive IoT applications.

  • Stream Support: You can easily stream data to Firebase, making it perfect for real-time IoT projects.

  • Improved Reliability: To ensure a more reliable connection, we recommend setting CONFIG_LWIP_TCP_MSL to 10000 ms in your ESP-IDF configuration. This extended Maximum Segment Lifetime (MSL) can help in situations where your network may experience temporary disruptions.

Getting Started

To start using this C++ library in your ESP-IDF project, follow these steps:

  1. Clone this repository or add it as a submodule to your project.

  2. Include the necessary header files in your project:

    #include "firebase-with-stream.h"
    
    firebase_with_stream firebase;
    
    firebase_config_t fb_config;
    firebase_credentials_t fb_credentials;
  3. Configure your Firebase credentials and initialize the library:

    fb_config.api_key = "AIzaSyC2KRrFHQpntl4lMpuh-Wql0TB4njcBIlU";
    fb_config.db_url = "https://greenhouse-project-bec1e-default-rtdb.firebaseio.com";
    
    fb_credentials.email = "example@gmail.com";
    fb_credentials.password = "tha2003";
    
    firebase.set_config(fb_config);
    firebase.set_credentials(fb_credentials);
    
    firebase.begin();
  4. Start using the library to send and receive data to/from Firebase.

Example

Here's a simple C++ example of how to update data in Firebase:

std::string json_data = 
                "{"
                "\"k1\":\"v22\","
                "\"k2\":\"v23\","
                "\"k3\":\"v24\""
                "}";

firebase.crud.update("/test/o2/.json", json_data.c_str());

About

This C++ Firebase library for ESP-IDF is a reliable and non-blocking solution designed for IoT development on the ESP32 platform. It provides seamless support for streaming data to Firebase and offers various features to enhance your IoT projects.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published