Read data to buffer and write it to mysql

Hello,

I'm new to node red and I want to develop a project that consists os reading data from modbus devices (already done), and buffer the data (to csv file or buffer), after I want to save the same data do mysql(also managed to save to my sql). I need to buffer the data because I don't want to loose any data if the DB connection goes down.
I main problem at the moment is I don't know how to clear the data once it's written to the DB. I already managed to save to file, and ringbuffer. But I'm lost with the part of managing the data while writing it to the DB.
Any help will be appreciated.

Cheers,

P

Welcome to the forum @ELParreira

This flow should do what you want. It queues messages until they are successfully handled. It can even retain them over a node-red or system restart if that is required. Ask if you can't work out how to use it for your application.
https://flows.nodered.org/flow/05e6d61f14ef6af763ec4cfd1049ab61

Perfect. Thank you Colin. I hope with time I get better with node red.
Cheers

1 Like

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