how to 'backup' data? In fact just one item

obod0002
Posts: 22
Joined: Sat Apr 13, 2019 2:34 pm

how to 'backup' data? In fact just one item

Postby obod0002 » Sun Jul 21, 2019 10:02 am

in one of my projects I'm trying to automate the irrigation for some bucket plants.
I'm topping up an existing irrigation system that waters the plants once every 24h (in fact whenever the system is being connected to mains).

As in high temperatures the plants need more water than when it's cloudy or temperatures are lower, I'm using an ESP to control how often the watering process starts a day.
I created a web page so I can manually control how many times a day the irrigation shall take place.

However, when the mains is down, even just for a few seconds, the last setup vanishs.

As in another project I frequently upload data to ThingSpeak I thought that might be a possible solution: when set via the web page I stored the value in one of the unused fields of an existing ThingSpeak channel. When the ESP starts up again it first reads that last value and off we go.

But there's a big disadvantage: when using a field of an existing channel you're uploading data to for other fields very frequently it's a bit tricky to collect the last value of a field that was seldomly updated. You might have to read thousands of values - not ideal.

The ESP is connected by WiFi to my router (a Fritzbox with a USB drive and a NAS attached) .
I beg there's a simple solution but can't find it.

Do you have any suggestions on how to solve this challenge?

mikemoy
Posts: 627
Joined: Fri Jan 12, 2018 9:10 pm

Re: how to 'backup' data? In fact just one item

Postby mikemoy » Sun Jul 21, 2019 11:19 am

Can you use any of the examples / methods from the storage folder?
https://github.com/espressif/esp-idf/tr ... es/storage
The ESP is connected by WiFi to my router (a Fritzbox with a USB drive and a NAS attached) .
I beg there's a simple solution but can't find it.
You could also create a TCP client and grab a file stored on your NAS to get your data, update it and save the file back there.

obod0002
Posts: 22
Joined: Sat Apr 13, 2019 2:34 pm

Re: how to 'backup' data? In fact just one item

Postby obod0002 » Mon Jul 22, 2019 1:37 pm

thanks for your post. TCP sounds interesting, but at the moment also too sophisticated for me.
I'll check when I found a simple sample.

Who is online

Users browsing this forum: No registered users and 63 guests