Skip to content

Esp32cam sd google drive #3

Open

Description

@Vicentetomas

Hi,

First of all. Congrats for your work.
I’m not sure if this is the right place to put this comment.
Regarding the Esp32cam sd google drive. Is it possible to give me an idea how to implement the follow?
Sometimes I don’t have an internet connection. I would like to store the images in the sd and when internet connection is on then upload all the files to the drive.

I hope you can help me how to do it.
Thank you for your time.

Activity

  1. fustyles commented on Mar 17, 2020

    @fustyles
    Owner

    You can create a file "list.txt" in SD to record the uploaded files name. If the images in SD are not in the list, upload them.

  2. Rudolf10000 commented on Jun 8, 2021

    @Rudolf10000

    Hi, also from my side congrats to this awesome "OPUS".
    I have the same issu with upload from SD card to Google Drive.
    I cant manage to imploy the .jpeg file from SD instead of camera fb->buf and fb->len

    `
    if(client_tcp.connect(myDomain, 443)) {
    Serial.println("Connection successful");
    // ############### here
    char *input = (char *)fb->buf;
    char output[base64_enc_len(3)];
    String imageFile = "data:image/jpeg;base64,";
    // ############### and here
    for (int i=0;i<fb->len;i++) {
     base64_encode(output, (input++), 3);
      if (i%3==0) imageFile += urlencode(String(output));
    }
    String Data = myLineNotifyToken+myFoldername+myFilename+myImage;
    
    client_tcp.println("POST " + myScript + " HTTP/1.1");
    client_tcp.println("Host: " + String(myDomain));
    client_tcp.println("Content-Length: " + String(Data.length()+imageFile.length()));
    client_tcp.println("Content-Type: application/x-www-form-urlencoded");
    client_tcp.println("Connection: keep-alive");
    client_tcp.println();
    
    client_tcp.print(Data);
    int Index;
    for (Index = 0; Index < imageFile.length(); Index = Index+1000) {
      client_tcp.print(imageFile.substring(Index, Index+1000));
    }
    

    `
    Could you put us on the right track ?
    If you can, i could complete my little project and share my upload handling here.
    Thanks again for your great job.

  3. fustyles commented on Jun 9, 2021

    @fustyles
    Owner

    Hi, also from my side congrats to this awesome "OPUS".
    I have the same issu with upload from SD card to Google Drive.
    I cant manage to imploy the .jpeg file from SD instead of camera fb->buf and fb->len

    `
    if(client_tcp.connect(myDomain, 443)) {
    Serial.println("Connection successful");
    // ############### here
    char *input = (char *)fb->buf;
    char output[base64_enc_len(3)];
    String imageFile = "data:image/jpeg;base64,";
    // ############### and here
    for (int i=0;i<fb->len;i++) {
     base64_encode(output, (input++), 3);
      if (i%3==0) imageFile += urlencode(String(output));
    }
    String Data = myLineNotifyToken+myFoldername+myFilename+myImage;
    
    client_tcp.println("POST " + myScript + " HTTP/1.1");
    client_tcp.println("Host: " + String(myDomain));
    client_tcp.println("Content-Length: " + String(Data.length()+imageFile.length()));
    client_tcp.println("Content-Type: application/x-www-form-urlencoded");
    client_tcp.println("Connection: keep-alive");
    client_tcp.println();
    
    client_tcp.print(Data);
    int Index;
    for (Index = 0; Index < imageFile.length(); Index = Index+1000) {
      client_tcp.print(imageFile.substring(Index, Index+1000));
    }
    

    `
    Could you put us on the right track ?
    If you can, i could complete my little project and share my upload handling here.
    Thanks again for your great job.

    I wrote a sample code for you.
    https://youtu.be/NLhK7RIUv1Q

    Source
    https://github.com/fustyles/Arduino/tree/master/ESP32-CAM_SD_GoogleDrive

  4. Rudolf10000 commented on Jun 12, 2021

    @Rudolf10000

    Thank you so much, fustyles.
    Unfortunately i can't make the sketch run.
    I get a guru meditation and reboot on this line

    fileinput[fileSize] = '\0';

    Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.
    Core 1 register dump:
    PC : 0x400d0cad PS : 0x00060c30 A0 : 0x800d1694 A1 : 0x3ffb1d90
    A2 : 0x3ffb1f80 A3 : 0x3ffc1b4c A4 : 0x3f40057e A5 : 0x3ffc1ae4
    A6 : 0x002d78d1 A7 : 0x3ffb1d90 A8 : 0x002d78d1 A9 : 0x00000000
    A10 : 0x3ffc1b4c A11 : 0x3f400273 A12 : 0x002d78d1 A13 : 0x3ffc6560
    A14 : 0x3ffc1ae4 A15 : 0xff000000 SAR : 0x00000008 EXCCAUSE: 0x0000001d
    EXCVADDR: 0x002d78d1 LBEG : 0x4008d331 LEND : 0x4008d341 LCOUNT : 0xffffffff

    ELF file SHA256: 0000000000000000

    Backtrace: 0x400d0cad:0x3ffb1d90 0x400d1691:0x3ffb1f50 0x400d57b2:0x3ffb1fb0 0x4008ef56:0x3ffb1fd0

    Seems the Guru appears because of a wrong String usage, but i am not so experienced in coding. I also tried a lot of different jpeg images and different AI Thinker esp32-cam boards
    I use Arduino IDE 1.8.15 and esp 1.0.6 (latest)
    What am i doing wrong ? Am i missing a custom string library?
    Thank you so much for your support.

  5. fustyles commented on Jun 14, 2021

    @fustyles
    Owner

    I think the error cauesd by other reasons. Did you modify my code?

  6. Rudolf10000 commented on Jun 14, 2021

    @Rudolf10000

    No , i did not modify.
    I installed the exception decoder and got :

    PC: 0x400d0c4f: sendSDImageToGoogleDrive(String) at C:\Users\rwolf\Documents\Arduino\Sketchbook
    ESP32-CAM_SD_GoogleDrive/ESP32-CAM_SD_GoogleDrive.ino line 177
    EXCVADDR: 0x0002b3a5

    This is Line 177 -
    fileinput[fileSize] = '\0';

    Decoding stack results
    0x400d0c4f: sendSDImageToGoogleDrive(String) at C:\Users\rwolf\Documents\Arduino\Sketchbook\ESP32-CAM_SD_GoogleDrive/ESP32-CAM_SD_GoogleDrive.ino line 177
    0x400d162d: setup() at C:\Users\rwolf\Documents\Arduino\Sketchbook\ESP32-CAM_SD_GoogleDrive/ESP32-CAM_SD_GoogleDrive.ino line 147
    0x400d574e: loopTask(void*) at C:\Users\rwolf\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\cores\esp32\main.cpp line 18
    0x4008ef56: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143

    Ater reading blogs about strings, i tried a lot of things, but without any result.
    Any idea what i am doing wrong ?
    I've never used malloc before. Could that be a reason ?

  7. fustyles commented on Jun 15, 2021

    @fustyles
    Owner

    Please email your sketch to me.
    france.fu@msa.hinet.net

    The sketch compiled well for me and my friends. You may need to update the latest supported Visual C++ redistributable packages. Try to update your computer OS to the latest version. Does your computer install Microsoft OS? Mine is Microsoft OS.

  8. fustyles commented on Jun 19, 2021

    @fustyles
    Owner

    Please try to remove all Chinese words in the sketch and compile again.

  9. lucasroth commented on Nov 8, 2021

    @lucasroth

    Hi @fustyles thanks for your video and code! I am getting a: "Guru Meditation Error: Core 1 panic'ed (LoadProhibited)" in the line:
    base64_encode(output, (input++), 3);
    after commenting out the line:
    fileinput[fileSize] = '\0';
    Where I get a core panic "Store Error" just like @Rudolf10000 stated.

    Any ideas of what might be happening? I had try with different sd cards has no changes, same errors described above, also no chinese words are in the sketch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions