Backup without removing the SD-card

Is it possible to make a backup of all the logs (more then 2 years) without removing the SD-card. Can I do it from the ‘file manager and editor’ over the browser? Witch files have to be copied?
I couldn’t find an answer here.
Thanks.

It’s not possible right now. A watchdog timer will restart the IoTaWatt after 5 minutes.

You would need to power down the IoTaWatt and carefully remove the SDcard. Then mount it on a computer and copy all of the files and directories to a directory on your computer. It doesn’t take very long. Then replace the SD and restart the IoTaWatt.

99% of the card contents are the datalogs, so just copy everything. Then if your card should fail, you can simply copy the entire backup to a new card and pickup from the point of the backup.

I’m working on adopting some improvements that have the potential of speeding things up enough to allow downloading the history file in a reasonable amount of time. If that works out it should be available in a few months.

Be careful removing the card, they break easily if not pulled straight out.

Thanks a lot. You are doing a great job.
Could you estimate, how long an SD-card wil work? Would it be usefull to change the card precautionary? What specifications are needed to get a card with maximum lifecycles?

IoTaWatt doesn’t cause a lot of wear to an SDcard. Most blocks get written once or twice per year and a typical block should have a life of 100K or so writes. Reads are free.

I’m told there are grades of quality. I’m not so sure about that. I don’t know of any longevity metrics that they are certified to. There are various claims by the brands, but as far as I know there is no independent verification of that. There are definitely faster cards, and I’ve found there is slightly better response in Graph+ with an SDHC class 10 card.

One of my systems has been using the same card for 4 years. It is one of the inexpensive class 4 Sandisk cards that is supplied with a new IoTaWatt. You probably have a higher probability of losing your data by damaging it during removal.

@overeasy, this is an interesting thread, and I just read these as well:


I’m coming up on my 1-year anniversary of my first IoTaWatt (yea!) and have not yet exported my data to the supported external databases. So, I was thinking of using the APIs to extract all the data to save it before the IoTaWatt runs out of space and may flush the oldest data out.

So, from what I gather from these threads, a 1-minute interval is what I should use for the API calls (that’s sufficient resolution for me for long-term data)?

Alternatively, should I decide to remove the microSD card and copy it, what format are the datalogs / history logs, that I may extract the data from there manually?

And, for completeness here, docs say:
https://docs.iotawatt.com/en/02_05_12/query.html

“The datalog contains measurements at 5 second (current log) and 1 minute (history log) intervals.”

I’m not finding how long the datalog goes back in time for the 5-second resolution…?

The Data Logs tab at the bottom of the status display shows the start and end dates of the current and history logs. When the current log fills up, it wraps so you will see the begin date advance each time the a new entry overwrites the oldest entry.

It’s not advisable to download the logs with query. Better to upload to an external batabase with the uploaders. IMO old 5 second data doesn’t have much value. Typical queries of historic data are looking for energy (kWh) rather than power (Watts). TBH I never look at Watts more than a week back, and Wh at less than a minute, or even less than an hour, is micro-managing and not very useful.

You can do that to backup. It’s typically pretty fast. I’d recommend bathing the history log. It’s smaller than the current and really all you need. The format is not anything I’d try to explain in a forum post. It’s pretty complicated and also there are issues with the little-endian byte order of the ESP8266.

But you can restore a backup log to your SDcard. The proper way is to remove the SDcard, delete both logs, and then copy in the backed up log.