ESP32CAM JPEG Upload to Node-Red Server

Hello everybody,

I have the following script, which sends an image to the Node-Red Port every 10 seconds: XX.XX.XXX.XXX:1880/imageUpdate

I would like to receive and save the images via Node-Red logic later for further processing and image recognition logic.

ESP32CAM coding: https://hastebin.com/ejewutadoj.js

I created the flow below as a starting point.

The requests arrive somehow, but the images cannot be saved.

When I use instead of Node-Red just a simple Node.JS script with another port 8880 and post the image in that ESPCoding to that Port, the image can be correctly posted and saved.

Node-Script: https://ghostbin.com/paste/BiwjB

Does anyone have a template where pictures can be received from an ESP32Cam using the HTTP Post Request?

Is the "File" node correct when the images arrive in Node-Red, can I then save the files directly to a folder or do I need to convert them first to another format?

Its right, the HTTP image posts need to be posted to Port 1880?

in the debug section I can see the message:

<Input should be a buffer or a base64 string or a Jimp image (containing a jpg or png image)>

Hi Markus,

Welcom to our forum!

The msg.payload of your input message contains a string. But the node-red-contrib-image-output expects the images to arrive (like you see in your debug panel) as Buffer or as base64 encoded string. Seems to me that your image is a string, but not base64 encoded.

Not sure how to solve this:

  • do a base64 encoding in your esp32 script (if possible...)
  • convert the string to base64 (via the base64 node) in Node-RED
  • convert the string to a buffer in Node-RED
  • ...

Hopefully somebody else can jump in now ...
Bart

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