Skip to main content
RCELI.1
Associate
May 31, 2023 1:30 PM UTC
Question

How to modify the TX/RX part of LoRa ping pong STM32 communication ?

Hello everyone,

I am currently new to the STM32 environment.

I am working with two b-L072z-LoRaWAN modules and I would like to establish peer-to-peer Lora communication between them. My goal is to configure one of the modules as a transmitter (TX) and the other as a receiver (RX) in order to send and receive messages, thus enabling a ping-pong communication between the two modules.

I would like to know how I can modify the LoRa Ping pong program code to

make one module function as a master in transmitter mode and the other module

as a slave in receiver mode.

Any help or advice would be greatly appreciated.

This topic has been closed for replies.

4 replies

IIRHO.1
ST Employee
May 31, 2023 2:50 PM UTC

Hello @RCELI.1​  and welcome to ST Community

I advice you to take a look at the demonstration LocalNetwork . This demonstration contains 2 projects , the first implements a Concentrator sending Beacon to administrate a Network of up to 14 sensors and receives each connected Sensor's data and the second implements Sensor sending Sensor

data to the demo concentrator. this demonstration is based on the Ping Pong application with some modification to have  a master in transmitter mode and the other module as a slave in receiver mode. this video can be helpful also .

Hope this is helpful .

If this is what you need , I suggest you to mention this answer as best answer so that the information will be defused.

Issam

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.
Tesla DeLorean
Guru
May 31, 2023 3:14 PM UTC

https://github.com/drakkar-lig/st-lrwan/blob/master/Projects/Multi/Applications/LoRa/PingPong/src/main.c#L252

Strip out a lot of the junk in the switch/case statements. Most everything of consequence is in the primary loop in main()

https://github.com/drakkar-lig/st-lrwan/blob/master/Projects/Multi/Applications/LoRa/PingPong/src/main.c#L252

The Listener primarily needs to be using Radio.Rx( RX_TIMEOUT_VALUE ); and restarting that after errors, timeout, or actual reception of data.

You can queue things in RxDone() callback

https://github.com/drakkar-lig/st-lrwan/blob/master/Projects/Multi/Applications/LoRa/PingPong/src/main.c#L391

The Talker needs to be using  Radio.Send( Buffer, BufferSize ); when it has data.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
RCELI.1
RCELI.1Author
Associate
Jun 6, 2023 10:03 AM UTC

Thank you for your reply.

I have modified the switch/case instructions and used Radio.Rx(RX_TIMEOUT_VALUE) for listening and Radio.Send(Buffer, BufferSize) for sending data.

However, the problem persists: the RX and TX parts are not modified so that one module becomes master in transmitter mode and the other module becomes slave in receiver mode, allowing ping-pong communication between the modules.

Sondos
Associate II
Jun 5, 2024 8:37 AM UTC

Have you reached any solution I am trying to do the same thing can you please help me if you reached anything?