Why does my Sodaq One V2 send three messages over Lora when it should be just one?

Hello,

Looking for the problem that I mentioned in this post, I narrowed it down to the RN2483 module, where for a reason that I cannot understand the Lora module RN2483 seems to be instructed to send 3 times the same message as it can be seen in the following log:

[wakeUp]
[send]
[macTransmit]
>> mac tx uncnf 6 0B01190900000064000000051D172847333313413333DD417B145142
[expectString] ("ok") ..
>> mac tx uncnf 6 0B01190900000064000000051D172847333313413333DD417B145142
[expectString] ("ok") ..
>> mac tx uncnf 6 0B01190900000064000000051D172847333313413333DD417B145142
[expectString] ("ok") ..
[lookupMacTransmitError]: mac_tx_ok
[lookupMacTransmitError]: not found!
[receive]
[receive]: There is no packet received!
[sleep]

Why is this happening? If I am instructing my module to send just one messages and not acknowledged as you can see in my call to issue a message.

status = LoRaBee.send(port, (uint8_t*) packet, packetSize);

The main problem is that that behaviour makes the Lora module stall and it is not responsive anymore till I complete power off the deviceā€¦

Kind regards

Hi @Jan

Looking into the RN2483.cpp I see that there is a call to send the STR_CMD_MAC_TX three times, what is this needed for?

uint8_t Sodaq_RN2483::macTransmit(const char* type, uint8_t port, const uint8_t* payload, uint8_t size)
{
    debugPrintLn("[macTransmit]");

    bool status = false;

    for (size_t ix = 0; ix < 3 && !status; ix++) {// <== Why ix<3?
        print(STR_CMD_MAC_TX);
        print(type);
        print(port);
        print(" ");

        for (int i = 0; i < size; ++i) {
            print(static_cast<char>(NIBBLE_TO_HEX_CHAR(HIGH_NIBBLE(payload[i]))));
            print(static_cast<char>(NIBBLE_TO_HEX_CHAR(LOW_NIBBLE(payload[i]))));
        }

        println();
        status = expectOK();
    }
...
}

Hi @ndarkness

Looks like something went wrong with talking to the module.
Can you buildin a delay between wakeup and send?

Kind regards,
Jan

I will do it and check the ouput. Could you tell me why is that forloop there to send three times the command?

Regards

How long should be the delay?

Hi @Jan

I have done that setting a delay of 1s and the issues persitsā€¦ What more can be done?

The reason why it is repeating the send command (for a maxium of three times), is because it is not seeing the expected response from the RN2483 module. From the log, it does not seem to be getting any response, which indicates that the module may have stalled prior to sending the message.