Arduino hangs concatenatting chars

Hello guys.

I getting stuck with this:

When i trying to contactenating chars, the arduino get hangs.

char valDatos[100] ="valnMin=0&valnN1=0&valnN2=0&valnMax=0&valnAlarma=0&valestadoB1=0&valestadoB2=0";
char ip[16] = "111.111.111.111";

char url[100] = "GET /pozo/save.php?";                     
char host[] = " HTTP/1.1\r\nHost: ";
char host1[] = "\r\nConnection: close\r\n\r\n";             


strcat(url, valDatos);
strcat(url, host);
strcat(url, ip);
strcat(url, host1);
strcat(url, '\0');
memset(aux_str, '\0', 200);

Can help with that?
Thx very much.

char url[100] = "GET /pozo/save.php?";

Are you sure that the total number of characters written to the url array is less than (or equal to) 100 characters. The behavior that you describe can be from writing past the end of an array into memory that you do not "own".

char ip[16] = 111.111.111.111;

What the Hell is that?

TheMemberFormerlyKnownAsAWOL:

char ip[16] = 111.111.111.111;

What the Hell is that?

char ip[16] = "111.111.111.111"; sorry

char valDatos[100] =valnMin=0&valnN1=0&valnN2=0&valnMax=0&valnAlarma=0&valestadoB1=0&valestadoB2=0;

Is there anything else you want to redact?

(How does cut-and-paste go so badly wrong?)

groundFungus:

char url[100] = "GET /pozo/save.php?";

Are you sure that the total number of characters written to the url array is less than (or equal to) 100 characters. The behavior that you describe can be from writing past the end of an array into memory that you do not "own".

Not i am not sure, the problem are i dont understand how char works, and my english dont help to understand it... the google translator dont help too...

Can fix my code? to try understands where are my fault. Because, i am trying to undestand reading ofrum, tutorial, etc...for long weeks, and nothing...

i am the problem, i am...:frowning:

Your "url" array needs to be much bigger - "valDatos" and "url" is 98 characters, so the next operation will fail

TheMemberFormerlyKnownAsAWOL:
Your "url" array needs to be much bigger - "valDatos" and "url" is 98 characters, so the next operation will fail

The max are 160 characters, i was try url[200] but nothing... too hangs

You're going to have to post your code.

I think i finally find the problem, got another char aux_str[200] on same void.
Then aux_str [200] (and only need 20), + url [160] get out of memmory...

can be ?

Who knows?

All that we have seen is snippets of your code. We have no idea what else is going on in the code.

Please post the entire program. Post the error messages that you get. The more information that we have, the more help we can give.