I would like to show an image on my dashboard.
The image(s) is located on a network share.
Node red is running on a ubuntu server.
I tried with node-red-contrib-image-tools but without success.
I would also like to handle it only with the template node.
Can I change the //httpstatic to link on a network drive?
Does anybody have an exsample how to do it?
Use a file in node to read the remote share file. Set it to read a binary buffer. Once you have that working, pass the file buffer through a base64 node. Lastly, follow one of the many posts on the forum about displaying a base64 image in ui template.
But first, get the file loading from your network share into a buffer before worrying about displaying it (thats the easy part)
thank you for the advice.
I installed samba on my ubuntu machine and created a shared folder. So i can put content from windows to that folder. I changed the settings.js httpstatic to this shared folder.
After that i was able to load files with file i node.
At the end I was also able to show the image on my dashboard.
But ist this really the way to go? For me (as a c# programmer) its a litte bit complicated.
setting httpstatic allows you to serve files from the specified folder (like a web server does) - but it is NOT necessary to read a file.
For example, if you disable httpstatic and change the file in node to read an image from /tmp/test_image.png it will still work.
In essence, if you use httpstatic then your dashboard can simply access the image via a matching URL.
If you dont set httpstatic, then use need to use a file node to read the file and send it as base64 to the dashboard. OR serve the loaded file using http-in and http-response nodes.