The following project was developed to collect the humidity and the temperature using the DHT22 sensor and Raspberry Pi v3 and store these data on the Firebase database.
# This code should be used with every script that you will be using to connect to the Firebase database.
import pyrebase
from firebase import firebase
config = {
# You can get all these info from the firebase website. It's associated with your account.
"apiKey": "apiKey",
"authDomain": "projectId.firebaseapp.com",
"databaseURL": "https://databaseName.firebaseio.com",
"storageBucket": "projectId.appspot.com"
}
firebase = pyrebase.initialize_app(config)
.
.
.
.