cURL - malformed error

Hi,,

I am trying to solve out the problem with sending data from Yun to external server. Becuase of the timeout issue I use the Process library and curl command as shown bellow. I use the function called httpSend:

void httpSend(String httpString) {
  httpString.trim();
  String urlSend = "http://192.168.0.5/fve/bmv_data.php?";
  urlSend += httpString;
  Process p;              
    p.begin("curl");      
    p.addParameter(urlSend); 
    p.addParameter("--connect-timeout");
    p.addParameter("15");
    p.addParameter("-m");
    p.addParameter("30"); 
    p.run();
}

The first instance of the function goes fine (with exit value 0). But all the following report the exit value 3, i.e. URL malformed. But when I check the URL string on Serial monitor all strings are the same structure (with slightly different values). Also the length of strings are identical...

The first is okay:

length: 191
http://192.168.0.5/fve/bmv_data.php?V=25180&I=-5454&CE=-43892&SOC=935&TTG=4673&H1=-341219&H2=-308417&H3=-265152&H4=33&H5=0&H6=-11189110&H7=14779&H8=31723&H9=184977&H10=25&H17=26616&H18=32438&
exit: 0

The second is the same but with exit error - value 3 - url malformed:

length: 191
http://192.168.0.5/fve/bmv_data.php?V=25177&I=-5415&CE=-43998&SOC=935&TTG=4648&H1=-341219&H2=-308417&H3=-265152&H4=33&H5=0&H6=-11189246&H7=14779&H8=31723&H9=185047&H10=25&H17=26616&H18=32438&
exit: 3

Any idea??? I know the string is quite long but this should be the point... I also tried to add flush() function at end with no result.

Thanks for your hints!

Miroslav

http://192.168.0.5/fve/bmv_data.php?V=25180&I=-5454&CE=-43892&SOC=935&TTG=4673&H1=-341219&H2=-308417&H3=-265152&H4=33&H5=0&H6=-11189110&H7=14779&H8=31723&H9=184977&H10=25&H17=26616&H18=32438&

The last "&" from ...H18=32438& make url not wellformed. fix it?

Use Linux console test every URL string on Serial monitor:

curl  URLstring