Skip to main content
Kranthi Reddy
Associate II
February 6, 2023
Question

How to initiate LoRa and Transmit - Receive data through LoRa in B-L072Z-LRWAN1. I am using UART and USB to transmit and receive data earlier. Now I wanted to do this through LoRa, but I have no clue about this, if anyone help it would be useful.

  • February 6, 2023
  • 3 replies
  • 2514 views

..

This topic has been closed for replies.

3 replies

vchau.2
Associate III
February 6, 2023

Download STM32CubeExpansion_LRWAN_V2.1.0 firmware. and customize the firmware as per your requirement

Kranthi Reddy
Associate II
February 7, 2023

Do we have to configure LoRa in .ioc? If we have to configure, what to configure? I tried including LoRa libraries in my main.c file but its showing error as "Unresolved Inclusion". How to configure LoRa or how to install libraries related to it, in STM32CubeExpansion_LRWAN_V2.1.0 there is no .h file to copy from there but code is getting executed, when i try to customize that code my costomized code is showing error, so it would be better in understanding if someone says about configuration of LoRa in .ioc configurations?

vchau.2
Associate III
February 7, 2023

No, NO .ioc file in this project, You have to implement your code in existing code.

let me know "what configuration you want to change in LoRa"

Kranthi Reddy
Associate II
February 7, 2023

I want to configure B-L072Z-LRWAN1 Board-1 to transmit data through USB device only(CDC) and one another board-2 to receive data, if board-2 after receiving data, if it send some data then board-1(which is connected to PC) have to receive it.

FBard.2
Visitor II
March 3, 2023

Hello.

I am sorry. But i don't understand how to set the Lora (and not Lorawan) configuration to transmit a simple Hello World with the STRKT01 board.

It's a pity, i did not succeed with the pong ping (or reverse) program. As it mentioned the subghz_phy. and i did not find it in the fp-atr-Lora software.

In my opinion, i have to search in the SX1276 and the radio library.

In radio -> with the RadioModems_t struct :

  • Set modem Lora
  • Set Tx Transmission

and after that use the -> ( *Send )( uint8_t *buffer, uint8_t size );

Maybe i took it to simple.

Is someone can help me on this ?

Regards

Tesla DeLorean
Guru
March 3, 2023

The older library, materially something along the lines of...

 // GPIOs and related peripherals, etc
 HW_Init();
 
 // Radio initialization
 RadioEvents.TxDone = OnTxDone;
 RadioEvents.RxDone = OnRxDone;
 RadioEvents.TxTimeout = OnTxTimeout;
 RadioEvents.RxTimeout = OnRxTimeout;
 RadioEvents.RxError = OnRxError;
 
 Radio.Init(&RadioEvents);
 
 Radio.SetChannel(RF_FREQUENCY);
 
 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);
 
 while(1)
 {
 // Management Loop
 ..
 
Handle States
 case IDLE::
 
 Radio.Send(Buffer, BufferSize); // When Idle
 
 case TX:
 case TX_TIMEOUT:
 case LOWPOWER:
 
Handle LowPower
 }

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..