SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By ivanh23
#201175
Hello guys . 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.Now my problem is that when i try to send to the camera some text in does not receive anything , nothing is happening , can someone please help me
Thank you
Code: Select all
[code]#include <Ethernet.h>
#include <SPI.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 0, 177 };
byte server[] = { 192,168, 0, 64}; // Google
String big_string="<?xml versiding='rlay>";
EthernetClient client;

void setup()
{
  Ethernet.begin(ip);
  Serial.begin(9600);

  delay(1000);

  Serial.println("connecting...");

  if (client.connect(server, 80)) {
    Serial.println("connected");
      client.println("POST /ISAPI/System/Video/inputs/channels/1/overlays HTTP/1.0");
    client.println("Host: 192.168.0.64");
    client.println("User-Agent: arduino-ethernet");
    //client.print("Connection: close\r\n\r\n");
    client.println("Authorization: Basic YWRtaW46MTIzNDVxd2VydHk=");
   client.println("Content-Type: application/x-www-form-urlencoded; charset=UTF-8");
     
    client.print("content-length:895");
    //client.print("{\"on\":false}"); 
    // client.println();
    //client.println(big_string.length());
    client.println("POST /<?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>dsadasdasdas</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();
    //client.print(big_string);
    // client.println();
    
    
 
   

    
  } else {
    Serial.println("connection failed");
  }
}

void loop()
{
  if (client.available()) {
    char c = client.read();
    Serial.print(c);
  }

  if (!client.connected()) {
   
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();
    for(;;)
      ;
  }
}
[/code]