firebase host 0: Arduino to firebase

I first got this lib:
https://github.com/FirebaseExtended/firebase-arduino//
But not working tested 2019/6/26 on esp8266
this is the working one
https://github.com/mobizt/Firebase-ESP8266

there are different version for different board, such as esp32, arduino MKR1000wifi...etc

Documentations are good, on dependencies, installation, feature....etc.

Few thing need to be set up in google firebase and get the following info:
data base host: https://**********.firebaseio.com/
this can be found in database Data, and select Realtime Database

and you need a database secret form below:
project overview/ project settings/Service accounts/Database secrets/ secret
some thing like: fhWvKNxxxHb2oMmbF3sayyyE4HAhMxxzzzzSG53
the secret method seems to be an old one, and it could be replaced some day.....

The only downside of this firebase lib is that it use arduino "String" in example...
I tried to use arduinoJson lib....some arduino firebase lib already use Json lib, but seems some issues on v5 and V6.

simple install the V6 lib and refer to // https://arduinojson.org/v6/example/generator/
the trick is that
StaticJsonDocument<200> doc;
has to be placed in the loop() not in setup()...
Inside the brackets, 200 is the RAM allocated to this document. Use arduinojson.org/v6/assistant to compute the capacity.

after few struggle, it works fine....




留言

這個網誌中的熱門文章

Heltec ESP32+OLED+Lora, hardware testing

micro SD card for ESP32, on lolin32 with OLED and heltec 32 lora oled

Install Network Time Protocol(NTP) on BeagleBone with Angstrom linux and set local time zone