NPLPRS
11 December 2019 17:39
1
Hi All,
I have node red collecting data from a USB serial port. The data comes in, gets a timestamp added to it and then sent onto a log file on the Raspberry Pi desktop.
I would like Nodered to then automatically email the stored log file every 6 hours to a pre-set email address. I can get Nodered to send emails just fine but cannot for the life of me work out how to send the log file!
Thanks for the help.
Nick
Well the info on the right should help you... it points to creating a msg.attachments array pointing at the file. A function like this
msg.attachments = [
{
filename: 'yourfile.log',
path: '/path/to/yourfile.log'
}
];
NPLPRS
16 December 2019 10:59
3
Thanks for the help! Still struggling though, i have no idea how to do this.
Do I put the function node you mentioned before or after log file node?
I cant believe its so hard to send an automatic email of a log file a few times a day!
Many thanks
Nick
after the file log node would be best.
If you are able to share your flow file it would be easier to advise.
NPLPRS
16 December 2019 15:07
6
Thanks - heres the pic.
The function node in between the serial port and the log simply adds a timestamp.
Thanks
Nick
I was thinking more the actual flow file
To share code samples or flow json in this forum, you need to take care to format it properly so that it is displayed correctly.
The easiest way to do that is to click the 'Preformatted Text' button in the toolbar:
[image]
Then paste in your code or flow json.
You should end up with three back-tick characters - ``` - on their own line before and after the code.
On standard US English keyboards, this is on the same key as the ~ character.
[IMG_20181111_155651]
Using the backticks will ens…