Loading...
  Show Posts
Pages: 1 [2] 3 4 ... 83
16  Using Arduino / Networking, Protocols, and Devices / [SOlved]GET/ requests Headache on: April 17, 2013, 08:55:47 am
I'm just wanting to extract some email information from my IMAP.google.com.

My arduino code:

Code:
#include <SPI.h>
#include <Ethernet.h>

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

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() {
  Serial.begin(9600);
  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:
    while(true);
  }
  // give the Ethernet shield time to initialize:
  delay(2000);

}

void loop()
{
    Serial.println("connecting...");

  // if you get a connection, report back via serial:
  
  if (client.connect(serverName, 80)) {
    Serial.println("connected");
    // Make a HTTP request:
    client.println("GET /PHP/email.php HTTP/1.1");
    client.println("HOST: winacro.com");
    client.println();
    int timer = millis();
    //delay(1000);
  }
  else {
    // if you didn't get a connection to the server:
    Serial.println("connection failed");
    
  }
// if there's data ready to be read:
  if (client.available()) {
     int i = 0;
    
     //put the data in the array:
     do {
       Str[i] = client.read();
       i++;
       delay(1);
     } while (client.available());
    
     // Pop on the null terminator:
     //Str[i] = '\0';
     //convert server's repsonse to a int so we can evaluate it
     Serial.print(Str);
     num = atoi(Str);
    
     Serial.print("Server's response: ");
     Serial.println(num);
     Serial.print("Previous response: ");
     Serial.println(prevNum);
     if (prevNum < 1)
     { //the first time around, set the previous count to the current count
      prevNum = num;
      Serial.println("First comment count stored.");
     }
     if (prevNum > num)
     { // handle if count goes down for some reason
      prevNum = num;
     }
  }
  else
    {
     Serial.println("No response from server.");
    }
    Serial.println("Disconnecting.");
    client.stop();
    if(num > prevNum) {
      Serial.println("New Comment.");
      digitalWrite(relayPin, HIGH);
      prevNum = num;
      onUntil = millis() + onTime;
    }
    else if(millis() > onUntil)
    {
     digitalWrite(relayPin, LOW);
    }
  //delay(pollingInterval);
}


This is what I get:

Code:
connecting...
connected
No response from server.
Disconnecting.

Code:
<?php
/* connect to gmail */
$hostname "{imap.gmail.com:993/imap/ssl}INBOX";
$username "xcxc@winwin.com";
$password "1123412";

/* try to connect */
$inbox imap_open($hostname,$username ,$password) or die('Cannot connect to Gmail: ' imap_last_error());

$status imap_status($mbox"{imap.gmail.com:993/imap/ssl}INBOX"SA_MESSAGES);
if (
$status) {
  echo 
$status->messages;
}
?>
17  Community / Gigs and Collaborations / Re: GPRS Code Needed to Send POST with data and recieve response from server on: April 17, 2013, 12:59:32 am
Quote
Hi Nishant,

thank you for this offer but $500 to test a piece of code I have already written but don't have GPRS  coverage to work with  is just a little too much. If I was asking you to create an application from scratch then this would be about right. Don't forget I am a developer just like you and know how long it takes to do these things  about 2 hours I think, less if you intend to re-cycle some code you have already use before.

Cheers Pete.

I think you need to learn something here, The PM's are to be replied as PM's and not over smarted as posts.
18  Community / Gigs and Collaborations / Re: ListFiles() shows the list of files in Serial Monitor but not in a browser on: April 08, 2013, 02:10:47 pm
AS you have got your own flavoured Arduino there may have been most probably a problem in circuit , as always double check your connections most probably this is happening due to floating connections or connections gone wrong or perhaps connections not at all done.
19  Using Arduino / Networking, Protocols, and Devices / Re: Port change from 80 to something else on: April 08, 2013, 02:59:56 am
Utilised the Dynamic DNS still the same problem , can;t make out what is the possible problem?
20  Using Arduino / Networking, Protocols, and Devices / Re: Port change from 80 to something else on: April 08, 2013, 01:33:59 am
I think my DSL is screwed and I dnt know how to go about fixing that!

I used 81 start and 91 end port and used 8080 it doesn't work still

EDIT: tried an in between port namely 85 still the same
21  Using Arduino / Networking, Protocols, and Devices / Re: Port change from 80 to something else on: April 07, 2013, 09:33:42 pm
Got time to check the screenshot zoomkat?
22  Using Arduino / Networking, Protocols, and Devices / Re: Port change from 80 to something else on: April 06, 2013, 01:31:20 am
Here are the settings done regarding PORT forwarding on my router "uC"  is arduino here:


http://www.flickr.com/photos/93413530@N06/8624125280/
23  Using Arduino / Networking, Protocols, and Devices / Re: Port change from 80 to something else on: April 06, 2013, 01:07:29 am
Quote
Have you posted your code for evaluation?

My code is the very same no changes WEBSERVER ethernet example that comes with the Arduino 1.0 IDE ONLY the IP address that is 192.168.0.104 + the MAC address is changed and the Server port rest is the same.
24  Using Arduino / Networking, Protocols, and Devices / Re: Port change from 80 to something else on: April 05, 2013, 02:02:35 pm
Quote
you will need to use your wan ip address

I know this already and im doing it/trying it but IM not able to access using the WAN IP, however at the same time the internal IP communication works smooth
25  Using Arduino / Networking, Protocols, and Devices / Re: Port change from 80 to something else on: April 05, 2013, 01:31:15 pm
Quote
..and you port forwarded that port to your private localnet ip? If it still doesn't work, it may be your DSL router doing the block.

But that what could be possible issue here? Can you outline which elements to check, I tried disabling the Firewall and restarting the router to no avail!

Should I provide you with the screenshot of my routers option/functions it supports so you may try to underline some options?
26  Community / Gigs and Collaborations / Re: In search of assistance. on: April 05, 2013, 01:24:39 pm
If you need some help may be out of realm of arduino like going to ARM or something else or Arduino or anything tell me ,I will consider that Free of cost and will try to provide any assistance akin to my potential.
27  Using Arduino / Networking, Protocols, and Devices / Re: Port change from 80 to something else on: April 05, 2013, 08:46:48 am
internal network however works fine!

ANd! I just disabled by routers firewall
28  Using Arduino / Networking, Protocols, and Devices / Re: Port change from 80 to something else on: April 05, 2013, 08:46:07 am
I used port 8080 still the browser can;t link to it
29  Using Arduino / Networking, Protocols, and Devices / Re: Port change from 80 to something else on: April 05, 2013, 08:01:48 am
Quote
I use either port 8080 or 8088 for this kind of stuff.

So you mean these ports would work in place of port 80 ?

@Zoomkat

I have a DSL modem which was provided to me by the ISP ,now the phone line goes into that DSL and an ethernet cable comes out of it and then that ethernet cable is inserted into my DLINK- DIR524 WiFi router which also has some ethernet port at the back so I inserted another ethernet cable there and plugged it into my ethernet shield that's it.
I got my WAN IP using this URL >> http://checkip.dyndns.org/
30  Using Arduino / Networking, Protocols, and Devices / Re: Port change from 80 to something else on: April 04, 2013, 03:34:05 pm
Port forwarding on the internal ethernetshield IP address set to port 80 ,
the arduino ethernet shield set to port 80,

the ethernet shield is being noticed by the router so thats not a problem,
also Im able to access the contents of the webserver using the internal IP address of the ethernetshield but not using the external IP address that is WAN on port 88.
Pages: 1 [2] 3 4 ... 83