things4u / ESP-1ch-Gateway

Version 6 of the single channel gateway
MIT License
358 stars 143 forks source link

Problem when decoding payload #65

Closed antonio-emilio closed 3 years ago

antonio-emilio commented 3 years ago

When LOCALSERVER is on, we can decode the payload if we add the informations (Device addr, net key, app key) before. But I noticed the decode isn't working 100%.... In the middle of the text, i receive an "3" in the position 23/24. Does anyone knows what this might be?

     ```

Serial.print(F("UP receivePacket:: Ind=")); Serial.print(index); Serial.print(F(", Len=")); Serial.print(LoraUp.size); Serial.print(F(", A=")); for (int i=0; i<4; i++) { if (DevAddr[i]<0x0F) Serial.print('0'); Serial.print(DevAddr[i],HEX); }

      Serial.print(F(", Msg="));
      for (int i=0; (i<statr[0].datal); i++) {
        if (statr[0].data[i]<0x0F) {
          mydata3 += '0';
        }
        mydata3 += String(statr[0].data[i],HEX);