Go Down

Topic: [SOlved]GET/ requests Headache (Read 1 time) previous topic - next topic



Thank you for the detailed explanation here especially the real world situation. I will use your code in my project so it doesn't fall apart.


Sir Liudr,

I think the Arduino WiFi shield doesn't have that kind UART communication facility everything needs to work through its library!
The biggest thing working with a ARduino WiFi shield is its cost at the very first time I was turned down with it, Learning to work with something which will hardly have any end product place is not good , and in case of Arduino WiFi shield this is the case because of its cost, I that's why picked up a RN-171 and Now im eyeing that very cheap TIcc3000 chip that can go upto $10 for 1000 pcs that's pretty cheap when it comes to connecting anything to the Internet!
"Real Men can Accomplish  Anything"

- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੁਂ!


Thanks for your reply NI$HANT. I am working on a project that will be cost effective and potentially have more functionality if I used arduino wifi shield. I am more confident with Arduino team's ability to write a decent firmware and library than other makers also.


I am more confident with Arduino team's ability to write a decent firmware and library than other makers also.

RN-171 and other many flavors are from MicroChip and you know microchip is the best when it comes to good quantity manufacturing  and thus cost gets dropped, neverthless this is my analysis.
"Real Men can Accomplish  Anything"

- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੁਂ!


Apr 18, 2013, 08:29 pm Last Edit: Apr 18, 2013, 08:38 pm by NI$HANT Reason: 1
@ SurferTIM , I added your code and its below(just commented out>>    client.println("HOST: winacro.com");)

Code: [Select]
#include <SPI.h>
#include <Ethernet.h>

int relayPin = 9;
char Str[11];
int prevNum = 0;
int num = 0;
long onUntil = 0;
int connectLoop;

long pollingInterval = 5000; // in milliseconds
long onTime = 60000; // time, in milliseconds, for lights to be on after new email or comment

// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = {  0x90, 0xA2, 0xDA, 0x0D, 0x78, 0xE1 };
char serverName[] = "winacro.com";

// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;

void setup() {
 pinMode(relayPin, OUTPUT);
 // start the Ethernet connection:
 if (Ethernet.begin(mac) == 0) {
   Serial.println("Failed to configure Ethernet using DHCP");
   // no point in carrying on, so do nothing forevermore:
 // give the Ethernet shield time to initialize:


void loop()

 // if you get a connection, report back via serial:
 if (client.connect(serverName, 80)) {
   // Make a HTTP request:
   client.println("GET /PHP/email.php HTTP/1.1");
   //client.println("HOST: winacro.com");
   int timer = millis();
 else {
   // if you didn't get a connection to the server:
   Serial.println("connection failed");
// if there's data ready to be read:
 while(client.connected())  {
   while(client.available())    {
     char inChar = client.read();
     // set connectLoop to zero if a packet arrives
     connectLoop = 0;


   // if more than 10000 milliseconds since the last packet
   if(connectLoop > 10000)    {
     // then close the connection from this end.
   // this is a delay for the connectLoop timing


 // close client end
 if(num > prevNum) {
     Serial.println("New Comment.");
     digitalWrite(relayPin, HIGH);
     prevNum = num;
     onUntil = millis() + onTime;
   else if(millis() > onUntil)
    digitalWrite(relayPin, LOW);

and I get the following with it:
Code: [Select]
HTTP/1.1 400 Bad Request
Date: Thu, 18 Apr 2013 18:25:33 GMT
Server: Apache
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1

<title>400 Bad Request</title>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />


if i keep the     client.println("HOST: winacro.com"); then i'm not able to connect!
"Real Men can Accomplish  Anything"

- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੁਂ!


Now I'm able to find the file:

here's the error in Php file that IM getting now:

Code: [Select]

PHP Error Message

Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/imap/ssl}INBOX in /home/a6194138/public_html/email_dante.php on line 8

Free Web Hosting
Cannot connect to Gmail: Can't connect to gmail-imap.l.google.com,993: Connection timed out
"Real Men can Accomplish  Anything"

- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੁਂ!

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131