LoRa and the Ra-02 modes of operation - Page 1
Forum section: electronics / general

author: Dajgoro
author_rank: Frequent Contributor
timestamp: November 07, 2022, 09:50:39 am
content: HiSo I got a few arduino devboards with the Ra-02 module.I found a sketch that transmits and receives and it works just fine.https://how2electronics.com/interfacing-sx1278-lora-module-with-arduino/But the sketch just initializes the lora and goes straight into transmitting, while the other side just receives, no device address or anything specific is present in it.I'm not exactly sure how it works, from what I see its just a wideband transmission that anyone can receive at any time.I went googling more about it, but I just can't seem to find any docu referring to this and if there is more to it, or is this just how it is supposed to work?Am I then supposed to put my own device id in the transmissions?

author: moep
author_rank: Newbie
timestamp: November 07, 2022, 04:25:04 pm
content: I had a brief look at the linked guide. As far as I can tell the sketch just uses plain LoRa and simply broadcasts a raw value on the selected frequency with the modules default spreading factor. Your understanding is correct: there is no adressing, no encryption or similar. Just plain LoRa. Also note that the receiving part will just receive any LoRa transmission in range - so expect receiving weird packets from others.The misleading part in his guide is that he does explain (briefly) how LoRaWANworks - while not using it. The guide also does not distinguish between the two protocols LoRa and LoRaWAN.I'd suggest to you to have a quick research on the difference between the two protocols. Basically LoRa is the low level physical layer protocol (modulation, frequencies, etc.) while LoRaWAN handles things like adressing, forwarding, encryption, integration with Servers/Internet etc. As the name implies LoRaWAN uses LoRa and puts things on top of it. But there are explanations out there way better that I could ever explain. Just do a quick search on your own.If you're missing the mentioned features like adressing, encryption etc. you might want to have a look at LoRaWAN and not use "plain" LoRa as in the linked article.

author: Dajgoro
author_rank: Frequent Contributor
timestamp: November 08, 2022, 10:24:41 am
content: Thanks for the info!I'm looking into making a mesh network, so from what I see I'll need to implement everything ontop of this demo, have my own protocol, data verification, security, etc...So basically I just format my payload, send it as is shown in the demo and reject all unknown traffic, right?

author: moep
author_rank: Newbie
timestamp: November 08, 2022, 01:05:00 pm
content: Yes that's basically how to proceed.Note that you're not the first one who needed a LoRa mesh network. There are other projects claiming to provide such functionality. I haven't used any of them, they may or may not fit your needs.Of course programming your own protocol can have its own advantages.Just some other things i noticed revisiting the URL in your original post:I'd suggest not to follow his guide on how to wire the LoRa module. He is using Arduino 5V I/O pins for a 3.3V device, which can cause unreliable communication or might damage the module permanently. Use a 3.3V microcontroller or level shifter instead.Theused librarylooks a bit messy to me and seems rather unmaintained. Note that this is not the only library, there areothers, too. I haven't used any of these, choose one at your own will.

author: Dajgoro
author_rank: Frequent Contributor
timestamp: November 08, 2022, 02:06:59 pm
content: Yes, tho for test I got some off the shelf devboards, ultimately I'll be doing my own boards, so I didn't even look into his wiring.But now I more or less have all the info I couldn't find. Thanks a lot!