Giter Site home page Giter Site logo

umunusb1 / firebase-iot-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bhardwajrahul/firebase-iot-demo

0.0 0.0 0.0 10 KB

ESP8266 Firebase Arduino client developed using Platformio sending DHT11 and MQ5 data to Firebase Realtime Database

Home Page: https://medium.com/@garssallaoui.bayrem/iot-prototyping-with-firebase-doing-more-with-less-2f5c746dac8b

License: MIT License

C 4.21% C++ 95.79%

firebase-iot-demo's Introduction

Firebase IoT Demo with ESP8266

This project uses ESP8266 to read sensors, connect to Firebase and push data to Realtime Database. Temperature and Humidity data is read from DHT11 sensor, Gas leak detection is read from MQ5 Gas sensor finally device heartbeat is sent every 2 secondes to Firebase to ensure device cinnection. Note that you can simulate the sensors with random values by uncommenting 'DONT_HAVE_SENSORS' define.

Getting Started

These instructions will get you a copy of the project up and running on your ESP8266 for development and testing purposes.

Prerequisites

This project uses the Arduino framework and PlatformIO IDE for building and flashing the app into ESP8266. The data sent from the device is stored in Firebase Realtime Database.

Installing

Once installed PlatformIO and created firebase project, download this project

git clone https://github.com/kaizoku-619/firebase-iot-demo.git

Setup credentials

cd firebase-iot-demo/include

Inside 'include' directory create a new file named 'Creds.h' and replace with the values of your WiFi SSID, Password and Firebase host of your Firebase project and Firebase Auth which you can find them in this link by replacing [###########] with your Firebase project name. https://console.firebase.google.com/project/[###########]/settings/serviceaccounts/databasesecrets

#define SSID "XXXXXXXXXXX"
#define PASSWORD "XXXXXXXXXXXXXXX"

#define FIREBASE_HOST "XXXXXXXXXXXXX.firebaseio.com"
#define FIREBASE_AUTH "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Simulate Sensors

If you don't have sensors attached to your ESP8266 or you want to quickly test the application and consult data in Firebase database without the need of attaching sensors, you can simply uncomment DONT_HAVE_SENSORS define.

#define DONT_HAVE_SENSORS

Update Firebase Fingerprint

Build the project using PlatformIO, Once project built you'll see .piolibdeps folder created with the 3 new libraries installed:

  • DHT sensor library
  • Adafruit Unified Sensor
  • FirebaseArduino

Open FirebaseArduino/src/FirebaseHttpClient.h and scroll to the end of the page, you'll find FirebaseFingerprint[] which its value need to be changed.

To generate a fingerprint, go to this website and copy your Firebase host link without the https part (your might look something like this your-prject-name.firebaseio.com) and click on Fingerprint Site. Copy the newly generated fingerprint in the place of the FirebaseFingerprint[] value and replace the columns with spaces.

Upload the code and you're good to go.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

References

firebase-iot-demo's People

Contributors

kaizoku-oh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.