Pages: [1]   Go Down
Author Topic: HELP on pushingbox HTTP request  (Read 3715 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi All,

I'm totally new in this Arduino and pushing box. Managed to find the officiall code from pushingbox.com  via http://makeprojects.com/Project/Notifying-Doorbell-with-PushingBox/2165/2

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9563
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Pushingbox to Prowl

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

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)."

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Belgium
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Switzerland
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 144
Posts: 5989
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tried reading the response from the server? Maybe it is trying to tell you something and you are ignoring it.
Code:
// 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
« Last Edit: November 27, 2012, 07:09:13 am by SurferTim » Logged

Switzerland
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Code:
    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
Code:
   
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??
Logged

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9563
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is devid and vxxxxx the same?
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Switzerland
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

char devid[]
Logged

Belgium
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: