Lora P2P can not receive data continuously

In example Lora_P2P.ino

If I block the lines of code like below I can’t get the data continuously. I only get the first 1 frame after resetting.

As far as I understand:
The locked code is only relevant to sending packets. Why does it affect the reception of incoming packets?

How can I receive packets continuously.

void loop()
{
uint8_t payload[] = “payload”;
bool send_result = false;

//if (rx_done) {
//    rx_done = false;
//    while (!send_result) {
//        send_result = api.lorawan.psend(sizeof(payload), payload);
//        Serial.printf("P2P send %s\r\n", send_result ? "Success" : "Fail");
//        if (!send_result) {
//            Serial.printf("P2P finish Rx mode %s\r\n", api.lorawan.precv(0) ? "Success" : "Fail");
//            delay(1000);
//        }
//   }
//}

delay(500);

}

This is the full code:

Thank you.

The example code you are pointing to is setting RX mode for 3000ms in the setup():
api.lorawan.precv(3000)

If you need continuous RX mode, you need to change the time in precv
Check the API documentation for precv to select the correct value you need:

1 Like

I really don’t have the patience to read the docs before using it.
I’m sorry about that and will learn to do some research before asking questions.

Thank you!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.