itoa
yields text; don’t send text.
Instead, see for example How to use the DHT22 with LMiC? and Decrypting messages for dummies which then for you might be something like:
// Keep 1 decimal; the true accuracy is probably even less
// Signed
int16_t temp = 10 * tempC;
// Unsigned
uint16_t batt = 10 * measuredvbat;
uint8_t radiopacket[4];
radiopacket[0] = temp >> 8;
radiopacket[1] = temp;
radiopacket[2] = batt >> 8;
radiopacket[3] = batt;
// Do NOT subtract 1 from the size here; that's only for text
LMIC_setTxData2(1, radiopacket, sizeof(radiopacket), 0);
…along with:
function Decoder(bytes, port) {
// Sign-extend 16 bits to 32 bits to support negative temperatures
var temp = bytes[0]<<24>>16 | bytes[1];
// Battery cannot be negative
var batt = bytes[2]<< 8 | bytes[3];
return {
temperature: temp / 10,
battery: batt / 10
};
}
Please see the extended explanation in the posts I linked above. All untested.