jgromes / RadioLib

Universal wireless communication library for embedded devices
https://jgromes.github.io/RadioLib/
MIT License
1.55k stars 387 forks source link

LoRaWAN 1.0.x and SX176 returning RADIOLIB_ERR_LORA_HEADER_DAMAGED #1271

Closed oseiler2 closed 2 weeks ago

oseiler2 commented 2 weeks ago

RadioLib v7.0.2

I just came across an issue where activateOTAA returns RADIOLIB_ERR_LORA_HEADER_DAMAGED when using LoRaWAN spec 1.0.4 on an SX1276 ESP32 board. When I change the spec to 1.1 it works fine.

I've had a look through the source and believe that I have identified the root cause. processJoinAccept has a comment to ignore RADIOLIB_ERR_LORA_HEADER_DAMAGED for SX127x but does not override state - this only happens further down for spec 1.1 devices (state = LoRaWANNode::pushMacCommand), but not for 1.0.x. The method then returns RADIOLIB_ERR_LORA_HEADER_DAMAGED.

// downlink frames are sent without CRC, which will raise error on SX127x
  // we can ignore that error
  if(state != RADIOLIB_ERR_LORA_HEADER_DAMAGED) {
    RADIOLIB_ASSERT(state);
  }

Now that I was looking through the latest source to link from here I found a commit that should this issue: https://github.com/jgromes/RadioLib/commit/a7feeee1e03900cbf258c54abce182b05d38b800

I'll submit this issue for completeness, but feel free to close once that above commit is released. Thanks

jgromes commented 2 weeks ago

As you can see in #1262, the commit you have mentioned has been merged. To me it is quite pointless to keep open issues for resolved stuff. You can use the latest master if you really need to have this fixed, or you can wait for the next update.

Closing as duplicate.