i have a project where i need to send some kind of text to the camera stream , which you can access with writing ip adress in the link bar in the browser and you write the password and the username , i am using arduino ethernet shield my code so far is the following .Am i in the right direction , and how to enter the password and the admin characters so that the arduino can access the stream , i am new to all of this. I need samo kind of authentication.
#include <SPI.h>
#include <Ethernet.h>
String c = "uspeav";
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0D, 0x83, 0x9D };
byte ip[] = { 192, 168, 0, 102 };
byte gateway[] = { 192, 168, 0, 1 };
byte subnet[] = { 255, 255, 255, 0 };
//String c = uspeav;
void setup()
{
Ethernet.begin(mac, ip);
Serial.begin(9600);
delay(1000);
//String c = uspeav;
}
void loop()
{
EthernetClient client;
IPAddress server(192,168,0,64);
if (client.connected())
{
Serial.println("connected");
client.println("PUT <? xml version: '1.0' encoding='utf-8'?><VideoOverlay><normalizedScreenSize><normalizedScreenWidth>704</normalizedScreenWidth><normalizedScreenHeight>576</normalizedScreenHeight></normalizedScreenSize><attribute><transparent>false</transparent><flashing>false</flashing></attribute><fontSize>adaptive</fontSize><frontColorMode>auto</frontColorMode><alignment>customize</alignment><TextOverlayList><TextOverlay><id>1</id><enabled>true</enabled><displayText>" + c + "</displayText><positionX>0</positionX><positionY>480</positionY></TextOverlay></TextOverlayList><DateTimeOverlay><enabled>true</enabled><positionY>544</positionY><positionX>0</positionX><dateStyle>MM-DD-YYYY</dateStyle><timeStyle>24hour</timeStyle><displayWeek>true</displayWeek></DateTimeOverlay><channelNameOverlay><enabled>true</enabled><positionY>64</positionY><positionX>16</positionX></channelNameOverlay></VideoOverlay>");
client.println("Connection: keep-alive");
client.println("Authentication: Basic YWRtaW46MTIzNDVxd2VydHk=");
client.println("Content-Type: text/plain; charset=UTF-8");
client.println("Content-Length: 12");
client.println("{\"on\":false}");
}
else
{
Serial.println("Connection Failed.");
Serial.println();
}
delay(5000);
}