sandeepmistry / arduino-LoRa

An Arduino library for sending and receiving data using LoRa radios.
MIT License
1.65k stars 630 forks source link

Adding LNA Support for sx1278? #399

Closed IoTThinks closed 3 years ago

IoTThinks commented 4 years ago

Hi guys, It seems that this library does not support LNA gain yet?

image

I believe LNA gain can help sx1278 to receive packet near -140dBm RSSI and below -21 SNR. Therefore, it could help to receive packets farther.

This library has hasGain function for this purpose: https://github.com/jgromes/RadioLib/blob/master/src/modules/SX127x/SX1278.cpp#L316

Any supporting idea?

IoTThinks commented 4 years ago

@morganrallen @sandeepmistry Do you have any idea on this? Thanks a lot. :D

sandeepmistry commented 4 years ago

@IoTThinks do you have a proposed API(s) in mind? Would you be able to pull request for this?

NOTE: LnaBoostHf is currently set to 0x03 in begin(...).

IoTThinks commented 4 years ago

@sandeepmistry May be, I will create my very first Pull request :D So by default, the LnaBoostHf is set to enable LNA for high frequency 868-923Mhz?

image

Do you think we need to set LnaBoostLf for low frequency like 433Mhz? image

IoTThinks commented 4 years ago

I'm able to make it works. I will make a function setGain(byte gain). Gain is from 0 to 6.

If the gain is 0, then AGC will be on.

image

I realize that LNA in HF 868/915/923 is better than LF 433 Mhz in default gain 0. Therefore, RSSI for HF is better than for LF 433Mhz.

With AGC off and gain 6, I can now have RSSI -20 with two 433Mhz nodes in 20cm.

Will try to make it works and create a pull request.

IoTThinks commented 3 years ago

Added pull request at https://github.com/sandeepmistry/arduino-LoRa/pull/408