Making GET/POST request to dweet.io

Hi

i'm working at project related to IoT.Actually, i tried to collect data from my sensor devices using GPRS network (arduino + SM5100B-D gsm/gprs shield).I spend last 4 days ago searching in the internet about how to make GET or POST request to dweet using GPRS (TCP/IP) of this shield but with out any results

this shield has very poor documentations and examples >:(

so, im looking to your help ..... 8) 8)

i got this attached arduino Sketch and calibrates it to communicate with dweet.io but without any results.When this code runs, it starts to conf. shield and then makes tcp connection to dweet.io. but it stills looking for Acknowledgment signal coming back from the server as it illustrated in the following attached picture.

sm5100b-gprs.ino (8.62 KB)

Please do not cross-post. This wastes time and resources as people attempt to answer your question on multiple threads.

Your other thread deleted.

  • Moderator

Sorry. this this my first time..... :-[

When this code runs, it starts to conf. shield

I have no idea what "conf."-ing a shield is going to accomplish, so I have no idea whether this is a good thing, or not.

PaulS , what you want me to explain ? i need to make GET and POST HTTPS request from this shield in order to deal with Dweet.io. this his all the story. im looking to your support>

thanks

You need to determine what the problem is. It is obviously here:

  int packetLength = 26+host.length()+request.length()+useragent.length();

    if (checkSocketString(s) == packetLength) // checks that packetLength bytes have been acknowledged by server
      break; // we're good!
    else {
      Serial.println("Sent data not yet acknowledged by server, waiting 1 second and checking again.");
      delay(1000);
    }

Maybe you miscalculated the expected packet length? Try this instead.

    int thisLen = checkSocketString(s);
    if (thisLen == packetLength) // checks that packetLength bytes have been acknowledged by server
      break; // we're good!
    else {
// add this
      Serial.print("Packet length = ");
      Serial.println(thisLen);
      Serial.print("Expected = ");
      Serial.println(packetLength);

      Serial.println("Sent data not yet acknowledged by server, waiting 1 second and checking again.");
      delay(1000);
    }

what you want me to explain ?

What the heck conf. means. It looks like an abbreviation for conference. But, that doesn't make sense.

PaulS It means configuration .... be cool my friend.

Which Arduino are you running the code on? There are a LOT of string literals being copied into SRAM unnecessarily.

Serial.println(F("Attaching GPRS..."));

Use the F() macro to keep them out of SRAM.

Dear SuferTim

Good suggestion. i did it and i got same results. i seams that dweet.io did not answer me neither AKN. nor data :confused: . this is clear according to Socket status which i recieved.

+SOCKSTATUS: 1,1,0102,91,0,0

I still did not know what is the problem ?

im looking to your support my friend.

PaulS

Im not sure i could understand your idea. you can consider me in beginner programming level :slightly_smiling_face: what you want to say?

Instead of posting a screenshot of your debugging output, copy and paste it into a post. That way everyone can see it without needing to download an image file.


Don't use abbreviations like "it starts to conf. shield ..." - that just confuses people. You could have saved a lot of time by taking the extra seconds to type "configure the". That would have saved half the replies in this thread.

How to use this forum

SO Mr.Nick do you have any suggestions to solve my problem? by way conf. is a common abbreviation to configuration as i found through the webs.......