RAK3172 P2P Not working

Hello,

I am using RUI3 V4.2.0 and trying the LoRa P2P communication. I am attaching the code. The device is transmitting the first time but after that it is not transmitting. After every reset it will send the data once. I have flashed the AT command firmware and tried sending data using AT+PSEND=data and it is successfully working multiple times.

Looking for suggestions to make the code work

Regards,
Sri

LoRa_P2P_Test.ino (895 Bytes)
lora_util.cpp (1.4 KB)
lora_util.h (1.4 KB)

Welcome back @Steve1

api.lora.pfreq.set(LORA_BAND);

cannot work.

You defined LORA_BAND as LORA_REGION_IN865, which is just a number 0 to 15, not a frequency.
Lora Regions are for LoRaWAN, not for LoRa P2P.
Try

#define LORA_BAND (865062500)

to use 865.0625kHz as send frequency.

In header file lora_util.h i have defined as follows
#define LORA_BAND (LORA_REGION_IN865)
#define LORA_REGION_IN865 865000000
#define LORA_REGION_EU868 868000000

That should work right? Or should I give it directly in the API without using macros?

Regards,
Steve

Why do you use api.system.restoreDefault();?
It is not necessary to restore system defaults on every reboot. It is only needed if something is messed up with the settings.

Removing that line and it works.

Thank you. It is working now.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.