Pushing sensor data to Firebase from Omega
-
In this project we collect the sensor data from digital sensors such as DHT11/22, infrared flame detection sensor and push it to Firebase : Real time database and update these values from time to time (user defined time intervals). Additional sensors can also be added accordingly.
We require onion omega 2+ with it's expansion dock and some connecting wires(male to female type). We use the python interface to the Firebase's REST API by Ozgur and here is a walkthrough to all the methods provided by the API.
The installation is done using pip. The usage of pip on onion omega 2+ is given in omega's documentation and here's the link.
It should look something similar to this if successfully installed on omega.
pip install requests
pip install python-firebase
The omega will automatically download and install all the required packages.For interfacing and using DHT11/22 with the omega 2+ we use the dht-sensor program developed by onion and here is it's installation guide.
I have used python 2.7 and written a generalised program which can be pulled from this git repository. The program consists of these lines of code to authenticate the firebase user. You can find your database secret as mentioned in here. Fill in your gmail account which you used for logging into Firebase in the next field. Next fill in the project URL given in your Firebase database.
When you run the program and everything works fine, it should look something similar to this in your terminal.
These values are accordingly updated(simultaneously) in your firebase database. The values will be updated everytime the omega pushes in new values in the respective nodes.
-
Nice IoT/Smart Home application and library, I like it!
Small heads up on the formatting: The first link has a
()
appended which results in a 404. Also you might want to use double-newlines before and after a picture so that they don't go through the text.
-
I am glad that you liked it and sorry for the mashed up text and pictures, for the walkthrough of the methods provided by the REST API go through the README file of this git repo : https://github.com/ozgur/python-firebase.git