HELP on pushingbox HTTP request

Hi All,

I'm totally new in this Arduino and pushing box. Managed to find the officiall code from pushingbox.com via Make: Projects

and try out step by step of hardware/software set up, but still could not get notified sms when pressed the doorbell. Can you all help me with it?

Follow the instruction, i changed the mac address which found at the sticker of ethernet shield, and copy/paste the devid code from senarios, please guide me beside these 2, whereelse i need to change?

In Serial Monitor show:


Ethernet ready
pinDevid1 is HIGH
conneting
connected
sending request

disconneting
pinDevid1 is LOW


Thus, I'm thinking the problem should be Http request part from Pushingbox to Prowl, and wondering if anyone has the same issue as mine. And you help to solve it please or any suggestion to check on the setting,etc?

Thanks for your help, and any guides/suggestion will be much appreciated.

Hi All,

Seem noone encounter similar problem like me.

By looking at the serial monitor display, it's seem to me the connection between Arduino and Pushingbox got issue. Hmm...Any ideas on what i should check to find out the problem?

Please helpppppp

Thanks

Pushingbox to Prowl

Never heard of any of that. Perhaps you have links to what ever those are?

Jennytran,
I just started with this and found the same problem. After a lot of trial and error and research I found a bit of info on the Arduino reference pages.
I made the following change and all works now.
CHANGE this
#define DEVID1 "Your DEVID"
to
String DEVID1 = "Your DEVID";

Your DEVID needs to be set to the DEVID from pushingbox.

This is the info I found in the reference section on the Arduino site http://arduino.cc/en/Reference/Define
"This can have some unwanted side effects though, if for example, a constant name that had been #defined is included in some other constant or variable name. In that case the text would be replaced by the #defined number (or text)."

I am having the same problem, but I did not try your solution of using the "string". I will try that and post my results.

Well, my compiler did not like replacing the #define with the string. I think it was because of the location in the program.

But the #define thing seems to be working fine. However, when I push the button, I get the correct text output on my serial output, but no e-mail.

When I try the e-mail test feature on pushingbox, it works only sometimes also. Is there some kind of limit on how may requests can be sent in a given period of time?

Still having trouble. Only getting an infrequent number of successful e-mail.

Hi
I'm having exactly the same issue. Sometimes it works for days. Then it stops working or only few mails go through.
Each time the Arduino reports a correct connection. When I try with cURL or with a browser, it works OK.
I tried a lot of different things:

  • another Arduino and Ethernet card. Network is OK on both, I can brwse to them perfectly (they're server as well).
  • putting \r\n as end of line instead of just \n
  • change #define to const String..., but this is just cosmetics
  • start the card with or witout mentionning dns, gateway. No difference.
    Here the code:
    void sendToPushingBox(String devid){
  • #ifdef DEBUG_SERIAL*
  • Serial << F("Connecting to PushingBox") << newLineSerial;*
  • #endif*
  • if (client.connect(serverName, 80)) {*
  • #ifdef DEBUG_SERIAL*
  • if(client.connected())*
  • Serial << F("client connected to PushingBox") << newLineSerial;*
  • else*
  • Serial << F("client NOT connected to PushingBox") << newLineSerial;*
  • Serial << F("sending GET request") << newLineSerial;*
  • #endif*
  • Serial << F("GET /pushingbox?devid=") << devid << F(" HTTP/1.1\r\n");*
  • Serial << F("Host: ") << serverName << F("\r\n");*
  • Serial << F("User-Agent: Arduino\r\n");*
  • Serial << F("\r\n");*
  • client << F("GET /pushingbox?devid=") << devid << F(" HTTP/1.1\r\n");*
  • client << F("Host: ") << serverName << F("\r\n");*
  • client << F("User-Agent: Arduino\r\n");*
  • client << F("\r\n");*
  • }*
  • else {*
  • Serial << F("PushingBox connection failed") << newLineSerial;*
  • }*
  • // if there are incoming bytes available from the server, read and print them:*
  • #ifdef DEBUG_SERIAL*
  • delay(1000);*
  • if (client.available()) {*
  • char c = client.read();*
  • Serial << c;*
  • }*
  • Serial << F("disconnecting") << newLineSerial;*
  • #endif*
  • client.stop();*
    }

Here the debug-info:
Setting up Ethernet card
Ready, delay 5 sec to setup Ethernet card
Connecting to PushingBox
client connected to PushingBox
sending GET request
GET /pushingbox?devid=vDCC7D695F4F8672 HTTP/1.1
Host: api.pushingbox.com
User-Agent: Arduino
disconnecting

I guess it's more a network issue, but I can't put my hands on it. Does someone have an idea? If not I'll need to put a sniffer to see what exactly is going over the network.

Same issue on my side or even worse. My sketch (the GET request pretty much as the official one) worked now for about 3 month well. Now it doesn't work any more and the official one doesn't work either.

From the browser or with curl it works perfect on my PC.

What makes it really strange: My sketch places a GET request to an other server at the same time. This works as it should.

Have you tried reading the response from the server? Maybe it is trying to tell you something and you are ignoring it.

// if there are incoming bytes available from the server, read and print them:
    while(client.connected()) {
      while(client.available()) {
        char c = client.read();
        Serial << c;
      }
    }
    Serial << F("disconnecting") << newLineSerial;
    client.stop();

edit: Here is my client code on the playground. It has this and a timeout disconnect.
http://www.arduino.cc/playground/Code/WebClient

Yes you would be right. Often the answer on the problem is in the response. But not here as I don't get any response at all. It seams that the server doesn't simply understand anything after get connected.

I found a kind of solution which makes it working now but it isn't really a sadifying solution:

The official example is like this: (and doesn't work)

    if(DEBUG){Serial.println("sendind request");}
    client.print("GET /pushingbox?devid=");
    client.print(devid);
    client.println(" HTTP/1.1");
    client.print("Host: ");
    client.println(serverName);
    client.println("User-Agent: Arduino");
    client.println();

If I replace it and write everything in one line to the client it works

if(DEBUG){Serial.println("sendind request");}
    client.println("GET /pushingbox?devid=vXXXXXXXXXXXXXXX HTTP/1.1");
    client.print("Host: ");
    client.println(serverName);
    client.println("User-Agent: Arduino");
    client.println();

?????
What is going wrong here??

Is devid and vxxxxx the same?

Yes. devid is an array of char which contains the API - Key (I use different Pushingbox messages):

char devid[]

I have it working at the moment by replacing: void sendToPushingBox(String devid) with void sendToPushingBox(char devid[]) although I think both should work fine. It also worked before with String, and when I send exactly the same text to serial, I se it 100% correct as it should be. Anyway it seems to work now. Reply from the server is OK as well.
I don't need to put all Serial.prints on 1 line, it works as the api-example as well. I have the impression that somewhere in Ethernet.client something is a bit unstable.
The issue I have now is that mails arrive only after several hours. I asked people from Pushingbox how this is possible. Before it was instantanious.

I know that I'm replying to an old post of yours, but am curious how it is working now and also if you found the Pushingbox folks to be very supportive? I'm having similar problems and sent the Pushingbox folks an email to see if they can give me any advice. Haven't heard anything in over 24 hrs.

Thanks

Highly recommend you use HTTP/1.0 instead of HTTP/1.1 in your calls. HTTP/1.1 will result in a persistent connection while HTTP/1.0 closes the connection after the request.