How to fetch data from Firebase to Nodemcu | Step by step instructions
How to fetch data from Firebase to Nodemcu
Hello guys, welcome back. In this tutorial, we are going to learn how to fetch data from Firebase to Nodemcu. Also, a LED ON and OFF example is used to explain this tutorial. This can be simply described as an IoT project. Because the Internet is required to turn this LED on and off. You may remember that we used the Blynk app for this in a previous lesson. Today we will use Firebase software instead. Click think for more details in the Nodemcu ESP8266. Click this link for more information about Nodemcu ESP8266.
Firebase is simply software used to manage and modify android / IOS applications, web services, IoT sensors, and hardware. This is a service provided by Google. Also, that is an open-source web application software. Just having a google account is enough to work with this. Also, The following steps will show you how to set up the firebase.
OK, let’s learn this lesson step by step. So, the required components are given below.
Secondly, connect these components, For that, use the circuit diagram below.
Thirdly, let’s set up the firebase and Arduino IDE Program. For that, follow the steps below.
OK, first open your internet browser and search for “Firebase” here. Then, click on the second result on the page.
Now, click the “Get Started” button. After, click the “New project” button.
Next, enter your project name and click the “Continue” button. Click again the “Continue” button.
OK, select your account now, then select “Default Account for Firebase”. Then click the “Create Project” button. After, you can see how your project is set up. It only takes a few seconds. Now, your project is ready. If all this is correct, click the “Continue” button.
Okay, now let’s go back to the Firebase side. Then copy and paste this code on the Arduino IDE program.
Afterward, click the “Realtime Database” button on the left side. Next, click the “Create Database” button. Then select the Database location and click the “Next” button. Next step select the “Start in test mode” after, clicks the “Enable” button.
Now, copy and paste this Firebase host link into the program.
Then, click the “+” icon and enter “LED_STATUS” for the name and “0” for the value. Next, click the “Add” button. OK, now set up the Firebase software is enough.
Now, fill in the program’s WIFI connection information. For that. Enter the WIFI name and WIFI password.
Now, let us download and install the JSON 5.13.5 library which is an essential library to work with firebase. For that, use the pictures below.
Lastly, select the correct board and port, After, upload this program to the Nodemcu board. OK, now we can ON and OFF the LED using Firebase. For that, open the Firebase again and update the values to 1 and 0.