Go Down

Topic: send multiple data to HTTP server through GET method using sim900a (Read 56 times) previous topic - next topic

Kumkum23

Haii folks,
 I am using gsm SIM900a to send data to HTTP server using GET method. I am able to send value if i will send it manually.

e.g.
SIM900.println("AT+HTTPPARA=\"URL\",\"xxx.xxx.xxx.xxx:port/xxxxxxxx/api/iot/v1/save-data/7/8/");

Here, i am sending temp and humidity value manually. It is getting stored successfully.

But when i am trying to send DHT11 sensor real time data i am not getting the value.

1st i am storing the values from sensor in variables.

 float t = DHT.temperature;
  float h = DHT.humidity;

then i am passing these variables as parameters along with URL.

SIM900.println("AT+HTTPPARA=\"URL\",\"xxx.xxx.xxx.xxx:port/xxxxxxxx/api/iot/v1/save-data/t/h/");

But i am not getting the values. I am getting only t and h as output in stead of getting their numeric values.

It is taking as string i guess.

I am sending the data through GET method.

Serial.print("AT+HTTPACTION=0\\r\\n");
  SIM900.println("AT+HTTPACTION=0");  /* Start POST session */
  delay(5000);
  ShowSerialData();

It is working fine when i am sending data manually by giving some values with URL as mentioned above. I want to follow the same method to send real time data.

How i will solve this and get my real time data. Please help. Thanks in advance.

 


sterretje

Quote
Code: [Select]
SIM900.println("AT+HTTPPARA=\"URL\",\"xxx.xxx.xxx.xxx:port/xxxxxxxx/api/iot/v1/save-data/t/h/");

The /t/h are text, not your variables.

You can try something like
Code: [Select]
SIM900.print("AT+HTTPPARA=\"URL\",\"xxx.xxx.xxx.xxx:port/xxxxxxxx/api/iot/v1/save-data/");
SIM900.print(t);
SIM900.print("/");
SIM900.print(h);
SIM900.println("/");

If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Kumkum23

#2
Aug 23, 2019, 09:04 am Last Edit: Aug 23, 2019, 09:08 am by Kumkum23 Reason: I did not attach the screenshot of my output.
Sir, i tried in the same manner you said but i am not getting any response. Neither successful nor error message.

Go Up