mcci-catena / arduino-lmic

LoraWAN-MAC-in-C library, adapted to run under the Arduino environment
https://forum.mcci.io/c/device-software/arduino-lmic/
MIT License
645 stars 211 forks source link

Reduction of the maximum current when using a smaller button cell #943

Open devicplan opened 1 year ago

devicplan commented 1 year ago

How could I reduce the transmit power (maximum current when transmitting) so that a rather weak CR2032 in my LoraWAN temperature sensor ( https://icplan.de/seite45/ ) can be used longer. I run a LoRa gateway myself and the transmit power does not need to be particularly high with it. I am using an ATMEGA328P with RFM95 and LMIC software version 4.1.1. Thanks for any help and support

slavendam commented 1 year ago

Use function call LMIC_setDrTxpow(data_rate, tx_power); to set data rate (SF) and transmit power. data_rate should be values 0 to 5. If you don't want to change manually SF, just set LMIC.datarate to stay the same. tx_power should be values of power. Default is 14. Maximum is 20, minimum -4

So e.g. LMIC_setDrTxpow(LMIC.datarate, 2); // this will leave SF the same, but will reduce power to 2 LMIC_setDrTxpow(0, 8); // this will set SF12 for EU, or SF10 (highest) for US, and power will be 8