Hello Rui, I built the password protected webserver from the ESP32 tutorial , The webserver works prefectly, what Im trying to do is add the image from my Arducam to the webserver so that when I access the server to control a device the last image taken by my Arducam is dsiplayed as well. Below Ive posted the code snipet I added to show the cam image, any help you can give with getting the image to show will be appreciated.
When I try to compile the code I get an error
expect primary expression before ‘<‘ token
Code Snipet:
// Display current state, and ON/OFF buttons for GPIO15
client.println(“<p>Front Blinds – State ” + output15State + “</p>”);
// If the output15State is off, it displays the ON button
if (output15State == “off”) {
client.println(“<p><a href=\”/15/on\”><button class=\”button\”>ON</button></a></p>”);
} else {
client.println(“<p><a href=\”/15/off\”><button class=\”button button2\”>OFF</button></a></p>”);
}
// Display current state, and ON/OFF buttons for GPIO16
client.println(“<p>Rear Blinds – State ” + output16State + “</p>”);
// If the output16State is off, it displays the ON button
if (output16State == “off”) {
client.println(“<p><a href=\”/16/on\”><button class=\”button\”>ON</button></a></p>”);
} else {
client.println(“<p><a href=\”/16/off\”><button class=\”button button2\”>OFF</button></a></p>”);
}
//ADDED CODE START
client.print(“Camera 1”);
<img src = “http://192.168.1.203/stream”>
client.print(“Camera 2”);
<img src = “http://192.168.1.71/stream”>
//ADDED CODE END
client.println(“</body></html>”);
Hi.
That is a syntax error.
I don’t know if it was an issue pasting the code or if you have this wrong – you didn’t close the <img> tag.
You’re missing the “>”.
Additionally, you need to send it inside the client.print() as follows:
client.print("<img src = \“http://192.168.1.203/stream\”>");
You need to write an \ before every “ you want to send to the browser. Otherwise it will think that you’re closing the String.
I’m not sure if this is clear. Tell me if you understand.
Regards,
Sara
Thank you Sara for the timely response, after I add the edits as you suggested the code works as intended, and yes that was a pasting error on my initial question, Thanks again for the timely help.