Send txt file to Esp32?


I need to receive some data in a ESP32, at the moment i have this data in a txt file in a SD card connected to the esp32, so everytime it reads the sd card it get the information it needs for the day, its like a set of configurations for the day. But soon I'll need to have this data being fed remotely, and I can not acess the router where the esp32 will be to do any port forwarding, so I'm guessing that in esp32 could act as client only and fetch this data from a node red mqtt or http server, or, the esp32 as a server and I manage to send a txt file from the node red to esp32 (it could be txt file or any other format as long as it can carry 5KB). But having the esp32 as a server would require do some port forwarding in its router (at least thats the only way I can think), and I don't have access to that.
So, does anyone nows a way to send data like this from node ed to esp32? Most information I find is the other way around (from esp32 to node red).

Thank you.

Cheers, Luís Pereira.

Install a MQTT client on the ESP32 and subscribe to a topic that would contain the data you need to send it.

I think that if @LuisPereira needs to get data into the esp from the internet without port forwarding then the esp will have to subscribe to an mqtt broker that is outside the esp local network. Then node red can publish to that broker and the esp can pick it up.

Yes, @LuisPereira I was understanding the ESP was the only item (of concern) that was behind this inaccessible router.

As long as the ESP can reach the internet, the ESP should still be able to connect to another network (that you can control) containing the broker, as long as you can supply a public IP/port for the ESP client to link to.

Thank you for your answers. Yes it seems feasible, I already got a RPI with nodered running, I'll just I have to pratice a few examples until I manage how to send a .txt 5KB data trough MQTT payload.
Regarding the server access, I'll probably set a public IP on No-IP platform for the RPI (Node red server) and that way the ESP32 can access it from anywhere.

Again, thank you!
Cheers, Luís Pereira.

You should able to put the whole of the text in the payload and publish it.

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