RAK3172 3.4.2-rui3_22q1_update.112 AT+PRECV=65534 doesn't work?

I updated RAK3172 version from 1.04 to 3.4.2-rui3_22q1_update.112
Below I have listed the commands that I run on Device A and the problem with receiving responses

AT+VER=?\r\n
AT+VER=3.4.2-rui3_22q1_update.112\r\n
OK\r\n

ATZ\r\n
\r\n
RAKwireless RAK3172-E Example\r\n
------------------------------------------------------\r\n
Current Work Mode: LoRa P2P.\r\n

AT+NWM=0\r\n
\r\n
RAKwireless RAK3172-E Example\r\n
------------------------------------------------------\r\n
Current Work Mode: LoRa P2P.\r\n

AT+P2P=869525000:7:250:0:8:5\r\n
OK\r\n

AT+PSEND=0D0076454BB0054C3230007BA5\r\n //data is received on second device (Device B)
OK\r\n

AT+PRECV=65534\r\n
OK\r\n

And now I have a problem. I don’t get the response from Device B. There is no data to read on serial port (I’m sure taht device B sends a reply)
When i changed version to 1.04 everything works fine.

Welcome to RAK forum @marcin1008 .

I tried the same setting you have and I can successfully do it without issue.

But I am not sure about your exact sequence, are the two devices change state from TX to RX and vice versa?

It will be helpful for me to assist you if you can share the sequence on both Device A and Device B.

Hi @carlrowan

Unfortunately, device B is an external device to which I do not have access and I do not know how exactly the transmission is implemented there. I can only say that communication with Device B worked, when Device A was in version 1.04

for a device A in pseudo-code it looks like this

while (true)
{
AT+VER=?\r\n
ATZ\r\n
AT+NWM=0\r\n
AT+P2P=869525000:7:250:0:8:5\r\n
AT+PSEND=0D0076454BB0054C3230007BA5\r\n //data is received on second device (Device B )
AT+PRECV=65534\r\n
//waiting for data on serial port with timeout
}

Hi @marcin1008 ,

This will be difficult to troubleshoot unless we have access to Device B.

It tried it and seems to work. Could your situation be timing issue?

Ok, thanks for help. I will try check timings :slight_smile:

We had the same issue. Looks like the rak module crashes on the AT+NWM=1 command.

I’am not sure that is a root couse.
I tried remove AT+NWM=0 command from my flow, because after ATZ i got info
RAKwireless RAK3172-E Example\r\n
------------------------------------------------------\r\n
Current Work Mode: LoRa P2P.\r\n

so i don’t need to change to P2P manually, but it doesn’t help.

Welcome to RAK forum @arne ,

I am not sure what your experience with AT+NWM=1 is but it should restart the module automatically. If you can give more info or details, we will check it :white_check_mark:

Thanks! We just started using the rak 3172. Good to know that this is by design, apparently we missed this in the at command manual.

Hi @carlrowan , could you give more details about why the device restarts?

it is possible to work switching from LoRaP2P and LoRaWAN modes using the arduino API (api.lorawan.nwm.set() and api.lora.nwm.set())? or doing so leads to an undefined state?

If possible I would like to know if the answer to this questions are valid for rak_rui 4.2.0

The LoRaP2P and LoRaWAN have different implementation. Making them work simultaneously is hard to do because once you receive a packet, you must handle it in accordance to the protocol you are trying to use - plain LoRa or with LoRaWAN stack?

If you really need something that will switch from LoRaP2P ↔ LoRaWAN, the possible way is use ABP then disable all frame counter checks. This way, you can always restart the module once you switch mode then send the LoRaWAN packet directly using the same sessions keys. I haven’t personally tested this but it is likely to work. Doing this however, removes security features implemented on LoRaWAN protocol.

1 Like