# Capture Image and Saving image file Not Working Amb82 mini 8735B

**URL:** https://forum.amebaiot.com/t/capture-image-and-saving-image-file-not-working-amb82-mini-8735b/2693
**Category:** Multimedia
**Tags:** rtl8735b, evb-amb82
**Created:** [February 13, 2024, 3:53pm UTC](https://forum.amebaiot.com/t/capture-image-and-saving-image-file-not-working-amb82-mini-8735b/2693 "2024-02-13T15:53:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![HASSAN\_ALI](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/hassan_ali/32/1959_2.png) [@HASSAN\_ALI](https://forum.amebaiot.com/u/HASSAN_ALI)
#### Post date: [February 13, 2024, 3:53pm UTC](https://forum.amebaiot.com/t/capture-image-and-saving-image-file-not-working-amb82-mini-8735b/2693/1 "2024-02-13T15:53:46Z")

</div>

I have an amb 82 mini , RLTK8735B , I want to capture image and then store image in internal storage but file system is giving me errors. Currently I dont have an SD Card. I am providing you with my current code , please help me out:  
#include “VideoStream.h”

```auto
#include "AmebaFatFS.h"

#define CHANNEL 0
#define MAX_IMAGE_SIZE 50000 // Adjust this size according to your image size

// Use a pre-defined resolution, or choose to configure your own resolution
VideoSetting config(1024, 576, CAM_FPS, VIDEO_JPEG, 1);

uint32_t img_addr = 0;
uint32_t img_len = 0;

uint8_t imageBuffer[MAX_IMAGE_SIZE]; // Buffer to store the captured image data
uint32_t imageBufferSize = 0; // Variable to keep track of the image data size

AmebaFatFS fs;

void setup() {
    Serial.begin(115200);

    // Initialize the file system
    bool fsInit = fs.begin();
    Serial.print("File system initialization: ");
    Serial.println(fsInit ? "successful" : "failed");

    // Print the root path
    Serial.print("Root path: ");
    Serial.println(fs.getRootPath());

    // Configure camera and video settings
    Camera.configVideoChannel(CHANNEL, config);
    Camera.videoInit();
    Camera.channelBegin(CHANNEL);
}

void loop() {
    if (Serial.available() > 0) {
        char c = Serial.read();
        if (c == '1') {
            Serial.println("Capturing image...");

            // Capture the image
            Camera.getImage(CHANNEL, &img_addr, &img_len);
            Serial.println("Image captured.");

            // Check if image size exceeds buffer size
            if (img_len > MAX_IMAGE_SIZE) {
                Serial.println("Image size exceeds buffer size. Aborting.");
                return;
            }

            // Store the image data in the buffer
            memcpy(imageBuffer, (uint8_t*)img_addr, img_len);
            imageBufferSize = img_len;

            // Print the image size
            Serial.print("Image size: ");
            Serial.println(imageBufferSize);

            // Save the image from buffer to file
            File file = fs.open("/captured_image.jpg", FA_WRITE); // Specify file name and location
            if (file) {
                // Write image data to file
                file.write(imageBuffer, imageBufferSize);
                file.close();
                Serial.println("Image saved to file system.");
            } else {
                Serial.println("Error opening file for writing.");
            }
        }
    }

    delay(1000); // Add delay to prevent continuous capturing
}

```

I am getting this error:  
C:\Users\PMLS\Desktop\Amb82\storeandsend\storeandsend.ino: In function ‘void loop()’:  
C:\Users\PMLS\Desktop\Amb82\storeandsend\storeandsend.ino:61:64: error: no matching function for call to ‘AmebaFatFS::open(const char [20], int)’  
61 | File file = fs.open(“/captured\_image.jpg”, FA\_WRITE); // Specify file name and location  
| ^  
In file included from C:\Users\PMLS\Desktop\Amb82\storeandsend\storeandsend.ino:2:  
C:\Users\PMLS\AppData\Local\Arduino15\packages\realtek\hardware\AmebaPro2\4.0.6\libraries\FileSystem\src/AmebaFatFS.h:21:14: note: candidate: ‘File AmebaFatFS::open(const String&)’  
21 | File open(const String& path);  
| ^~~~  
C:\Users\PMLS\AppData\Local\Arduino15\packages\realtek\hardware\AmebaPro2\4.0.6\libraries\FileSystem\src/AmebaFatFS.h:21:14: note: candidate expects 1 argument, 2 provided  
C:\Users\PMLS\AppData\Local\Arduino15\packages\realtek\hardware\AmebaPro2\4.0.6\libraries\FileSystem\src/AmebaFatFS.h:22:14: note: candidate: ‘File AmebaFatFS::open(const char\*)’  
22 | File open(const char\* path);  
| ^~~~  
C:\Users\PMLS\AppData\Local\Arduino15\packages\realtek\hardware\AmebaPro2\4.0.6\libraries\FileSystem\src/AmebaFatFS.h:22:14: note: candidate expects 1 argument, 2 provided

Using library AmebaMultimedia at version 1.0.0 in folder: C:\Users\PMLS\AppData\Local\Arduino15\packages\realtek\hardware\AmebaPro2\4.0.6\libraries\Multimedia  
Using library AmebaFileSystem at version 1.0.0 in folder: C:\Users\PMLS\AppData\Local\Arduino15\packages\realtek\hardware\AmebaPro2\4.0.6\libraries\FileSystem  
exit status 1

Compilation error: no matching function for call to ‘AmebaFatFS::open(const char [20], int)’

---

<div class="post-metadata">

### Author: ![Pammy](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/pammy/32/936_2.png) [@Pammy](https://forum.amebaiot.com/u/Pammy)
#### Post date: [February 14, 2024, 5:30am UTC](https://forum.amebaiot.com/t/capture-image-and-saving-image-file-not-working-amb82-mini-8735b/2693/2 "2024-02-14T05:30:35Z")

</div>

Hi @HASSAN_ALI ,  
Currently, AMB82 mini does not have storing data in Flash feature. Hence, you can only save the images in SD Card for now instead of internal storage.

---

<div class="post-metadata">

### Author: ![HASSAN\_ALI](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/hassan_ali/32/1959_2.png) [@HASSAN\_ALI](https://forum.amebaiot.com/u/HASSAN_ALI)
#### Post date: [February 14, 2024, 8:39am UTC](https://forum.amebaiot.com/t/capture-image-and-saving-image-file-not-working-amb82-mini-8735b/2693/3 "2024-02-14T08:39:56Z")

</div>

Alright , thanks for your response.

---

<div class="post-metadata">

### Author: ![M-ichae-l](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/m-ichae-l/32/33_2.png) [@M-ichae-l](https://forum.amebaiot.com/u/M-ichae-l)
#### Post date: [August 6, 2024, 7:07am UTC](https://forum.amebaiot.com/t/capture-image-and-saving-image-file-not-working-amb82-mini-8735b/2693/4 "2024-08-06T07:07:59Z")

</div>

You may want to refer to this new version [Release Pre Release Version 4.0.8 · ambiot/ambpro2\_arduino · GitHub](https://github.com/ambiot/ambpro2_arduino/releases/tag/V4.0.8-QC-V03)
