Hello, this may be a very specific question.
I’m currently developing a intregation code with BME280 and a heltec wifi lora 32 v2 board. I’m adapting the code from https://github.com/ph2lb/LoRaWAN_TTN_Env_Node in order to send the temperature, humidity and pressure to my chirpstack server. I have to change the library used in the original code in order to use the BM280 library from platformio and removed other code that I will not use.
The problem I’m currently having is when the the Lora sends the payload to the server, the data that comes in the uplink is corrupted.
This is how I’m building the data:
int t = (int)(temp); int p = (int)(pressure); int h = (int)(humidity); unsigned char mydata; mydata = h & 0xFF; mydata = t >> 8; mydata = t & 0xFF; mydata = p >> 8; mydata = p & 0xFF; LMIC_setTxData2(1, mydata, sizeof(mydata), 0);
And this is how is comming in the uplink package:
* data:"LQAgA+Q=" If you translate from basecode64 it will result in trash-code. Why is happening this?