Open IoTThinks opened 1 month ago
Hi @IoTThinks
I am facing a similar issue, I am unable to receive downlink messages. In my case, I don't even get the "Data received over RX1" message. Is downlink broken? Did you find a solution?
I have two things conserning this same type of observation. First, I use TheThingsNetwork TTN V3.
Hardware setup: Heltec WiFi Lora V2 hardware and bare otaa example from lib. Uplink functionality is flawless. However downlink does not work unless two things are changed. First in file LoRa-arduino-rfm.cpp line 115 I have changed: LoRa_Settings.Rx1_Delay = 5000; // Thing stack seems to be 5000 ms (so Rx2_delay 6000 ms) LoRa_Settings.Rx2_Delay = 6000; // Rx2_Delay >= Rx1_Delay + RX1_Window This to be compliant to TTN V3 ( tried to change ttn to 1000 mS but does not work and device will not join network with 1000mS in RX1 delay) Second change: In update() methode //Type A mote transmit receive cycle: if (Buffer_Rx.Counter != 0x00) { bool isConfirmed = ((Message_Rx.MAC_Header & 0xE0)>>5) == 5 ? true : false ; // MType uint8_t fPort = Message_Rx.Frame_Port; if(lora.messageCallback) lora.messageCallback(&Buffer_Rx, isConfirmed, fPort); //Buffer_Rx.Counter = 0x00; // clear counter for the next cycle Rx_Status = NEW_RX; Serial.println("Data received over RX1");
}
Bold is required change, this is by no means the ’true fix’ but now it works for me. The only part I don’t understand is that the port is not having any effect or reflected in recv event. I would have expected som kind of port to be reflected in readData(outStr,fPort) or similar construction.
I have two things conserning this same type of observation. First, I use TheThingsNetwork TTN V3.
Hardware setup: Heltec WiFi Lora V2 hardware and bare otaa example from lib. Uplink functionality is flawless. However downlink does not work unless two things are changed. First in file LoRa-arduino-rfm.cpp line 115 I have changed: LoRa_Settings.Rx1_Delay = 5000; // Thing stack seems to be 5000 ms (so Rx2_delay 6000 ms) LoRa_Settings.Rx2_Delay = 6000; // Rx2_Delay >= Rx1_Delay + RX1_Window This to be compliant to TTN V3 ( tried to change ttn to 1000 mS but does not work and device will not join network with 1000mS in RX1 delay) Second change: In update() methode //Type A mote transmit receive cycle: if (Buffer_Rx.Counter != 0x00) { bool isConfirmed = ((Message_Rx.MAC_Header & 0xE0)>>5) == 5 ? true : false ; // MType uint8_t fPort = Message_Rx.Frame_Port; if(lora.messageCallback) lora.messageCallback(&Buffer_Rx, isConfirmed, fPort); //Buffer_Rx.Counter = 0x00; // clear counter for the next cycle Rx_Status = NEW_RX; Serial.println("Data received over RX1");
}
Bold is required change, this is by no means the ’true fix’ but now it works for me. The only part I don’t understand is that the port is not having any effect or reflected in recv event. I would have expected som kind of port to be reflected in readData(outStr,fPort) or similar construction.
Thank you, that fixes the issue. I have checked the release of July 2023, and the downlinks were working. Buffer_Rx.Counter = 0x00;
was reset on the readData function and not on the update function (image of July 2023 release attached).
I have also included some modifications to make easier decoding from cayenneLPP to JSON. I can confirm that with this modification the downlinks are working. I think this project is much easier to use and modify compared to LMIC, and should keep improving. Thanks.
The device can join LoRaWAN network and I can send a downlink packet.
The device "hears" something but can not print it.
Last year, I tested downlink ok. I suspect the new code broke the downlink. https://github.com/ElectronicCats/Beelan-LoRaWAN/blob/master/src/arduino-rfm/lorawan-arduino-rfm.cpp#L506