Here is your for loop:
for (int iCount = 0; iCount < iNumOfSens; iCount++) {
memset(sTempC, 0, sizeof(sTempC));
float fTempC = sensors.getTempCByIndex(iCount);
dtostrf(fTempC, 5, 2, sTempC);
sprintf(xUrl, "/json.htm?type=command¶m=udevice&hid=1&did=0%d&dunit=1&dsubtype=9&dtype=80&nvalue=0&svalue=%s", iCount, sTempC);
ether.browseUrl(PSTR(""), xUrl, sServer, brw_cb);
Serial.println(xUrl);
}
It gets a temperature, converts it to a string, ans sends it to the server.
Here is your code without the "and sends it to the server part".
for (int iCount = 0; iCount < iNumOfSens; iCount++) {
memset(sTempC, 0, sizeof(sTempC));
float fTempC = sensors.getTempCByIndex(iCount);
dtostrf(fTempC, 5, 2, sTempC);
sprintf(xUrl, "/json.htm?type=command¶m=udevice&hid=1&did=0%d&dunit=1&dsubtype=9&dtype=80&nvalue=0&svalue=%s", iCount, sTempC);
Serial.println(xUrl);
}
See the difference?
Here is the code that gets all the sensor data, and sends it to the server after getting it all:
for (int iCount = 0; iCount < iNumOfSens; iCount++) {
memset(sTempC, 0, sizeof(sTempC));
float fTempC = sensors.getTempCByIndex(iCount);
dtostrf(fTempC, 5, 2, sTempC);
sprintf(xUrl, "/json.htm?type=command¶m=udevice&hid=1&did=0%d&dunit=1&dsubtype=9&dtype=80&nvalue=0&svalue=%s", iCount, sTempC);
Serial.println(xUrl);
}
ether.browseUrl(PSTR(""), xUrl, sServer, brw_cb);
Now, the problem with the last code is that it will send only the last reading.
The interesting part of the URL is "&svalue=%s" where the temperature is sent.
Now, suppose that you defined an array that contained "/json.htm?type=command¶m=udevice&hid=1&did=0%d&dunit=1&dsubtype=9&dtype=80&nvalue=0&" that had room for iNumOfSens "svalue=%s" blocks of data. Could you define such an array?
Keep in mind that "&svalue=%s" needs to have a numeric value, to distinguish the 1st value from the 2nd, the 3rd, etc.
Could you create a sprintf() statement that output "&svalue%d=%d" with a value for the ist parameter (the loop index) and the second value (the temperature from the ith sensor)?
Appending the nth string to the base string is done using strcat(). Do you know how to call that function?