Hi, I designed a custom board using RAK3172-8-SM-I chip with IPEX connector.
On the PCB I inserted also a PCB antenna tuned at 868MHz using a reference design (https://www.ti.com/lit/an/swra228c/swra228c.pdf). The PCB antenna is connected directly to the RF pin of the RAK3172.
When using the PCB antenna, I get very low performance in P2P mode: around -114dBm RSSI values when the transmitter and receiver are just few centimeters apart on the same table. If I do connect and external antenna using the onboard IPEX connector, then I get a very good performance: -14/-20dBm RSSI with the same setup.
My doubts are the following:
is it possible to use an external antenna on RF pin for RAK3172-8-SM-I? Or you can just connect an antenna via the IPEX connector?
if 1) is true, then my antenna has some design problems. However, I’m having difficulties in setting the right frequency. When I execute api.lora.pfreq.set(myFreq) the command fails with any frequency I tried. If I execute api.lora.pfreq.get() is always set to 867,100Mhz. Do you know why I cannot change the frequency?
Regarding api.lora.pfreq.set(myFreq);
Did you switch to LoRa P2P mode before using this API call? You can change LoRa P2P parameters only if the module is in LoRa P2P mode with api.lora.nwm.set()
Hi Bernd, thank you so much for the prompt and detailed answer
Perfect, I missed this point in the documentation, now it is clear why the PCB antenna was not working at all. I will try to remove the IPEX connector on one of my boards.
Regarding api.lora.pfreq.set(myFreq);
Yes, the command api.lora.nwm.set() has been executed successfully.
In fact I’m using the Arduino LoRa_P2P.ino sample code provided by RAKwireless. Even without any modification to the code I get the fail error during the execution of api.lora.pfreq.set(myFreq);
No success using api.lora.precv(0);, but I did some debugging:
if I skip all the checks and execute directly service_nvm_set_freq_to_nvm(868000000); then I can successfully change the frequency (I verified the real frequency using a SDR).
It seems that the problem is at the following check: BoardGetHardwareFreq();
It returns 0, while it should return the Board Frequency
Getting deep into the code, this is what is executed:
I think I found the issue:
I’m using PB12 as external GPIO, so the pin is connected to an external transistor. This is probably the reason why the chip cannot read PB12 correctly.
I thought PB12 was a pin free to use, but actually I found it is used internally.
I can confirm that disconnecting the PB12 pin from the rest of my circuit the command api.lora.pfreq.set(myFreq); is executed successfully. thank you for your help