Using RLottie with LVGL

I’m trying to build LVGL with an RLottie lib and I’m receiving some errors. Just wondering if anyone has any advice to get this to work.

I’m on an ESP32 S3, building in Platformio on a Debian system. LVGL 8.3.8. Rlottie builds fine, and I can reference it using -Lrlottie as a build_flag. lv_conf.h is included and LV_USE_RLOTTIE is set to true (1). I am including rlottie.h in my main.cpp file.

When I compile I receive a ton of these warnings, and finally a failure. Am I missing something basic?

Executing task: platformio run

Processing esp32s3box (platform: espressif32; board: esp32s3box; framework: arduino)

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: Redirecting...
PLATFORM: Espressif 32 (6.3.2) > Espressif ESP32-S3-Box
HARDWARE: ESP32S3 240MHz, 320KB RAM, 16MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:

  • framework-arduinoespressif32 @ 3.20009.0 (2.0.9)
  • tool-esptoolpy @ 1.40501.0 (4.5.1)
  • toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
  • toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
    LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 34 compatible libraries
    Scanning dependencies…
    Dependency Graph
    |-- Wire @ 2.0.0
    |-- lvgl @ 8.3.8
    Building in release mode
    Compiling .pio/build/esp32s3box/src/main.cpp.o
    Linking .pio/build/esp32s3box/firmware.elf
    /home/eightline/.platformio/packages/toolchain-xtensa-esp32s3/bin/…/lib/gcc/xtensa-esp32s3-elf/8.4.0/…/…/…/…/xtensa-esp32s3-elf/bin/ld: .pio/build/esp32s3box/lib3fc/liblvgl.a(lv_rlottie.c.o):(.literal.lv_rlottie_destructor+0x0): undefined reference to lottie_animation_destroy' /home/eightline/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/esp32s3box/lib3fc/liblvgl.a(lv_rlottie.c.o):(.literal.lv_rlottie_constructor+0x20): undefined reference to lottie_animation_from_data’
    /home/eightline/.platformio/packages/toolchain-xtensa-esp32s3/bin/…/lib/gcc/xtensa-esp32s3-elf/8.4.0/…/…/…/…/xtensa-esp32s3-elf/bin/ld: .pio/build/esp32s3box/lib3fc/liblvgl.a(lv_rlottie.c.o):(.literal.lv_rlottie_constructor+0x24): undefined reference to lottie_animation_get_totalframe' /home/eightline/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/esp32s3box/lib3fc/liblvgl.a(lv_rlottie.c.o):(.literal.lv_rlottie_constructor+0x28): undefined reference to lottie_animation_get_framerate’
    /home/eightline/.platformio/packages/toolchain-xtensa-esp32s3/bin/…/lib/gcc/xtensa-esp32s3-elf/8.4.0/…/…/…/…/xtensa-esp32s3-elf/bin/ld: .pio/build/esp32s3box/lib3fc/liblvgl.a(lv_rlottie.c.o):(.literal.lv_rlottie_constructor+0x30): undefined reference to lottie_animation_from_file' /home/eightline/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/esp32s3box/lib3fc/liblvgl.a(lv_rlottie.c.o):(.literal.next_frame_task_cb+0x0): undefined reference to lottie_animation_render’
    /home/eightline/.platformio/packages/toolchain-xtensa-esp32s3/bin/…/lib/gcc/xtensa-esp32s3-elf/8.4.0/…/…/…/…/xtensa-esp32s3-elf/bin/ld: .pio/build/esp32s3box/lib3fc/liblvgl.a(lv_rlottie.c.o): in function lv_rlottie_destructor': /home/eightline/Documents/PlatformIO/Projects/CircleLCD/lib/lvgl/src/extra/libs/rlottie/lv_rlottie.c:161: undefined reference to lottie_animation_destroy’
    /home/eightline/.platformio/packages/toolchain-xtensa-esp32s3/bin/…/lib/gcc/xtensa-esp32s3-elf/8.4.0/…/…/…/…/xtensa-esp32s3-elf/bin/ld: .pio/build/esp32s3box/lib3fc/liblvgl.a(lv_rlottie.c.o): in function lv_rlottie_constructor': /home/eightline/Documents/PlatformIO/Projects/CircleLCD/lib/lvgl/src/extra/libs/rlottie/lv_rlottie.c:114: undefined reference to lottie_animation_from_data’
    /home/eightline/.platformio/packages/toolchain-xtensa-esp32s3/bin/…/lib/gcc/xtensa-esp32s3-elf/8.4.0/…/…/…/…/xtensa-esp32s3-elf/bin/ld: /home/eightline/Documents/PlatformIO/Projects/CircleLCD/lib/lvgl/src/extra/libs/rlottie/lv_rlottie.c:124: undefined reference to lottie_animation_get_totalframe' /home/eightline/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: /home/eightline/Documents/PlatformIO/Projects/CircleLCD/lib/lvgl/src/extra/libs/rlottie/lv_rlottie.c:126: undefined reference to lottie_animation_get_framerate’
    /home/eightline/.platformio/packages/toolchain-xtensa-esp32s3/bin/…/lib/gcc/xtensa-esp32s3-elf/8.4.0/…/…/…/…/xtensa-esp32s3-elf/bin/ld: /home/eightline/Documents/PlatformIO/Projects/CircleLCD/lib/lvgl/src/extra/libs/rlottie/lv_rlottie.c:151: undefined reference to lottie_animation_from_file' /home/eightline/.platformio/packages/toolchain-xtensa-esp32s3/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: .pio/build/esp32s3box/lib3fc/liblvgl.a(lv_rlottie.c.o): in function next_frame_task_cb’:
    /home/eightline/Documents/PlatformIO/Projects/CircleLCD/lib/lvgl/src/extra/libs/rlottie/lv_rlottie.c:269: undefined reference to `lottie_animation_render’
    collect2: error: ld returned 1 exit status
    *** [.pio/build/esp32s3box/firmware.elf] Error 1
    ============================================================================= [FAILED] Took 3.34 seconds =============================================================================

Code sample to display a simple lottie animation:

  lv_obj_t * lottie = lv_rlottie_create_from_file(lv_scr_act(), EXAMPLE_LCD_V_RES, EXAMPLE_LCD_H_RES, "animation.json");
  lv_obj_center(lottie);
  lv_rlottie_set_play_mode(lottie, LV_RLOTTIE_CTRL_FORWARD);

Platformio.ini setup:

[env:esp32s3box]
platform = espressif32
board = esp32s3box
framework = arduino
build_flags =
    -Lrlottie

Nobody? I too plan test lottie and info is helpfull. You solve?
I mean your ini line need more commands , try read build_flags — PlatformIO latest documentation

No luck yet, but I’ve seen Lottie in LVGL showing up in YouTube videos. The key difference is they’re running on ESP-IDF instead of Arduino. I’m spending the weekend trying to learn ESP-IDF but I’m currently stuck with my ESP crashing on boot.

If you get anywhere I’d love to compare notes.

Can you show steps how you build

The build instructions in the 3rd party libraries page worked for me. I think I had a few prerequisites to install first, but after that was handled it compiled fine. I’m a bit confused about the -lrlottie flag, Had to use a capital -L in the Platformio project config.

mkdir rlottie_workdir 
cd rlottie_workdir 
git clone https://github.com/Samsung/rlottie.git 
mkdir build 
cd build 
cmake ../rlottie 
make -j 
sudo make install

And finally add the `-lrlottie` flag to your linker.

This implement it into Debian and no into ESP. You skip important line

On embedded systems you need to take care of integrating Rlottie to the given build system.

Looking into this more, and I’m not sure how to do this. In my platformio.ini I have tried adding lib_deps with various paths to the library, build_flags = -Lrlottie. I’ve also tried pio pkg install but the system responds Already up to date. I’ve mentioned above that I’ve already built and installed the rlottie package. I’ve also tried adding the rlottie/build directory to the /libs directory of my project. Is there a step that I’m missing?

Would be nice to have some kind of pre-build rlottie ‘library’ which you just can add to our platformio projects for use with arduino.
Would love to use lottie files in my projects, but most of my projects are arduino based, not esp-idf…