ESP32 - Firebase
ESP32 - Firebase
with
(Real-time Database)
What is Firebase?
• It is Google’s Mobile Application Development Platform
“Firebase is a toolset to “Build, Improve, and Grow Your App”, and the
tools it gives you cover a large portion of the services that developers would
normally have to build themselves but don’t really want to build because
they’d rather be focusing on the app experience itself.
This includes things like Analytics, Authentication, Databases,
Configuration, File Storage, Push Messaging, and the list goes on.
The services are hosted in the cloud and scale with little to no effort on the
part of the developer.”
Task 1:
Task 2:
This task 1 is divided into three sections.
Step 1:
• Create a Firebase Project - set up a Firebase project and create a
realtime database
Step 2:
• ESP32: Store data to the Firebase Realtime Database
Step 3:
• ESP32: Read data from the Firebase Realtime Database
Set Up a Firebase Account and Create a
New Project
Creating a New Project
Follow the instructions to create a new project on Firebase.
Click on “Continue”
Disable the option Enable
Google Analytics for this
project, as it is not needed.
Click on Build > Real-time Database and then, click on Create Database.
Select your database location. It should be the closest to your location
Set up security rules for your database. For testing purposes, select “Start in test mode” and Click on “Enable”
Your database is now created. You need to copy and save the database URL
• To program the ESP32, you can use Arduino IDE, VS Code with
the PlatformIO extension or pioarduino, or other suitable software.
• Search
for “FirebaseClient” in
Library Manager
• Install
the “FirebaseClient” by
Mobizt.
ESP32 Store Data to Firebase Database
• Write the code to your Arduino IDE.
For Example:
int intValue = Database.get<int>(aClient, "/test/int");
• Congratulations!, you’ve created a Firebase project with a
Realtime Database and learned how to store and read data from
the database using the ESP32.