Generating params String stop working when... changing server

Hi,

I have a really weird problem. But first short explain, I’m developing a simple Meteo Station using Arduino Uni, SparkFun WeatherShield and SparkFun WiFi Shield.
Device count all the metro data every second and every 10s send it as HTTP POST to server.
Everything was fine when I was testing it on my local Node.js server running on computer in the same WiFi network.
But… when I uploaded the server to a free Heroku cloud, and changed connection data in Arduino code everything goes crazy…

Thats full main code: http://pastebin.com/PvkALkVF
But the more important part is here (second wifi tab): http://pastebin.com/jqSCCXFT

When I’m changing httpHeader from (local):

const String httpHeader = "POST /meteo HTTP/1.1\r\n"
                    "Host: 192.168.0.131:5000\r\n"
                    "Connection: close\r\n"
                    "Content-Type: application/x-www-form-urlencoded\r\n";

to (using Heroku):

const String httpHeader = "POST /meteo HTTP/1.1\r\n"
                    "Host: pure-caverns-1350.herokuapp.com\r\n"
                    "Connection: close\r\n"
                    "Content-Type: application/x-www-form-urlencoded\r\n";

And of course changing from (local):

 if (client.connect("192.168.0.131", 5000) <= 0)

to:

if (client.connect("pure-caverns-1350.herokuapp.com", 80) <= 0)

And nothing more! This part of code is going crazy:

  String params;
  params += "windspeedmph=" + String(windspeedmph,1) + "&";
  params += "winddir=" + String(winddir,1) + "&";
  params += "humidity=" + String(humidity,1) + "&";
  params += "temp=" + String(temp,1) + "&";
  params += "pressure=" + String(pressure,1) + "&";
  
  Serial.println(F("Posting to api!"));
  Serial.print(F("parametry: "));Serial.println(params);

As you see it should generate a parameters String and firstly show it on Serial Monitor, then its POSTing it using HTTP.
Connection with server is OK, connection with WiFi is OK. Server works OK but…

When its local the params is like this (thats fine):

Posting to api!
windspeedmph=0.0&winddir=270.0&humidity=18.9&temp=22.2&pressure=1017.6&

But when I’m trying to send it to Heroku its generating wrong and then server is receiving not all the data and is not saving everything to database.

Posting to api!
parametry: windspeedmph=0.0&&&temp=22.9&&


+IPD,0,346:HTTP/1.1 200 OK
Server: Cowboy
Connection: close
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 111
Etag: W/"6f-kVy8V/U//yp7ju8+n/LNIQ"
Date: Thu, 31 Dec 2015 13:22:47 GMT
Via: 1.1 vegur

{"__v":0,"windspeedmph":0,"temp":22.9,"_id":"56852c27d084510300b89c20","updated_at":"2015-12-31T13:22:47.665Z"}0,CLOSED

So as you see its generating params string with only windspeedmph and temp, not including the rest that should be there.

WHAT IS THE PROBLEM AND WHY IS IT LIKE THIS?
I’ll be very very thankful for any kind of help…
And I wish you all happy new year without any kind of weird problems :wink:

Are you able to post a simple static test string to the web site?

WHAT IS THE PROBLEM AND WHY IS IT LIKE THIS?

The problem is most likely that you are running out of memory, (ab)using the String class like that. Learn how to use dtostrf(), strcat(), and/or sprintf().