How to avoid Raw LoRa collision on fully connected network
Hi, everyone. I am new to LoRa and got really stuck for quite a while. I am trying to working on raw lora (lora mac) of LoPy4. I have some questions about it.
First of all, does raw lora only works on a fixed single frequency? When I have a fully connected network of raw lora nodes, and multiple of them are sending messages at the same time, could other nodes receive all the messages? I have tested this with 5 nodes and 4 sending messages at the same time, the rest node could only receive from part of the nodes.
Second, can I make the nodes working on multiple frequencies so that each node could send message at a different channel? I assume that since a gateway could receive from multiple channels, there is no reason a raw lora node could not do it, right?
Please leave any message you think relevant to this, I am really stuck for a long time. Thank you.
rcolistete last edited by
@RyverSolare "lora.add_channel()" is for LoRaWan, while you are using LoRa-Raw.
You can define your own LoRa-some-name protocol, but the gateway will not be a LoRaWan gateway, using mono or multichannel by means of FHSS (Frequency-Hopping Spread Spectrum), etc.
@robert-hh Now I get it. Thank you a lot for this message, it really helps!
robert-hh last edited by
@RyverSolare The SX1276 chip of the Lopy4 listens to a single frequency. If you define several channels in the software, the Lora driver will pick one of these frequencies for sending and will then also listen at that frequency. Until the next transmission will be done at a different channel.
@robert-hh Thank you a lot for responding! I am working on LoPy4, would it be possible for me to add multiple channels on this device? I have tried this way:
lora = LoRa(mode=LoRa.LORA, region=LoRa.EU868, frequency=863000000) s = socket.socket(socket.AF_LORA, socket.SOCK_RAW) for x in range(0, 6): lora.add_channel(x, frequency=863000000 + x * 1000000, dr_min=7, dr_max=7)
However, this doesn't work when I set different frequencies during initialisation for different nodes. They cannot receive messages from each other.
robert-hh last edited by
@RyverSolare gateways and node typically have a different hardware set-up. The Chip used in nodes can only receive at one channel with one mode at a time. The chip sets used in gateways usually can listen to 8 channels and various modes simultaneously.
The protocol used in LoRaWan networks manages the nodes such that they get configured to 3 channels which they change randomly.
That is per se not enabled when you use raw LoRa. You may add that kind of channel hopping, but then you need a suitable hardware.
Otherwise you have to stick to a specific channel and spreading factor and deal with collisions.