TheThingsNetwork / workshops

Workshops for The Things Network
MIT License
81 stars 31 forks source link

Send non-string data from LMIC #26

Closed abszolut closed 7 years ago

abszolut commented 8 years ago

I would like to upload numbers to the MQTT server with Dragino LoRa shield 1.3 and Arduino Uno. Now I can only upload string like this wtih Lora-LMIC 1.51 library:

{\"Temperature": 18.00,"Humidity\": 47.00}

Thank you

johanstokking commented 8 years ago

@abszolut if I understand correctly you're looking for a way to send bytes using LMIC 1.51?

cc @tftelkamp

tftelkamp commented 8 years ago

From an Lora-LMIC 1.51 example:

LMIC_setTxData2(1, mydata, strlen((char *)mydata), 0);

'mydata' can contain anything, it doesn't need to be a human readable string.