Automatically write sensor data to new folder after midnight

Hi guys, :slight_smile:

I have just started to work a bit more intensively with Node Red, as part of a project. In the project are many temperature sensors (DS18B20) on a machine and measure the temperature for several weeks.

For this I have a raspi with Node Red, which communicate via a router with the microcontrollers NodeMCU ESP8266. Every 5 min the temperature is measured. Because I have a lot of sensors and the measurements last for several weeks, I don't want to copy the data from the raspi to the PC every evening via the software WinSCP by drag&drop and then delete the data on the raspi again.

Surely there is a way to write a function that writes the data into a new folder from midnight and no more data must be moved manually into a folder? :thinking:
So, as a result, I should have about 15 folders after the measurements, each containing the measurement data from each sensor from that day.

Unfortunately I have no idea how to create this function or what I would have to write in the function.

PS: The raspi has no access to the internet, therefore currently no time, that I still have to realize with a RTC module.

I would be very grateful if you could help me. :slight_smile:

Have you considered writing all data to a database? It would be much easier in the long run.

Yes, I had already tried that, but unfortunately it did not work as well as I wanted (but maybe it was also me that I had not chosen a good or simple database).
Currently the measurement process works fine, so I just want to remove the annoying drag&drop part.
A function that creates a folder based on the date would be the easiest solution in my opinion.

By the way, which database would you recommend to me?

If you are storing sensor data the InfluxDB (v1.8.5 NOT v.2.x as the query syntax has a steep learning curve), in combination with Grafana for displaying your data.

If you could install InfuxDB on a computer with internet access you would not need to worry about time on the Pi as the database timestamps are created automatically in InfluxDB.

Unfortunately there is no possibility to provide internet access on site.

With Grafana ob the pi, only my graphics would look better?

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