Sending LoRa messages on a specific frequency
Colin Crook last edited by
I am completely new to pycom but I have been searching around for the answer to assist with a project I have. I would like to send data on a specific frequency rather than the device selecting one from in the range in whatever region you are in. For me I am EU so its 868.x.
Forgive me if I am getting the terminology wrong in any of this. I noticed in the firmware and API reference that it looks like there is a frequency argument that does just this:
"frequency accepts values within the selected Region frequency bands."
I would very much like to know if this can be used with something like the example provided here?: https://docs.pycom.io/tutorials/networks/lora/lorawan-otaa/
If it is I will quite happily buy some kit.
@Colin-Crook If you want full control the best option is to use raw LoRa, and then simulate what the LoRaWAN stack does (mostly adding quite a bit of overhead to the packets, including addresses, frame counters, checksums, etc.).
Note sure how the frequency comes into play though, but my guess is that you're probably more interested in manipulating what is actually included in the frames, which (unless you modify the LoRaWAN stack), is probably much easier to do with raw LoRa.
Colin Crook last edited by
@jcaron oh thats interesting. I must have been getting confused between the two. My project is about LoRaWAN security and I was looking for a way to simplify playing an attack on a specific frequency. Maybe I'll have to rethink how I recreate the attacks. Papers on the subject are very good on what they did and not how they did it :) Thanks for the replies.
@Colin-Crook there are two modes of operation for LoRa:
raw LoRa let’s you control exactly what frequency, spreading factor, bandwidth and other parameters you want to use. But the sender and receiver need to agree on the exact settings.
LoRaWAN is built on top of LoRa, and defines a set of rules about the settings for each region, as well as MAC procedures, including joins, confirmed packets, retransmits, settings updates, etc. This is what is used by LoRa networks such as TTN and many others. There you have much less choice, and you need to follow the settings chosen by the network. In many regions such as the EU 868 region there are actually very few choices left to the node.
I always had trouble getting it to send to the right bands even though I selected the right area..
I added this before I joined:
(You need to substitute your correct frequencies, these are the US915 band)
for i in range(0, 71): lora.remove_channel(i) print('Removed default channels') time.sleep(1) # Set US ISM 915 channel plan for TTN US lora.add_channel(0, frequency=903900000, dr_min=0, dr_max=3) lora.add_channel(1, frequency=904100000, dr_min=0, dr_max=3) lora.add_channel(2, frequency=904300000, dr_min=0, dr_max=3) lora.add_channel(3, frequency=904500000, dr_min=0, dr_max=3) lora.add_channel(4, frequency=904700000, dr_min=0, dr_max=3) lora.add_channel(5, frequency=904900000, dr_min=0, dr_max=3) lora.add_channel(6, frequency=905100000, dr_min=0, dr_max=3) lora.add_channel(7, frequency=905300000, dr_min=0, dr_max=3)