Save camera image to dynamic file name in Node-Red

2.7k views Asked by At

I have a usb cam that take a picture from a node. But I want every image taken saved in different filename so that I can use all of images saved (not overwritten).

So my question is, how to make the file named from a function node that give an message.payload. I try use {{{msg.payload}}} but it doens't work. It just give a filename "{{{msg.payload}}}" instead of content in payload.

enter image description here

1

There are 1 answers

0
hardillb On BEST ANSWER

Only nodes that specifically support mustache syntanx can use the {{}}, for most nodes the convention is to leave the config blank and pass it into with a specific property on the input message. In this case the documentation explains which properties to set:

You could override with msg.filename the filename, with msg.filepath the filepath and msg.fileformat with the fileformat.

Taken from the info sidebar for the usbcamera node

This means you need to set the msg.filename in the input message to the node and leave the filename in the config window empty.