IOT with Firebase: Control Led Using Firebase Console

IOT with Firebase
As we continue to learn IOT with Firebase using NodeMCU, we cover ON/OFF a LED connected to Arduino using Firebase Console.
I hope you find using Firebase with IOT to be a breeze after this tutorial. Please share your alternative problem solutions. All of the code and a transcript follows the video below.
If you like videos like this consider donating $1, or simply turn off AdBlocker. Either helps me to continue making tutorials
 
Transcript / Cheat Sheet

Arduino NodeMCU Code:

 
 


// Copyright 2015 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the “License”);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an “AS IS” BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// FirebaseDemo_ESP8266 is a sample that demo the different functions
// of the FirebaseArduino API.
#include <ESP8266WiFi.h>
#include <FirebaseArduino.h>
// Set these to run example.
#define FIREBASE_HOST esri-eea51.com
#define FIREBASE_AUTH qULRQbnuz————-Q1FxHvM
#define WIFI_SSID kavin
#define WIFI_PASSWORD 123456345
void setup() {
Serial.begin(9600);
pinMode(D1, OUTPUT);
// connect to wifi.
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print(connecting);
while (WiFi.status() != WL_CONNECTED) {
Serial.print(.);
delay(500);
}
Serial.println();
Serial.print(connected: );
Serial.println(WiFi.localIP());
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
Firebase.set(LED_STATUS, 0);
}
int n = 0;
void loop() {
// get value
n = Firebase.getInt(LED_STATUS);
// handle error
if (n==1) {
Serial.println(LED ON);
digitalWrite(D1,HIGH);
return;
delay(10);
}
else {
Serial.println(LED OFF);
digitalWrite(D1,LOW);
return;
}
}

At last we are end up with great tutorial on IOT home automation using Firebase Console, NodeMCU.
 

11 thoughts on “IOT with Firebase: Control Led Using Firebase Console

  • June 10, 2018 at 12:09 am
    Permalink

    i got:
    Exception (28):
    epc1=0x402039ca epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

    ctx: cont
    sp: 3ffefaa0 end: 3ffeffc0 offset: 01a0

    >>>stack>>>
    ……

    Reply
  • October 16, 2018 at 4:38 pm
    Permalink

    I alway getting a trouble with like this
    Arduino: 1.8.7 Hourly Build 2018/09/10 06:33 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

    Build options changed, rebuilding all
    Multiple libraries were found for "FirebaseArduino.h"
    Used: C:UsersTVSHDocumentsArduinolibrariesfirebase-arduino-master
    In file included from C:UsersTVSHDocumentsArduinolibrariesfirebase-arduino-mastersrc/FirebaseArduino.h:22:0,

    Not used: F:ARDUINOarduino-nightlylibrariesfirebase-arduino-master
    Not used: F:ARDUINOarduino-nightlylibrariesfirebase-arduino-master
    Not used: F:ARDUINOarduino-nightlylibrariesfirebase-arduino-master
    from F:ARDUINOarduino-nightlylibrariesfirebase-arduino-masterexamplesFirebaseDemo_ESP8266FirebaseDemo_ESP8266.ino:21:

    Not used: F:ARDUINOarduino-nightlylibrariesfirebase-arduino-master
    C:UsersTVSHDocumentsArduinolibrariesfirebase-arduino-mastersrc/Firebase.h:26:25: fatal error: ArduinoJson.h: No such file or directory

    #include

    ^

    compilation terminated.

    exit status 1
    Error compiling for board NodeMCU 1.0 (ESP-12E Module).

    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

    Reply
  • November 14, 2018 at 5:16 pm
    Permalink

    My system stopped update the data from Firebase after a while(like 10 minutes). Wifi still connected. How to solve this problem?

    Reply
  • November 19, 2018 at 8:16 pm
    Permalink

    firebase free spark plan includes limited number of set/get (r/w) might be all r/w finished

    Reply
  • April 17, 2019 at 7:36 am
    Permalink

    Hello, sir i have done all the steps as mentioned in this tutorial, but still my realtime database show myproject:NULL instead of LED_STATUS or anything….kindly guide me through this

    Reply
  • April 19, 2020 at 3:40 am
    Permalink

    Rapidly this kind of link may well irrefutably find yourself famous among each creating many individuals, as a result of thorough posts and also critiques and also scores. led light panel

    Reply
  • May 1, 2020 at 4:44 pm
    Permalink

    No idea about the power. I will try measuring the current drain using an ammeter. Again no idea about the lux. I couldnt find the datasheets of the LEDs used in this panel

    Reply
  • May 1, 2020 at 4:44 pm
    Permalink

    No idea about the power. I will try measuring the current drain using an ammeter. Again no idea about the lux. I couldnt find the datasheets of the LEDs used in this panel led flat panel light

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *