Hi, guru,
My Arduino IDE 1.0.2 met a strange problem last night, it compiled the following codes very awfully slowly and in the end it threw out 'Missing the / from the end of a / statement*/', but these codes could be compiled under 1.5.6 without any problem, and moreover, the IDE 1.0.2 could compile the built-in webclient sample, however.
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
char server[] = "www.lewei50.com"; // name address for Google (using DNS)
IPAddress ip(192,168,16,177);
EthernetClient client;
void setup() {
Serial.begin(9600);
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
Ethernet.begin(mac, ip);
}
delay(1000);
Serial.println("connecting www.lewei50.com ...");
if (client.connect(server, 80)) {
Serial.println("connected");
// Make a HTTP request:
client.println("GET /http://www.lewei50.com/api/v1/sensor/gethistorydata/2558?Order=1&Limit=1&userkey=029b3884b91e4d00b514158b******");
client.println("Host: www.lewei50.com");
client.println("Accept: */*");
client.println("Accept-Encoding: gzip, deflate, compress");
client.println("User-Agent: runscope/0.1");
client.println("Connection: close");
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();
while(true);
}
}
I have restarted my IDE and even PC already but do not work.
BR,
Ardypro