[SOLVED] Heltec ESP32 LoRa Receive Interrupt

m_sut_2
Posts: 2
Joined: Wed Feb 24, 2021 7:34 pm

[SOLVED] Heltec ESP32 LoRa Receive Interrupt

Postby m_sut_2 » Wed Feb 24, 2021 7:43 pm

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;
  }
    
}
Last edited by m_sut_2 on Sat Feb 27, 2021 9:11 pm, edited 1 time in total.

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: Heltec ESP32 LoRa Receive Interrupt

Postby chegewara » Thu Feb 25, 2021 11:30 pm

LoRa device is not capable to receive data when it is in TX mode.

m_sut_2
Posts: 2
Joined: Wed Feb 24, 2021 7:34 pm

Re: Heltec ESP32 LoRa Receive Interrupt

Postby m_sut_2 » Sat Feb 27, 2021 10:58 am

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?

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: Heltec ESP32 LoRa Receive Interrupt

Postby chegewara » Sat Feb 27, 2021 1:25 pm

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

Who is online

Users browsing this forum: No registered users and 108 guests