You should not think in characters, but only in bits and bytes. See Working with Bytes in the documentation and learn that strcpy((char *) mydata,"{\"Hello\":\"World\"}");
in your example code is bad practice.
When you understand bits and bytes, the uint8_t mydata[64]
in the example won’t be your problem: increasing that will make your own code compile just fine. However, the LMiC library you’re using has a limit of 51 bytes (totalling to 64 bytes when including the 13 bytes LoRaWAN headers). So without modification of that library, even using all 64 bytes in uint8_t mydata[64]
will already fail as that would exceed the 51 bytes LMiC can send. To increase the maximum size in the libraries, see LMiC fails to send application payload larger than 51 bytes and https://github.com/matthijskooijman/arduino-lmic/issues/100.
But still then, in many (or all) regions, the maximum payload size is 51 bytes for SF12, so trying to go beyond that might be futile.
The good news: I doubt each of your 10 sensors needs a lot of bytes for its measurements. If only few need, say, 6 bytes and most just need 1 or 2 bytes, or even just half a byte or a single bit, then the total result will probably fit just fine.
For an example of combining a 4 bits and 12 bits value into 2 bytes, see here.