firebase mqtt question

Hi! I have an application that connects my ESP32 to Firebase, so, I can use the data there. However, now I need to remove Firebase from the board and access this data through some mqtt broker, I am hours researching how to make the communication between FIREBASE - BROKER - ESP32 but I can't find it. Does anyone have any tips on how I can do this?

Thank you!

There are plenty of examples of connecting an ESP to MQTT. Also, IdahoWalker has posted example code in multiple threads here where people were asking.

If you're saying that you may no longer connect to Firebase directly from the ESP, you will need some other computer running a program talking to Firebase and your MQTT broker. Your ESP can post requests in one topic and the new program can pick them up, ask Firebase for the data you want and publish the result in another topic.

Is that what you're trying to do?

Connect ESP to mqtt I can. What I was wondering if it is possible is to connect firebase to a mqtt broker so that I can access the data through the broker and not directly from firebase ...

Any search I do on the topic shows plenty of projects and tools that take data from MQTT and store it in Firebase.

I don't see any that push data from Firebase to MQTT, which is not to say that it hasn't been done but the reverse is apparently more common.

Whether there is tooling associated with Firebase that would help or not, somewhere I think that you will need to specify what Firebase must send and what triggers it to do so. Which comes back to what I said above - you need an extra process running somewhere.

I'm no Firebase expert though.

Thanks, willdbill!

I understand a little better, but

you need an extra process running somewhere

Could you explain a little more?

Today you’re calling something from your application to get data from Firebase. Some API or web method I expect. Similarly, if you want to send data to Firebase, there will be other calls you can make to push it there directly.

In future, you want MQTT to act as an intermediary (I’m not sure why). Staying with the need to send data to Firebase, you will need something that takes the data from MQTT and calls the firebase API on your behalf. Lots of people have already done this, probably because they were doing some kind of IoT project and used Firebase as their datastore.

I suggest that you have a go at sending data in that way. It will illustrate that there is now an extra component needed in the data path between your application and Firebase, not just MQTT.


I thought about connecting firebase to node-red and getting the data from firebase through node-red by mqtt. I managed to get the data from firebase on node-red but now I'm thinking about how to make ESP32 have access to this data. I don't know if I'm going the right way, but I've been breaking my head a lot trying to think of a solution. Anyway, thank you very much again, wildbill.

If node-red has the data you want, I would think that it can publish it to MQTT and your ESP app can subscribe to that topic and pick it up.

I suspect that you will also need an MQTT topic that the ESP topic publishes to that will trigger node-red to get and publish the data you want.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.