I'm working on a Modbus project and i want to take a picture with my webcam by using a bit from an Modbus bit. I'm using a camera node but this one is using a Button as input.
I want to modify the node code to active the shoot with a bit.
I found how to take off the button and add an input but the snapshot is taken with an " Onclick " Button by activing a function in the html file, and the input seams read in the .js file.
So i want to activate the function in the html with the read input in the .js file.
Someone have any idea how to this ?
Which one? what are it's options? You might want to ask the author of the node if they can add this as an upgrade to the node.
As @zenofmud says, it will all depend on which Camera node you are talking about and what it actually does when you click the button.
If the click handler for the button sends a request to the runtime to trigger the camera, then you should be able to trigger the same code in the runtime when the node receives a message.
However, if the button captures an image entirely on the browser side using the HTML media apis and sends the image data back to the runtime, then it is a hard problem to solve. Doing it that way relies on the editor being open and active in order to take the image. There is no way for the runtime side to send a message to the editor to trigger the capture - especially if the editor isn't open when the node receives the message, or if it is open in multiple browser windows.
The camera node is from the libary node-red-contrib-browser-utils, thanks