Firebase in esp-idf
realtime database for now. other features later
-
Make sure to have created a firebase project
-
Make sure to have created a realtime database
-
Clone this repository
git clone --recursive https://github.com/dahmadjid/Firebase-idf.git
-
Open firebase_config.h and configure all of the macros correctly
- Add SSID and PASSWORD of your wifi network
- wifiInit function found in wifi_utils.h will connect to wifi
- edit rules of database to { "rules": { ".read": true, ".write": true } }
- Create an api key (create credentials) and copy it in the API_KEY macro using google cloud console
- Go to your firebase project authentication tab and add new provider Email/Password and press save.
- Create new user of your firebase project
- edit rules of database to { "rules": { ".read": "auth.uid != null", ".write": "auth.uid != null" } }
- Copy email and password of the newly created user to USER_EMAIL and USER_PASSWORD macros
- copy the link of the realtime database (not the website url) to DATABASE_URL