adafruit / Adafruit_CircuitPython_RFM9x

CircuitPython module for the RFM95/6/7/8 LoRa wireless 433/915mhz packet radios.
MIT License
68 stars 45 forks source link

fix RSSI, implement updates for errata #57

Closed jerryneedell closed 3 years ago

jerryneedell commented 3 years ago

addresses #31 and #51

implement changes per the errata in https://semtech.my.salesforce.com/sfc/p/#E0000000JelG/a/2R000000HSPv/sqi9xX0gs6hgzl2LoPwCK0TS9GDPlMwsXmcNzJCMHjw

added a new kwarg "agc" which can be set to enable the automatic Gain Control - Default is False to disable so there is no change to existing behavior. The only change to existing behavior is to set bit 7 of Register 0x31 per the errata. For all BW except 500K it is now set to 0.

To address some of the items in #51 several new attributes were added: auto_agc -- set via agc kwarg or can be set manually after init low_datarate_optimize - defaults to 0 can be set if desired lna_boost_hf -- defaults to 0 (off) nay be set to 3 to enable auto_ifon -- controls bit 7 of register 0x31 (used internally when setting BW) detection_optimize - (use internally when setting SF)

I have verified that these changes "do no harm" that is my existing programs still work.... I have not thoroughly tested the impact of fiddling with the agc,low_datarate_optimize or lan_boost_hf. They do set the registers as desired. I do not have a very good way to test the impact.

I also verified that this can still be frozen in to the feather_m0_rfm9x build

jerryneedell commented 3 years ago

@brentru Do you want me to go ahead and merge/release or would you prefer to see if there are any other comments? I'm in no rush. Once it is merged, I can put in a PR to update the feather_m0_rfm9x build for CP.

brentru commented 3 years ago

@jerryneedell go ahead and merge 👍

maholli commented 3 years ago

@jerryneedell I'm working remote so I can't test anything, but your updates reflect what I found working prior.

For anyone that had CRC / corrupt packet issues (I remember seeing at least 2 issues or questions on the forums) I HIGHLY recommend trying again with low_datarate_optimize enabled on both ends.

Thanks for implementing Jerry!!