Serving a file in nodered to share with external nodes - what kinds of "http" blocks do I need?

Greetings!

Setup: I have nodered running on an rpi (rpi's IP address is 192.168.0.113), with several ESP32 nodes on the network as well. They all communicate over MQTT, but they can use other methods (like UDP or TCP) as well. This is a local home network.

Problem: I want nodered on the rpi to "serve" a firmware file
[example: http://192.168.0.113/firmware/fw_ver9.bin]

  1. Let's assume that the ESP32 is currently using fw_ver8.bin firmware
  2. The ESP32 node first "checks" to see if fw_ver9.bin exists using some kind of http command, pointed at "192.168.0.113/firmware/fw_ver9.bin".
  3. If the fw_ver9.bin file DOES exist, then download it.

I'm not sure what nodered nodes I need (some kind of http "get" or "post" requests?) - is there a similar example of what I want to do above?

Hello .. you can do this by creating a folder that contains your firmware.
For Example /home/pi/firmware" and then editing your settings.js
(should be located in /home/pi/.node-red/settings.js)
edit the line for Node-red to serve that folder httpStatic = "/home/pi/firmware"

Your files should be accessible from
Example http://192.168.0.113:1880/fw_ver9.bin

ps. adding the port 1880 or whatever port your Node-RED is running on is important

or with standard node-red nodes...

https://flows.nodered.org/flow/db68bd4934cf46f39e6e453a348bc419

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