arduino-libraries / MKRWAN

An Arduino library for sending and receiving data using LoRaWAN protocol and LoRa® radios.
https://www.arduino.cc
GNU Lesser General Public License v3.0
88 stars 60 forks source link

Spreading factor ? #12

Open ldesomer opened 6 years ago

ldesomer commented 6 years ago

Hi, Which SF does the library support ? Is it possible to modify it ? Thanks for your help.

facchinm commented 6 years ago

Hi @ldesomer, the underlying firmware ( https://github.com/arduino/mkrwan1300-fw ) doesn't provide this yet, but we would be glad to receive pull requests :wink:

ldesomer commented 6 years ago

Hi @facchinm, Thanks for your reply, I'll try to work on it... How is the SF chosen by the firmware ? Or is it fixed ? :)

facchinm commented 6 years ago

It looks like the spreading factor is only set during RF_TEST (https://github.com/arduino/mkrwan1300-fw/blob/ed493cec30273953e92ccdd210f2ef4240ef35fa/Projects/Multi/Applications/LoRa/AT_Slave/src/test_rf.c#L98), I don't know the LoRAWAN standard well enough to know if it can be changed (if not running point-to-point)

dan0h commented 6 years ago

Hi, so am I reading correctly here - there is no way to configure the spread factor on the MKR1300 at sketch level? Or, is it something that would have to be done in firmware?

facchinm commented 6 years ago

Probably there is a way to do it by changing the LoRaWAN stack on the firmware but it's quite a big effort.

matthijskooijman commented 2 years ago

What you can do, is set the data rate (DR) using the dataRate() method. This configures one of the DR's from the LoRaWAN spec, each of which uses a specific SF. This does not allow choosing arbitrary or non-standard SF's, but is the normal way of configuring the DR/SF to use.