Dinamic change of background Image on HMI WebServer
Hello colleagues,
I made a small project of face recognition using Python on our PLCnext.
My script, enabled using C++ program that call the Shell, check on an input picture the presence of faces and make some elaboration on it.
Using REST API I can share variables between Python script and PLC program.
I'm using as input picture of my script the image used as background for WebHMI (/opt/plcnext/projects/PCWE/Services/Ehmi/ehmi/) so I can directly show on the webserver the result of my script...in this case using Translation of rectangle object around all the face found.
I'd like to can dinamically change this background picture, but anytime I try to do it PLC (AXC F3152) show error probably related to the ownership of this file; it looks like only plcnextfirmware can change it during download of a new project with a new background image.
Is there a way to can change it dinamically without having problem?
Comments
Hi Davide,
Sorry for the long delay. We finally have an answer:
=============================================
We are assuming that you mean ‘Image source’ field of an HMI page.
If that is the case, you should be able to change it dynamically via a script without having to re-download the whole project.
Please let us know how this works
I read your answer and it was really very usefull because I could make a test so that I can use my IP camera to display its image in the eHMI page.
But it was more simple than waht you described.
For example, I just had to use the following command in the LinuxShell FB :
curl -u admin:password http://192.168.10.33/tmpfs/auto.jpg --output /opt/plcnext/projects/PCWE/Services/Ehmi/ehmi/capture.png
and of course, i use the capture.png file in the eHMI page. (192.168.10.33 is my IPCamera).
But even if the file is updated in the AXC F 2152 directory, it is necessary to change to an other eHMI page so that the image is really update on the web browser.
Is there any simple solution so that the eHMI page refreshes by itself its content? either via an internal command in the AXC F 2152, or something else.
Thanks
hey nicely done and thanks for the feedback.
A auto refresh is for now unfurtonately not possible, but I will add this to the backlog.
BR,
Frank