rimai wrote:Can you post your code?
Maybe the code you have is pointing to the old server.
/*
Web Server
A simple web server that shows the value of the analog input pins.
using an Arduino Wiznet Ethernet shield.
Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
* Analog inputs attached to pins A0 through A5 (optional)
created 18 Dec 2009
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe
*/
#include <SPI.h>
#include <Ethernet.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {
0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
IPAddress ip(192,168,1, 177);
IPAddress remoteserver(198,171,134,6); //
www.reefangel.com
EthernetClient clientout;
unsigned long lastmillisout=millis();
unsigned long lastmillisin=millis();
boolean sending=false;
char strout[600];
// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(2000);
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(57600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
// start the Ethernet connection and the server:
Ethernet.begin(mac);
server.begin();
// Serial.println(Ethernet.localIP());
}
void loop() {
// listen for incoming clients
EthernetClient client = server.available();
if (client) {
// Serial.println("new client");
// an http request ends with a blank line
boolean currentLineIsBlank = true;
while (client.connected()) {
while (client.available()) {
char c = client.read();
if (sending==false) Serial.write(c);
lastmillisin=millis();
}
while (Serial.available()){
memset(strout,0,sizeof(strout));
int b=Serial.readBytesUntil('>',strout,sizeof(strout));
// Serial.flush();
client.print(strout);
client.print(">");
// char c = Serial.read();
// client.print(c);
if (millis()-lastmillisin>2000)
{
// Serial.println("Timeout incoming");
Serial.flush();
lastmillisin=millis();
client.stop();
}
}
if (millis()-lastmillisin>2000)
{
// Serial.println("Timeout incoming");
Serial.flush();
lastmillisin=millis();
client.stop();
}
}
// give the web browser time to receive the data
delay(1);
// close the connection:
client.stop();
// Serial.println("client disonnected");
}
else
{
if (Serial.available())
{
memset(strout,0,sizeof(strout)-1);
int b=Serial.readBytesUntil('\n',strout,sizeof(strout)-1);
Serial.flush();
// Serial.println(b);
// Serial.println("Connecting");
if (b>10)
{
sending=true;
// Serial.println(strout);
// Serial.println(" HTTP/1.0");
// Serial.println();
if (clientout.connect(remoteserver, 80))
{
// Serial.println("Connected");
// while (Serial.available()){
// char c = Serial.read();
// clientout.print(c);
// }
clientout.println(strout);
// clientout.println(" HTTP/1.0");
clientout.println();
lastmillisout=millis();
}
}
}
while (clientout.available()) {
char c = clientout.read();
Serial.print(c);
if (millis()-lastmillisout>8000)
{
// Serial.println("Timeout connected");
lastmillisout=millis();
clientout.stop();
sending=false;
}
}
if (!clientout.connected())
{
clientout.stop();
sending=false;
}
}
if (millis()-lastmillisout>8000)
{
// Serial.println("Timeout global");
lastmillisout=millis();
clientout.stop();
sending=false;
}
}
// GET /index.html HTTP/1.0
//GET /status/submitp.aspx?t1=806&t2=0&t3=0&ph=441&id=test&em=0&rem=0&key=&atohigh=0&atolow=0&r=0&ron=0&roff=255 HTTP/1.0
//GET /status/submitp.asp?t1=806&t2=0&t3=0&ph=441&id=test&em=0&rem=0&key=&atohigh=0&atolow=0&r=0&ron=0&roff=255 HTTP/1.0
//Host: forum.reefangel.com
//
//GET /status/submitp.aspx?t1=806&t2=0&t3=0&ph=441&id=test&em=0&rem=0&key=&atohigh=0&atolow=0&r=0&ron=0&roff=255 HTTP/1.0
//Host: forum.reefangel.com
//Connection: Keep-Alive
Sent from my Lenovo TAB 2 A10-70F using Tapatalk