I have the code below making a get HTTP get request but nothing happens if I paste the url into a browser it works fine. I have used wireshark to check the data packets and my get request through the shield looks nothing like the get request I am making?? I am completely stuck as to why this is, if anyone can help I would be very grateful. I have included the screen dumps from wireshark
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = { 192, 168, 0, 50 }; // ip in lan assigned to arduino
//byte gateway[] = { 192, 168, 1, 1 }; // internet access via router
//byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
byte myserver[] = { 192, 168, 0, 34 }; // zoomkat web page server IP address
EthernetClient client;
//////////////////////
void setup(){
Ethernet.begin(mac, ip);
//Ethernet.begin(mac, ip, gateway, gateway, subnet);
Serial.begin(9600);
Serial.println("Better client test 4/04/12"); // so I can keep track of what is loaded
Serial.println("Send an e in serial monitor to test"); // what to do to test
}
void loop(){
// check for serial input
if (Serial.available() > 0) //if something in serial buffer
{
byte inChar; // sets inChar as a byte
inChar = Serial.read(); //gets byte from buffer
if(inChar == 'e') // checks to see byte is an e
{
sendPOST(); // call sendGET function below when byte is an e
}
}
}
//////////////////////////
void sendPOST() //client function to send/receive GET request data.
{
if (client.connect("192.168.0.34", 81)) { //starts client connection, checks for connection
Serial.println("connected");
//client.println("GET 192.168.0.34:81/tenHsServer/tenHsServer.aspx?t=ab&f=ToggleDevice&d=E3 HTTP/1.1");
client.println("GET 192.168.0.34:81/tenHsServer/tenHsServer.aspx?t=ab&f=ToggleDevice&d=E3 HTTP/1.1");
Serial.println();
client.println(); //end of get request
}
else {
Serial.println("connection failed"); //error message if no client connect
Serial.println();
}
Serial.println();
Serial.println("disconnecting.");
Serial.println("==================");
Serial.println();
client.stop(); //stop client
}