So i've been working on a project about IoT, and currently im using arduino for my project, especially ESP32-Cam for monitoring plants. And since im new using Node-Red is there are a way to send a data from PHP Script. I installed my ESP32-Cam with opencv to detect color value, for reference im using ESP32-CAM Web Server with OpenCV.js: Color Detection and Tracking | Random Nerd Tutorials for the color detection. In the code
let BP = rgbaPlanes.get(2); // SELECTED COLOR PLANE
let GP = rgbaPlanes.get(1);
let RP = rgbaPlanes.get(0);
the codes above are for the data of color value, and i want to send it to node-red dashboard.
If someone who has done a similar project, would you kindly share your knowledge with me and the community.
Thankyou for your time to reply my question.
Yes, i understand about that sir, what i meant is, do i have to just put the client.publish code inside the script so that the camera can send the color value to node-red, or do i have to use other method
If it's any help - here's a function I wrote a year or so ago to publish data & reports from a Wemos D1 Mini (being used as a controller for a weather station) via MQTT to a MQTT-In node in Node-RED.
Some of the include statements needed at the top of the Arduino code.
actually sir, its like color tracking but the website that i referred called it " ESP32-CAM Web Server with OpenCV.js: Color Detection and Tracking" so the opencv is located inside the website. once the camera is turned on the website also turn on
While there is a small web server which runs in the browser, that code starts off stored on the esp32-cam and is sent to the browser when the esp32-cam is powered on. The browser code has a script that loads the opencv.js code from https://docs.opencv.org/master/opencv.js.
If you read the web page you refer to, you will find an explainaton of what part of the code is sent to the browser.
But this still means that if you want to add the MQTT/JSON code, that code needs to exist on the esp32-cam so you will have to change (hack) the code that is run on the esp32-cam to add that code in.