Beginer questions about RadioLib SX1262 #1556
Replies: 8 comments 31 replies
-
Hi there, and welcome! The thing you're looking for is called a default argument. This is a mechanism that lets you assign a default value to a function or method argument that will be used if no other value is provided. For C++ methods, it is usually located in the header file. So continuing your example, for RadioLib/src/modules/SX126x/SX1262.h Lines 32 to 47 in b91c6af
Word of advice, don't use that thing for anything more than to give you links to real sources or better yet - throw it into the garbage. I understand it feels like its helping you, but it really, really isn't. |
Beta Was this translation helpful? Give feedback.
-
I have another question... For settings, I think I have to use the overloaded Is this variant ok ?
Or this variant ?
And then, for pins... Where should I call:
Do I need to use |
Beta Was this translation helpful? Give feedback.
-
Here's another one... |
Beta Was this translation helpful? Give feedback.
-
Lets say I'm in RX listening mode and I received a packet. I read the packet and now I want to transmit a replay. I use: What should I do if |
Beta Was this translation helpful? Give feedback.
-
The timeout for |
Beta Was this translation helpful? Give feedback.
-
This should be the final software for communication between 2 LoRa SX1262 modules with RadioLib... What do you think ? Is not tested yet... I still have to make the hardware wirings between the LoRa and ESP32 modules... https://github.com/MarusGradinaru/lora-p2p/blob/main/lora_client_server_example.cpp The software is the same for both the Client module and the Server module, and the version is chosen during compilation through the "#define TX_MODULE" directive. I implemented 2 test commands: CMD1 and CMD2, which send the command along with a small data buffer, and receive another buffer with the requested data back... The commands are sent when touching the GPIO4 and GPIO2 pins of the ESP32-DevKitC. |
Beta Was this translation helpful? Give feedback.
-
@jgromes please allow me one last question before powering up my modules.
But on Pico, I learned from the internet that I must do in this way:
They say that on Pico version I must configure manually the CS pin, because on this framework the CS is set by default to be software controlled. But, when I call |
Beta Was this translation helpful? Give feedback.
-
Thank you guys for helping me with this project ! What @jgromes did is not just a library, it is a work of art ! 😍 I finally did the field test... I attached the modules and the antenna to a piece of cardboard and attached them to the top of a stick. I left one right at the gate, where my yard begins (it's 350m long and 11m wide), then I took my laptop with me, along with the other module connected via USB and tested the connection from place to place, sending a command to the stationary LoRa server and receiving a packet back from it. The results are as follows:
Both modules have 5 dBi stick antennas and were configured as follows:
The full software can be found here: What do you think ? 😃 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi !
I am verry new to RadioLib and LoRa. Basicaly, it is my first time !
I want to make a peer-to-peer connection between 2 LoRa modules with SX1262 chip.
I use VSCode with Platform IO and Arduino framework to program it. The control device will be ESP32-DevKitC.
I have been studying the RadioLib library for some time, with the help of ChatGPT, but it doesn't have all the answer for my questions. So I decided to ask those who know better. I will start with the first one... and then, others will follow.
In the
SX126x_Settings.cpp
example, I see that the module can be initialized with and without parameters:int state = radio1.begin();
state = radio2.begin(915.0, 500.0, 6, 5, 0x34, 2, 20); - this is SX1268, but it doesn't matters here
I searched through the library source files but I can't find any declaration of the
begin()
without parameters. I was curious to see what are the default parameters and to understand how things works (I am learning C++ too). The onlybegin()
method I found is with parameters, in theSX1262.cpp
file:I searched other files too, but with no luck...
So, can someone share a link to the RadioLib source file where I can understand why the
begin()
can be called without parameters ?Thanks !
Beta Was this translation helpful? Give feedback.
All reactions