Lora P2P Only first message received

I purchased the following components to setup LoRA communications between a couple of boards:

  1. Wisblock meshtastic starter kit based on
    RAK19007 ( WisBlock Base Board 2nd Gen)
    RAK4631 (LPWAN )
    RAK1921 (OLED display)
    RAK12500 ( GNSS Location Sensor Module)
    RAK1904 (3-Axis Acceleration Sensor Module)
    RAK1901 (temp&hum sensor)
  2. Second board based on
    RAK19007 ( WisBlock Base Board 2nd Gen)
    RAK11200 (WisCore ESP32)
    RAK13300/EU868 (LPWAN module)
    RAK1921 (OLED display)
    RAK12500 ( GNSS Location Sensor Module)

I setup a very simple test using OOB examples for each board, i.e.

For board 1:

For board 2:

Using this, I can receive one message on board 2, to be precise only the first message right after rebooting the board. All the rest are never received (get the rxtimeout)

Log from the receiver:

20:34:17.364 -> ets Jul 29 2019 12:21:46

20:34:17.364 ->

20:34:17.364 -> rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)

20:34:17.364 -> configsip: 0, SPIWP:0xee

20:34:17.364 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00

20:34:17.364 -> mode:DIO, clock div:1

20:34:17.364 -> load:0x3fff0030,len:1240

20:34:17.364 -> load:0x40078000,len:13012

20:34:17.364 -> load:0x40080400,len:3648

20:34:17.364 -> entry 0x400805f8

20:34:18.338 -> =====================================
20:34:18.384 -> LoRaP2P Rx Test

20:34:18.384 -> =====================================

20:34:18.451 -> Starting Radio.Rx

20:34:19.664 -> OnRxDone

20:34:19.664 -> RssiValue=-19 dBm, SnrValue=13

20:34:19.664 -> 48 65 6C 6C 6F

20:34:22.675 -> OnRxTimeout

20:34:25.641 -> OnRxTimeout
...

Any idea what I could be doing wrong?

Thanks,
Jaime

Difficult to say, the examples are quite old and originally designed to work between two identical Core modules.
Can you share the log output of the transmitter as well?

Can you try the WisBlock-P2P-RX-TX example.

I wrote it a few days ago and tested on RAK4631, RAK11200 and RAK11310 (with mixed configurations).

Hi Bernd,
Thanks a lot for your help. I reviewed the code example you pointed to.
It caught my attention that in the example I use, radio reception timeout is set to RX_TIMEOUT_VALUE (3000):
Radio.Rx(RX_TIMEOUT_VALUE);
while in the code you provided is set to 0 (“continuous” according to the function doc):
Radio.Rx(0);

I changed all occurrences in the example code I’m using to Radio.Rx(0) and now I receive messages all the time. In any case, I’ll try the code you provided.
Thanks again,
Jaime

Setting a timeout for RX is only required for power savings. E.g. in case you don’t need to listen all the time, you can use the RX timeout to listen only for a specific time. This could be that after sending a packet the device expects a response from the other node. If the response doesn’t come within the time-out the device could repeat sending its packet.

But in this examples, the RX can be kept active all the time. While transmitting a packet, the LoRa transceiver will switch its mode. After TX finished, the RX is enabled again.

Thanks Bernd,
In my case the idea is that the RAK11200 (powered by mains) will act as “base station” receiving data from several RAK4631 (running on batteries) acting as “mobile clients”. Most of the time communication will be unidirectional from the mobile clients to the base station (the idea is not to implement an “ACK”). In that scenario, I understand that Radio.Rx(0) for the base station is the best approach.
What I still don’t understand in the “old” example is that, when any event happens (OnRxDone, OnRxError, OnRxTimeout), the associated function handling the event ends up calling Radio.Rx(RX_TIMEOUT_VALUE), for example:

void OnRxTimeout(void)
{
	Serial.println("OnRxTimeout");
	Radio.Rx(RX_TIMEOUT_VALUE);
}

My understanding of this code was that when a timeout event happens, the device is set again in Rx mode for another RX_TIMEOUT_VALUE ms, so actually it should not miss any message (it would be a kind of “continuous” reception mode with the exception of these timeout events). However, based on the observed behavior, that is not the case.
It would be nice to understand the exact behavior.

Thanks,
Jaime

If you use Radio.Rx() with a timeout value you have to restart RX every time after an event.
On any radio event the LoRa Transceiver will be set to sleep.

Hi Bernd,
Thanks again for your help. In that case, I guess the code in LoRaP2P_Rx example I mentioned at the beginning is incomplete.

and it won’t work irrespective of being two identical Core modules or not.

Thanks,
Jaime-