Display an online_image in lvgl

I’m trying to display without success in ili9xxx one dynamic image located in my own network. If I use image to define the image it works perfectly but as I need something dynamic I’m using online_image combined with image and it doesn’t work:

.....
display:
  - platform: ili9xxx
    id: tft_display
    model: TFT 2.4 
    cs_pin: GPIO5
    dc_pin: GPIO4
    reset_pin: GPIO22
    rotation: 0
    invert_colors: false
    update_interval: never
...
online_image:
  - url: http://192.168.1.103:8080/local_file/foto_falecido.png # Dynamic picture 
    id: foto_falecido
    type: RGB565
    format: png
    transparency: alpha_channel
    resize: 80x106
    update_interval: 60s
    on_download_finished:
      - logger.log: "Download concluded waiting LVGL display." # Only for test if donwload is running.
      - lvgl.image.update:
          id: foto_falecido_img
.....
lvlg:
.....
....
  widgets:
    ....
    - image:
        id: foto_falecido_img
        x: 50
        y: 50 
        src: foto_falecido
.....

No log errors, but no Image in the display, the logger.log is also ok, there are other images in display working perfect.

If I replace online_image by image it works perfect but i can’t change the picture every minute.

logs:

....
[16:42:45][I][online_image:102]: Updating image http://192.168.1.103:8080/local_file/foto_falecido.png
[16:42:45][D][http_request.arduino:141]: Content-Length: 17969
[16:42:45][D][online_image:154]: Starting download
[16:42:45][D][online_image:171]: Allocating PNG decoder
[16:42:45][I][online_image:188]: Downloading image (Size: 17969)
[16:42:45][D][online_image:202]: Image fully downloaded, read 17969 bytes, width/height = 80/106
[16:42:45][D][online_image:203]: Total time: 0s
[16:42:45][D][main:989]: Download concluded waiting LVGL display.

I’m not familiar with the component, but you could test what happens if you set initially some other image and then on_download_finished update the src.

    - lvgl.image.update:
        id: foto_falecido_img
        src: foto_falecido

yes, you have to specify what you want to update.

Thanks a lot, is working now.

1 Like