how can I send float value in url I tried float values but I ended up getting Null values

0 votes
How can I send the values and insert the values into the database?

float PHValue = Value/10;
  float DOValue= 12.22;
  gprsSerial.println("AT+HTTPPARA=\"URL\",\"http://itempurl.com/smartpond/AddTemprature?WaterTemperature=""+celsius+""&PHValue=""+PHValue+""&DOValue=""+DOValue+""&currentTime=06-30-2016\"");

Thanks!
Aug 28, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
2,738 views

1 answer to this question.

0 votes

You can use print() to send  it as in the following:

int n_decimals = 3;
float PHValue = Value/10;
float DOValue= 12.22;

gprsSerial.print("AT+HTTPPARA=\"URL\",\"http://itempurl.com/smartpond/AddTemprature?WaterTemperature=");
gprsSerial.print(celsius, n_decimals);
gprsSerial.print("&PHValue=");
gprsSerial.print(PHValue, n_decimals);
gprsSerial.print("&DOValue=");
gprsSerial.print(DOValue, n_decimals);
gprsSerial.println("&currentTime=06-30-2016\"");
With n_decimals the number of decimal places that you want to be printed.

Or  you can also use snprintf to generate your AT command:

char command[256];
float PHValue = Value/10;
float DOValue= 12.22;

snprintf(command, sizeof(command), "AT+HTTPPARA=\"URL\",\""
          "http://itempurl.com/smartpond/AddTemprature?"
          "WaterTemperature=%f&PHValue=%f&DOValue=%f"
          "&currentTime=06-30-2016\"", celsius, PHValue, DOValue);
gprsSerial.println(command);

answered Aug 28, 2018 by Annie97
• 2,160 points

Related Questions In IoT (Internet of Things)

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Setting-up a RFID RC522 chip in Raspberry Pi?

First, let me congratulate you on buying ...READ MORE

answered Jul 10, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,643 views
0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer

Suggest Implementation method for Smart Parking Points

They are different things. Raspberry PI is ...READ MORE

answered Aug 24, 2018 in IoT (Internet of Things) by anonymous2
• 4,280 points
649 views
0 votes
1 answer

OMA LWM2M communication with Arduino

You'll have to understand that an Arduino ...READ MORE

answered Aug 28, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,791 views
0 votes
1 answer

Can i use ESP8266 as a network adapter?

With the Espressif SDK 1.5.2 for the ESP8266 it's not possible ...READ MORE

answered Sep 12, 2018 in IoT (Internet of Things) by Annie97
• 2,160 points
2,670 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP