I am doing a project to identify people via RFID in ESP32. When performing the identification, the ESP must consult the data referring to the identified RFID TAG and display the related data on a display (name, city, date of birth).
However, I am not able to understand how I carry out this communication between ESP and Firestore. Can anyone help me?
Thanks!
The intended method of talking to the Google Cloud from an ESP32 is through the IoT Core. Note that this will not get you a direct connection to the Firestore - you'd have to write some cloud side code to translate MQTT messages into database queries and responses. This shouldn't be very difficult, though.
Otherwise you can send HTTPS queries directly to the Firebase REST API. Read the Google documentation for that.
If you are using ESP-IDF framework for your development you can use this ESP-IDF component to communicate with Firestore (this component uses Firestore REST API via HTTPS):
https://github.com/kaizoku-oh/firestore.git
Here is also an example using RFID and Firestore components that you can change according to your needs:
https://github.com/kaizoku-oh/firestore-rfid-node.git
Related
this is my first question, so let if I did something wrong, I´ll rework it.
This Issue
For accessing a FBRD protected via Security Rules, the user has to be authorized and authenticated.
Authorization: Done via setting up Security Rules -> OK
Authentication: Done via Google OAuth2 access tokens or Firebase ID tokens as per Firebase Authenticate Doku
There are several libraries I found but sadly non of them is applicable for my use-case:
running on an µC
support of GSM (no Wifi)
What I achieved
Posting Data via https REST to FBRD with API-KEY and SECRET. This is just an interim workaround which I want to get rid off, since SECRET should not be stored of µC source code and the user µC in this case should only have limited access as per Security Rules.
What I tried without success
Wifi Library: Firebase-ESP-Client
Example: EMail
Info: There was already a discussion on GSM. Outome was, no GSM support
My question
Has somebody solved this issue or could help in doing so?
I´m not a security expert but I think APIs for token generation and exchange are needed. Or with other word how get the token exchange and needed for sign-in-email-password realized on µC?
Thanks in advance
Build Errors due to Wifi connection
Firebase Arduino Client Library for ESP8266 and ESP32/src/wcs/esp32/FB_TCP_Client.h:43:0,
Firebase Arduino Client Library for ESP8266 and ESP32/src/common.h:39,
Firebase Arduino Client Library for ESP8266 and ESP32/src/Utils.h:37,
Firebase Arduino Client Library for ESP8266 and ESP32/src/signer/Signer.h:37,
Firebase Arduino Client Library for ESP8266 and ESP32/src/Firebase.h:45,
Firebase Arduino Client Library for ESP8266 and ESP32/src/Firebase_ESP_Client.h:41,
How do i listen to data changes in Firebase Cloud Firestore with ESP8266? So far i have managed to connect ESP8266 with firestore to read and post data to Firestore using the REST API, but instead of constantly reading data from Firestore, I want to listen to an event when the data changes in Firestore.
In short, I want to have a stream open where i am listening for changes in Firestore.
This can be done with Firebase Real-time database, but i haven't found examples for Firestore.
Here is an example of what i am trying to do, but with real-time database: https://github.com/mobizt/Firebase-ESP8266/blob/master/examples/Stream/Stream.ino
I was asking around on some forums, and i found out that sadly this is not possible :(
The Cloud Firestore supports the REST API unless stream like feature are not available due to poor performance and Firebase team decided to remove this feature.
The only possible method that suitable for no Firebase SDK installation is the RPC (gRPC) which is not currently available in embedded device.
The other problem is database secret can't use in the Cloud Firestore, the auth or custom token is required and need the SSL/TLS library for key encryption and signing. This can be done in ESP32 with mbed TLS which can't do this in ESP8266 with BearSSL.
Then Cloud Firestore with realtime feature (using gRPC) is not possible in ESP8266.
From a issue on github#Firebase-ESP8266: https://github.com/mobizt/Firebase-ESP8266/issues/126
The workaround can be using a webserver and/or Firebase Functions, which sadly was the thing I was trying to avoid.
I need information on how to connect and send data to firestore from an Arduino Board and an ESP2866 module. I've only found tutorials using Firebase realtime, the ones I found using Firestore are using the NodeMCU board.
I have a Vue.js application reading some fields from a Firestore db, which should recieve information from the arduino with some attached sensors. From what I've seen my options are changing to firebase realtime or changing to NodeMCU( not possible ). I some direction to follow, on how to use firestore with arduino or just change the db.
One way to do it is to have an online server, after that it becomes very easy. Send your Arduino data to the server and then write the data to Cloud Firestore.
To find how to write data into Firestore, refer this documentation: https://firebase.google.com/docs/firestore/manage-data/add-data and chose the integration for your server. Firestore supports most of the popular server integrations like Node.js, GO, PHP, Python etc.
As answered by #doublejosh, refer to this documentation: firebase-extended
I had quick success using firebase-arduino for the real-time database rather than Firestore. Since Arduino projects are generally hobby, this should probably work well enough.
I'm using the react native firebase sdk and am wondering about how the underlying network calls are implemented. When making firestore get queries, is the sdk just keeping a socket open when it's initialized and make requests over the open socket, or does it make individual http requests to an endpoint?
Specifically I'm looking for an efficient way to get a batch of documents (profile thumbnail properties given a batch of profile ids), and I saw an answer that said that firebase calls are pipelined so calling the gets in parallel is efficient. However, I'm not sure if that applies to firestore as well.
The Firestore SDK uses gRPC to communicate with the server. This is the same layer that many of Google's other Cloud products use under the hood. It is quite different from the Web Sockets communication layer that the Firebase Realtime Database relied on.
Digging into the code it seems like the "real time" part of firebase uses websockets. The database module also has a dependency on
faye-websocket
I've worked with firebase and arduino's before but never together. I need to know how to make an arduino uno receive data through firebase, however I do not need it to send data. I have no idea how to do this, or if it is even possible. I've looked at various articles of an arduino sending data to firebase, but never receiving data.
If you thinking to connect Arduino with Firebase you will need a backend. You can use Firebase Admin SDK to create a backend.
This is a sample code for a backend.
For more Information refer the Documentation
Most likely your Arduino saves data to the Firebase Database through the REST API. If that is the case, it can also listen for data through the REST API.
There are several libraries that wrap this REST API to make is easier to use with Arduino. Instead of recommending one of those (which is off-topic on Stack Overflow), I recommend you try them and see what works best for you.