Notice for UNITCAM users, IDF and Arduino IDE



  • Hi, just want to address users of the M5Stack UNITCAM which are trying or want to try the Arduino IDE Framework, or the ESP-IDP Framework.

    There is a bug introduced somewhere this year (2021) in the "ESP32-camera" Software, which causes all ESP32 CAMERA DEVICES WITHOUT PSRAM to fail when executing the camera initialization code...
    The problem is created during the compilation procedure, where PSRAM is ALWAYS selected, independent of the setup that the user does, and independent if the device has or do not have PSRAM...
    So, the binary code ALWAYS try to use PSRAM, causing a CRASH in the execution...
    Which may produce an error message like this:

    [error message]

    E (127) cam_hal: cam_dma_config(280): frame buffer malloc failed
    E (127) cam_hal: cam_config(364): cam_dma_config failed
    E (127) camera: Camera config failed with error 0xffffffff
    Camera init failed with error 0xffffffff 
    

    This problem is reported here on the ESP32-Camera Github development website:

    [issue on GitHub]
    https://github.com/espressif/esp32-camera/issues/334

    In the beginning, after trying several different samples, and all of them giving the same error message, I started to think that my unit has a hardware problem with the camera... but, then I saw the Github issue report, which makes perfect sense for my case...

    I then downloaded older versions of the ESP32-Camera software and test with success in the first attempt.
    First I did with ESP-IDF Programming Framework, success!

    Then, I search on how to use older soft/libraries with the Arduino IDE, found the information on the Espressif website and tried old version (about the same time/day of the IDF code I had selected), and it WORKED OK!

    [How to install esp32 on Arduino - Espressif site]
    https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html

    So, a temporary solution for the problem is:
    DOWNLOAD AN OLD VERSION (COMMIT) OF THE ESP32-CAM, it was working OK in the past...
    I did not check WHEN, exactly, the bug was introduced, which I think is somewhere between FEBRUARY and AUGUST of 2021...
    For me, 2021/FEB/22 versions works OK...

    This problem seems very simple and easy to correct, so we must expect that in few days a solution is announced on the ESP32-Camera Github development website...

    I am writing 2 little texts explaining how to use old version of the ESP32-Camera.
    The first is about ESP-IDF Framework, the second Arduino IDE, and I will post/publish here...

    Knowing how to use different versions of the code is VERY helpful in many circumstances, and can give the user another level of understanding when using code samples or when trying to create/modify code, so I think that it is worth to know about.
    There are thousands of good projects/samples/tutorials on Internet, and many of them will work fine and well, ONLY when we use old versions of some software components, so, learning how to use old versions (or different) can be interesting...

    In this present post I just want to inform UNICAM users that, for ESP-IDF and Arduino IDE, using the camera may return errors like the one in the top of this post, and what the reason is... so there is an easy solution, which is: USE OLD VERSIONS OF THE CODE!

    Next posts I will explain the details about using old versions (also called commits) of the code, for IDF and for Arduino IDE.

    Regard all,
    Valter