Downlink messages are sent seemingly corrupted

Hello everyone,

I am new here, and the LoRa ecosystem is kind of new to me in general, so sorry if my question is dumb… Also, I checked around here and in the GitHub issues if the problem I am facing was already reported by someone else, and I couldn’t find anything about this.

At work I was given the task to create an Arduino/ESP32 program; this program has to send and receive data using LoRaWAN.
I frst tried using TTN and now I have to move to the company’s internal Chirpstack server, which I had to set up.

I installed, on two separate VMs :

  • The latest version of the v3 branch available on the APT repository.
  • The latest testing version of the v4 branch + the v3 Gateway Bridge, also installed via the APT repository (by the way, great job for this v4 version, the UI is blazing fast!).

My devices are set up to authenticate using OTAA, and the Uplink messages are successfully sent and HTTP integrations are working fine.

However, when it comes to sending Downlink messages, I am facing an issue.

I’m using the TTN_ESP32 library, as long as this piece of code for decoding the incoming payload :

void message(const uint8_t* payload, size_t size, int rssi)
{
    Serial.println("-- MESSAGE");
    Serial.println("Received " + String(size) + " bytes RSSI=" + String(rssi) + "db");
    
    char* payloadChr = (char*)payload;
    for(int i = 0; i < size; i++) {
      Serial.println(String(i) + " -> " + String(payloadChr[i])); 
    }
    Serial.println();
}

With TTN, everything is working as expected, sending the following bytes 48 69 20 4c 6f 52 61. I get an “Hi LoRa” message.
With Chirpstack, the content seems both misplaced into the array and corrupted.
Sending attempts :

  • via the Chirpstack V3 HTTP API
  • via the Chirpstack V3 UI with base64-encoded value SGkgTG9SYQ==
  • via the Chirpstack V4 UI with the hex bytes 48 69 20 4c 6f 52 61

Capture d’écran du 2022-07-20 18-00-31

As I saw “Hi” letters were on indexes 5 and 6 of the array, I changed the loop to for(int i = 5; i < size + 5; i++) but with no luck… “Hi” letters are correctly displayed but the other characters are corrupted like on the above screenshot.

The data is correctly visible in the queue, but I don’t understand why it can’t be read by my program.

Have you got any ideas/suggestions? Feel free to ask if you need any extra information.

I’d be surprised if it is due to the fact the library I’m using could only support TTN, as as far as I understood it should be standard LoRaWAN communications…

Thanks by advance :slight_smile:

  • Clément