In line 289, no error is generated, but it doesn't work. The output shown below is missing ("field" + allSensors*.field + '=')* * *House Temperaturesower is: 64.40&field2= 72.14&field3= 72.95&field4= 62.28&field5= 59.18* * curiously, the 'else channelHouseStr = channelHouseStr + "&field" + allSensors*.field + "=" + tempStr;' works fine.* What's going on here?
Same problem you had before: The const char * variable types ("field" in your sketch) doesn't have the + operator overloaded to allow concatenation. If channelHouseStr is a string (null-terminated char array), then use strcat() or sprintf(). If it's a String object, then first generate a String out of "field" before trying to concatenate.
So, the second 'else' line works because the first item is a type String, but the original 'if' line fails because "field" is not a string. How do I turn "field" into a string? (intuitively, "field" looks like a string to me.)
Looks like memory corruption to me, although it's possible it is just a bug in your code. Can you post a complete sketch that demonstrates the problem - preferably one without a lot of extraneous code?
Incorrect. "field" is a string. It is NOT a String. Again, note the difference in capitalization. strings don't support concatination via the plus operator; Strings do.
Arrch:
Incorrect. "field" is a string. It is NOT a String. Again, note the difference in capitalization. strings don't support concatination via the plus operator; Strings do.