Missing library but i got this - very confusing

hello, I switched from arduino to platformIO in VScode around 2 weeks ago and still some things are kinda different for me. I’ve got example program using esp32cam module and I want to test it using library from github BUT here my complicates are begin. In platformio.ini file paste url form github

lib_deps = https://github.com/eloquentarduino/EloquentArduino.git

like this and in main.cpp file I’ve got error message like this

*** [.pio/build/esp32cam/src/main.cpp.o] Error 1
Compiling .pio/build/esp32cam/FrameworkArduino/wiring_shift.c.o
======================================================== [FAILED] Took 1.77 seconds ========================================================

also there is very straight forward explanation how to install this library by author here

https://eloquentarduino-github-io.translate.goog/2019/12/how-to-install-the-eloquent-library/?_x_tr_sl=en&_x_tr_tl=de&_x_tr_hl=en-GB&_x_tr_pto=op,sc

and I’m very confusing why I have problem with so simple things.
There is some one who might know why I got this error message??

None of the examples are including eloquentarduino.h, but just eloquent.h. Where do you have your example code from? Or did you just assume that the header file you have to include is equal to the library name?

https://github.com/eloquentarduino/EloquentArduino/blob/master/examples/Camera/CameraCaptureExample/CameraCaptureExample.ino#L5-L5

what exactly do you mean? I’m based on this code

#define CAMERA_MODEL_M5STACK_WIDE

// include the relevant libraries
#include <FS.h>
#include <SPIFFS.h>
#include <eloquentarduino.h>
#include <eloquentarduino/io/serial_print.h>
#include <eloquentarduino/vision/camera/ESP32Camera.h>
#include <eloquentarduino/vision/io/decoders/Red565RandomAccessDecoder.h>
#include <eloquentarduino/vision/io/writers/JpegWriter.h>

// define the source format and the downscaled dimensions
#define FRAME_SIZE FRAMESIZE_QVGA
#define PIXFORMAT PIXFORMAT_RGB565
#define W 320
#define H 240
#define w 32
#define h 24
// tweak these values as per your need
#define DIFF_THRESHOLD 15
#define MOTION_THRESHOLD 0.15

// delete the second definition if you want to turn on code benchmarking
#define timeit(label, code) { uint32_t start = millis(); code; uint32_t duration = millis() - start; eloquent::io::print_all("It took ", duration, " millis for ", label); }
#define timeit(label, code) code;

using namespace Eloquent::Vision;

camera_fb_t *frame;
Camera::ESP32Camera camera(PIXFORMAT);
IO::Decoders::Red565RandomAccessDecoder decoder;
Processing::Downscaling::Center<W / w, H / h> strategy;
Processing::Downscaling::Downscaler<W, H, w, h> downscaler(&decoder, &strategy);
Processing::MotionDetector<w, h> motion;
IO::Writers::JpegWriter<W, H> jpegWriter;

void capture();
void save();

void setup() {
    Serial.begin(115200);
    SPIFFS.begin(true);
    delay(1000);
    Serial.println("Begin");

    camera.begin(FRAME_SIZE);
    // set how much a pixel value should differ to be considered as a change
    motion.setDiffThreshold(DIFF_THRESHOLD);
    // set how many pixels (in percent) should change to be considered as motion
    motion.setMotionThreshold(MOTION_THRESHOLD);
    // prevent consecutive triggers
    motion.setDebounceFrames(5);
}

void loop() {
    capture();
    eloquent::io::print_all(motion.changes(), " pixels changed");

    if (motion.triggered()) {
        Serial.println("Motion detected");

        // uncomment to save to disk
        // save();

        delay(1000);
    }

    delay(30);
}

void capture() {
    uint8_t downscaled[w * h];

    // capture image
    timeit("capture frame", frame = camera.capture());

    // scale image from size H * W to size h * w
    timeit("downscale", downscaler.downscale(frame->buf, downscaled));

    // detect motion on the downscaled image
    timeit("motion detection", motion.detect(downscaled));
}

void save() {
    File imageFile = SPIFFS.open("/capture.jpg", "wb");
    uint8_t quality = 30;

    eloquent::io::print_all("The image will be saved as /capture.jpg");
    jpegWriter.write(imageFile, frame->buf, PIXFORMAT, quality);
    imageFile.close();
    eloquent::io::print_all("Saved");
}

my code is from this blog

https://eloquentarduino.github.io/2021/01/esp32-cam-motion-detection-with-photo-capture-rgb-version/

and library add here. and after that I started to doubt what I was doing :slight_smile:

And I’m telling you the current library version doesn’t have that header. The previous stable one does though: EloquentArduino/src at 2.0.1 · eloquentarduino/EloquentArduino · GitHub

So just add #2.0.1 behind your lib_deps expression?

Okay, I didn’t know the header name changed in version 2.0.1. I just followed the guide.
so like u said .
I changed the name of the library, oh yes or no.

i still have error message.

Now I see that the author has added a code fix

https://github.com/eloquentarduino/EloquentArduino/blob/master/examples/Camera/CameraCaptureExample/CameraCaptureExample.ino

I meant append, not replace there

in both scenario is the same result

now I got this like u said and error stays . What I’m doing wrong?

No space between the .gitand the hash! :smiley:

Also needs two more #include lines to compile properly with the new library version.

See