Hello all,
I am looking for a solution for the following:
- use a ESP CAM board to take pictures and store them in a SD card
- archive the images in a single file (daily/weekly/monthly)
- Serve a webpage with download links to the archives.
The taking pictures and serving wepbages part is simple enough, there are many samples avalable.
But i cannot find anything for archiving. And my coding skills are not that advanced to start from scratch.
The ideal solution would be having montly packages of about 100MB worth of images.
Can anyone give me some pointers on this? is this possible or practical on the ESP32?
Thank you
Tar File Creation
Re: Tar File Creation
I use microtar ( https://github.com/rxi/microtar ) for something similar. Seems to work pretty well.
Jason
Jason
Re: Tar File Creation
Hi Jason,
Thank you very much for the quick reply. I would just like to bother you a few minutes more.
I am trying to use it with Arduino and the code compiles file:
but i don't know how to write the archive to the sd card
from the ESP32 CAM sd card example i have:
that saves the img to the sd card, how can i adapt this to save the tar file instead.
Also does this library rewrite the tar file every time we add a new file?
Thank you
Thank you very much for the quick reply. I would just like to bother you a few minutes more.
I am trying to use it with Arduino and the code compiles file:
- camera_fb_t * fb = NULL;
- // Take Picture with Camera
- fb = esp_camera_fb_get();
- mtar_t tar;
- mtar_open(&tar, "test.tar", "w");
- mtar_write_file_header(&tar, "test.jpg", fb->len);
- mtar_write_data(&tar, fb->buf, fb->len);
- mtar_finalize(&tar);
- mtar_close(&tar);
from the ESP32 CAM sd card example i have:
- File file = fs.open(path.c_str(), FILE_WRITE);
- if(!file){
- Serial.println("Failed to open file in writing mode");
- }
- else {
- file.write(fb->buf, fb->len); // payload (image), payload length
- Serial.printf("Saved file to path: %s\n", path.c_str());
- }
- file.close();
Also does this library rewrite the tar file every time we add a new file?
Thank you
Who is online
Users browsing this forum: No registered users and 84 guests