-
-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use MQTT topic as an image source #685
Comments
I don't have a better way. I am using sending a weather image using automation HA
|
Not sure you can have a binary file as a payload image with HA. The mqtt docs seem to suggest that payloads are converted to strings before being published. |
This is not something I'm keen on supporting, since the overhead of sending images over MQTT is substantial. |
@fvanroie I only started using openHASP recently because i got Sunton ESP32-2432S028 on offer , i really like what you did , amazing work . I was able to use bin images loaded internally but only few of them . Being able to use external images i think would be a great addition, not really sure using HA is ideal ,what do you think the best was to do so even if we need to buy better devices but would also be nice that we could use what we have as the 4MB ESP32 is still very common and we have a ton of them and external display is very cheap . |
You can not defy hardware limitations in software: Dynamic images require RAM. The ESP32-2432S028 doesn't even have PSram. Decoding JPEG or PNG require RAM and CPU resources, both of which are very limited on the ESP32. Hence the decoding from JPEG/PNG to BIN is done in Home Assistant as not to burden the ESP32 too much. Maybe it is not ideal for your use-case, but that doesn't mean openHASP should take over that processing job. Maybe you can implement an image proxy or something on a HTTP server if that fits your scenario better... Again, I don't think this necessarily needs to be done on the end device. Unfortunately, a $4 ESP32 can't do the same tasks as a PC or a phone. |
Thank you yes i think that makes sense and ESP32-2432S028 i got on offer was only $2 ,we will try to work on the image conversion if something could be done but I did also face somewhat the same issues with Tasmota and lvgl so i hope that will not be just a dead end |
It depends on the size of the image and the free memory of the device... I guess you're going to need PSram for anything larger than 64x64 or so |
I looked into our stock and found few esp32 cam , will that do ?The aim is just to display images hosted on external server , nothing fancy and touch is not needed so any display is okay . Did not see that mentioned with openHASP |
@fvanroie Sorry this is off topic but - I don't use HA, but I do use a http image source pointing to a png on my node red server. From the above would it be more efficient to convert to bin and host the BIN file ? |
Yes indeed. PNG/JPEG can't be used directly in LVGL and have to be decoded to BIN first. This happens in memory on the ESP32. |
Showing images in a panel is quite static, and the image files have to be locally stored.
I want to be able to send images from HA to the screen.
One solution to this is in PR #643, but it appears to have limitations due to memory usage and possible loss of OTA upgrades on older screens.
A better solution, I think, would be to have the image src parameter listen to an mqtt topic. (Ref #643, which is a good idea in itself).
Then I could say { id: "p2b10", obj: "img", ... , src: "mqtt:weatherforecast1" }
In HA I would then publish to mqtt { topic: "hasp/panel1/weatherforecast1", payload: theimage }.
The image format should be png or whatever OpenHASP can handle, encoded in a standard way.
The text was updated successfully, but these errors were encountered: