Page 1 of 1

[SOLVED] Heltec ESP32 LoRa Receive Interrupt

Posted: Wed Feb 24, 2021 7:43 pm
by m_sut_2
Hi,

I’m trying to make a LoRa sender/receiver board.

Therefore the plan is to send some messages whenever I want, but if there is an incoming packet, I want to interrupt the sending-process (for beginning without any sending retries) and receive the incoming packet.

I tried the mix of the Heltec examples “OLED_LoRa_Sender” and “LoRaReceiverInterrupt”, and it works fine until I’m sending and receiving a message at the same time. Then the receive interrupt does not interrupt.

How can I solve that?

Thanks a lot in advance

Code: Select all

void loop(){
  if (sendMsg && !receivingMsg) { // sendMsg drives true, if PRG button is pressed receivingMsg drives try in "void onReceive(int packetSize)"
    /*
    Heltec.display->clear();
    Heltec.display->setTextAlignment(TEXT_ALIGN_LEFT);
    Heltec.display->setFont(ArialMT_Plain_10);

    //Serial.println(WiFi.macAddress());
    Heltec.display->drawString(0, 0, "Sending packet: ");
    Heltec.display->drawString(0, 15, WiFi.macAddress());
    Heltec.display->drawString(100, 15, String(counter));
    Heltec.display->display();
    */
    LoRa.beginPacket();
    LoRa.setTxPower(14,RF_PACONFIG_PASELECT_PABOOST);
    LoRa.print("hello ");
    LoRa.print(counter);
    LoRa.endPacket();

    delay(10); // give me time to bring up serial monitor

    counter++;

    // put the radio into receive mode
    LoRa.receive();

    sendMsg = false;
  }
    
}

Re: Heltec ESP32 LoRa Receive Interrupt

Posted: Thu Feb 25, 2021 11:30 pm
by chegewara
LoRa device is not capable to receive data when it is in TX mode.

Re: Heltec ESP32 LoRa Receive Interrupt

Posted: Sat Feb 27, 2021 10:58 am
by m_sut_2
chegewara wrote:
Thu Feb 25, 2021 11:30 pm
LoRa device is not capable to receive data when it is in TX mode.
Thank you.
So therefore, if the LoRa is in transmission mode, it is not possible to recognize that there is a message to receive from another node?

Re: Heltec ESP32 LoRa Receive Interrupt

Posted: Sat Feb 27, 2021 1:25 pm
by chegewara
m_sut_2 wrote: Thank you.
So therefore, if the LoRa is in transmission mode, it is not possible to recognize that there is a message to receive from another node?
Yes.
Pages: 36, 38, 39:
https://semtech.my.salesforce.com/sfc/p ... qcpqh9qSjE