matthijskooijman / arduino-lmic

:warning: This library is deprecated, see the README for alternatives.
705 stars 651 forks source link

Set initial spreading factor for ADR #215

Closed DefProc closed 5 years ago

DefProc commented 5 years ago

What is the intended way of setting a fixed spreading factor?

Should this be done in the library files, or in the Arduino Sketch?

DefProc commented 5 years ago

OK, I was having a little trouble with getting LMIC_setDrTxpow() to actually change the spreading factor, but - to answer my own question:

  LMIC_setAdrMode(1); // turn ADR on
  LMIC_setLinkCheckMode(1); // enable link check mode on
  LMIC_setDrTxpow(DR_SF12, 14); // start at SF12
  do_send(&sendjob); // join

then in do_send():

LMIC_setTxData2(1, myPacket, sizeof(myPacket), 1); // want ACK for ADR packets
jmessiasalves commented 3 years ago

Hi,

I am using AU915. How to set DR_SF8 with BW 500kHz? When set with LMIC_setDrTxpow (DR_SF8, 14) the BW is only 125kHz.

Thank you in advance.

Att.,

matthijskooijman commented 3 years ago

IIRC this version of LMIC does not support AU915 at all, maybe you are using another version and are asking in the wrong place?

Also, does the AU915 spec actually define a SF8+500kHz datarate? If not, it might not be easy to use it, since then there is no DR identifier for it and you might need to manually set the rps value (and maybe change LMIC to not overwrite it) or change LMIC to add a custom DR somehow.

jmessiasalves commented 3 years ago

@matthijskooijman ...thanks for listening. Sorry for the post in the wrong place. I'm using the MCCI_LoRaWAN_LMIC_library which offers the AU915 frequency plan. Anyway, thank you very much indeed.

MexHigh commented 5 months ago

@DefProc

OK, I was having a little trouble with getting LMIC_setDrTxpow() to actually change the spreading factor, but - to answer my own question

Where do you call these functions? I've seen it inside the EV_JOINED event handler. Did you put it there too?