Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downlink no longer works #197

Open
IoTThinks opened this issue May 26, 2024 · 5 comments
Open

Downlink no longer works #197

IoTThinks opened this issue May 26, 2024 · 5 comments

Comments

@IoTThinks
Copy link
Contributor

The device can join LoRaWAN network and I can send a downlink packet.
image

The device "hears" something but can not print it.
image

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

@Andermutu
Copy link

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?

@ghost
Copy link

ghost commented Jun 17, 2024

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.

@Andermutu
Copy link

Andermutu commented Jun 17, 2024

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.

Captura desde 2024-06-17 17-15-31

Captura desde 2024-06-17 17-18-11

REGIOIGER added a commit that referenced this issue Jun 25, 2024
@REGIOIGER
Copy link
Contributor

Thanks IoTThinks and Andermutu. Your contributions are appreciated and we will continue to work to improve the library.

REGIOIGER added a commit that referenced this issue Aug 2, 2024
Temp fix for issue #197 Downlink no longer works - esp32
@reibuehl
Copy link

reibuehl commented Sep 9, 2024

I just ran into the same issue with v2.5.0 which is the latest version available in the Arduino IDE library manager. I was able to fix it with the changes from the June 17 posts above but would like to know when there will be a release with the fix as this seems to be solved now since >2 months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants