cancel
Showing results for 
Search instead for 
Did you mean: 

LoRa transmission with STM32WL55

Kampi
Associate III

Hi,

I try to build up a HAM LoRa APRS system with STM32 and I don´t receive any messages in my gateway. For testing purposes, I use an 868 MHz gateway and an RAK3172 module. The RAK3172 module is configured as shown below:

Initialize the LoRa module (use 868 MHz for testing)

- Frequency: 868 MHz (868000000)
- Spreading Factor: 12 (12)
- Bandwidth: 125 kHz (0)
- Code Rate: 4/5 (0)
- Preamble Length: 8 (8)
- Tx Power: 14 dBm (14)


AT+NWM=0
AT+P2P=868000000:12:0:0:8:14

Transmit a coordinate point via APRS

- Header: <FF01
- Payload: DO2DKH-7>APLG01:!4932.05NL01047.50E&Test

AT+PSEND=3CFF01444F32444B482D373E41504C4730313A21343933322E30354E4C30313034372E353045265465737432

After transmitting the message via "PSEND" I receive it in my gateway

Received packet 'Source: DO2DKH-7, Destination: APLG01, Path: , Type: Position Without Timestamp, Data: !4932.05NL01047.50E&Test2' with RSSI -40dBm, SNR 11.75dB and FreqErr 17145.003906Hz

I tried the same with my STM32WL55-Nucleo. I configured the RF switch pins for HP usage

Kampi_0-1704547768720.png

and the SubGHz middleware with the LoRa settings

Kampi_1-1704547818700.png

Kampi_2-1704547830407.png

Then I use the following code to transmit a test message after the initialization of the SubGHz middleware

 

 

void SubghzApp_Init(void)

{

/* USER CODE BEGIN SubghzApp_Init_1 */

 

/* USER CODE END SubghzApp_Init_1 */

 

/* Radio initialization */

RadioEvents.TxDone = OnTxDone;

RadioEvents.RxDone = OnRxDone;

RadioEvents.TxTimeout = OnTxTimeout;

RadioEvents.RxTimeout = OnRxTimeout;

RadioEvents.RxError = OnRxError;

 

Radio.Init(&RadioEvents);

 

/* USER CODE BEGIN SubghzApp_Init_2 */

 

Radio.SetChannel(868000000);

 

Radio.SetTxConfig(MODEM_LORA, TX_OUTPUT_POWER, 0, LORA_BANDWIDTH,

LORA_SPREADING_FACTOR, LORA_CODINGRATE, LORA_PREAMBLE_LENGTH,

LORA_FIX_LENGTH_PAYLOAD_ON,

true, 0, 0, LORA_IQ_INVERSION_ON, 3000);

 

Radio.SetRxConfig(MODEM_LORA, LORA_BANDWIDTH, LORA_SPREADING_FACTOR,

LORA_CODINGRATE, 0, LORA_PREAMBLE_LENGTH, LORA_SYMBOL_TIMEOUT,

LORA_FIX_LENGTH_PAYLOAD_ON, 0, true, 0, 0, LORA_IQ_INVERSION_ON,

true);

 

Radio.SetPublicNetwork(true);

 

Radio.SetMaxPayloadLength(MODEM_LORA, 128);

 

Radio.Sleep();

 

uint8_t Buffer[] = {

0x3C, 0xFF, 0x01, 0x44, 0x4F, 0x32, 0x44, 0x4B,

0x48, 0x2D, 0x37, 0x3E, 0x41, 0x50, 0x4C, 0x47,

0x30, 0x31, 0x3A, 0x21, 0x34, 0x39, 0x33, 0x32,

0x2E, 0x30, 0x35, 0x4E, 0x4C, 0x30, 0x31, 0x30,

0x34, 0x37, 0x2E, 0x35, 0x30, 0x45, 0x26, 0x54,

0x65, 0x73, 0x74, 0x32

};

radio_status_t status = Radio.Send(Buffer, sizeof(Buffer));

 

/* USER CODE END SubghzApp_Init_2 */

}

But I don´t receive the message with my gateway and "OnTxDone" isn´t called despite a successful transmission indicated with "RADIO_STATUS_OK" in "status".

What is missing here?

1 ACCEPTED SOLUTION

Accepted Solutions
STTwo-32
ST Employee

Hello @Kampi 

To implement such application, i suggest you start from this End_Node example. You can use his configurations as a start for your project. Also, you can refer to the AN5406 for more details. 

PS: you can find some help on this MOOC.

Best Regards.

STTwo-32 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
STTwo-32
ST Employee

Hello @Kampi 

To implement such application, i suggest you start from this End_Node example. You can use his configurations as a start for your project. Also, you can refer to the AN5406 for more details. 

PS: you can find some help on this MOOC.

Best Regards.

STTwo-32 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Kampi
Associate III

Hi @STTwo-32,

the LoRaWAN examples aren´t the right ones, but I used the SubGhz_Phy_PingPong example for transmission and it works. 

Hi @Kampi 

Happy that your project works. The example i've shared with you is a LoRawan end node example wish is using the LoRawan technologie. But the PingPong example is just a Local point to point communication example using the Lora communication protocol.

Best Regards.

STTwo-32 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello, I am new and I have a small problem with the End_Node_example. I am also using the STM32WL55 board. It is important to know that before sending my data via LoRa, I am receiving this same data via UART with the help of a PIC16 board. Now, I can successfully receive the data via UART if I comment out the "MX_LoRaWAN_Init" and "MX_LoRaWAN_Process" functions in my "main.c" file. However, when I uncomment them, I only receive the first data frame and I do not understand where the problem is. The idea is to send the UART data I receive into a LoRaWAN network, so I am using "UART_Receive_IT" and in my callback function "HAL_UART_RxCpltCallback," I am trying to send my data.

Please help me, I am stuck.

Best regards.