IPEX Connector + External Antenna

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:

  1. 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?
  2. 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?

Thank you very much

Welcome to the forum @tomhorme

RAK3172 Pin definition

If you are using a RAK3172 stamp module with an IPEX connector on it, the RF pad is not connected.

If you want to use the RF pad, you have to use the RAK3172 variant without an IPEX connector.

If you want to mess around with your RAK3172 (warranty void), you can connect the RF pad by bridging a resistor and remove the IPEX connector:

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 :slight_smile:
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);

Thank you for your help :slight_smile:

Make sure you disable RX mode with api.lora.precv(0); before you make any changes to P2P settings.
While in RX mode, you will get an error.

The frequency will be set in Hz, so to setup 868MHz. the command is api.lora.pfreq.set(868000000)

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:

uint8_t BoardGetHardwareFreq(void)
{
    uint8_t hardwareFreq = 0;
    GPIO_InitTypeDef GPIO_InitStruct = {0};

    /* GPIO Ports Clock Enable */
    __HAL_RCC_GPIOB_CLK_ENABLE();
    /*Configure GPIO pin : PB12 */
    GPIO_InitStruct.Pin = GPIO_PIN_12;
    GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
    hardwareFreq  = HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_12);

    HAL_GPIO_DeInit(GPIOB,GPIO_PIN_12);
    return hardwareFreq;
}

so I don’t get how it could return a frequency value.

In the Arduino IDE I set the board as RAK3172 Evaluation Boards, if it helps.

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

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