Interacting With Your Google FireBase Data Using Node-Red And Raspberry Pi

Introduction

 
This article demonstrates how we can interact with our Google Firebase data using a Raspberry Pi and Node-Red visual programming environment.
 

Node-Red 

 
Node-Red is a visual programming environment that allows users to create coding by dragging and dropping nodes on the screen. Node-Red has been preinstalled on noobs. It can also be installed on Windows and Linux. You can run Node-Red on your specific system.
 
Step 1
 
Install / Upgrade 
 
Since Node-RED is already installed, you can install or upgrade it using the Node-RED upgrade script command mentioned below.
  1. bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)  
Elegant GUI That Allows You To Interact With Your FireBase Data Using Node-Red And Raspberry PI 
 
Next, go to Raspbian Start >> Programming >> Node-Red.
 
Elegant GUI That Allows You To Interact With Your FireBase Data Using Node-Red And Raspberry PI 
 
Start the Node-Red program.
 
Elegant GUI That Allows You To Interact With Your FireBase Data Using Node-Red And Raspberry PI 
 
Step 2
 
Open Google Firebase Console " https://console.firebase.google.com"  and create a new project. Here, our project name is Node-Red.
 
Elegant GUI That Allows You To Interact With Your FireBase Data Using Node-Red And Raspberry PI 
 
Enable Email/Password sign-in
  • In the Firebase console, open the Auth section.
  • On the "Sign in method" tab, enable the Email/password sign-in method.
Elegant GUI That Allows You To Interact With Your FireBase Data Using Node-Red And Raspberry PI
 
Create a child path. Here, the child name is D1. Copy the Firebase connection link "https://node-red-xxxxx.firebaseio.com".
 
Elegant GUI That Allows You To Interact With Your FireBase Data Using Node-Red And Raspberry PI 
The given child value is null or zero.
 
Step 3
 
Once Node-Red has started, point a browser at http://Local_IP:1880. This works better with the Chrome or Edge browsers.
 
Select the "Manage palette" option from the right side of the menu bar. 
 
Elegant GUI That Allows You To Interact With Your FireBase Data Using Node-Red And Raspberry PI 
 
Then, search for “firebase” and install the node-red-contribs-firebase and node-red-contribs-firebase real-time databases.  
 
Elegant GUI That Allows You To Interact With Your FireBase Data Using Node-Red And Raspberry PI 
 
We will also send a text comment back to our Firebase database and then let's start dragging and dropping the "Firebase modify" and "inject i/p".
 
Elegant GUI That Allows You To Interact With Your FireBase Data Using Node-Red And Raspberry PI 
 
The child path name is the same as of the Firebase database child name, i.e., "D1".
 
Elegant GUI That Allows You To Interact With Your FireBase Data Using Node-Red And Raspberry PI 
  • Text string to Firebase  -- a text input node is wired to a firebase modify node.
  • Edit the firebase modify node with the correct database address and value to set.
  • The string is successfully connected and click the "deploy".
Elegant GUI That Allows You To Interact With Your FireBase Data Using Node-Red And Raspberry PI 

Output

 
The values are pushed to Google Firebase.
 
Elegant GUI That Allows You To Interact With Your FireBase Data Using Node-Red And Raspberry PI 
 

Summary

 
Finally, we have successfully started interacting with Google Firebase using Raspberry Pi and Node-Red.