-
Notifications
You must be signed in to change notification settings - Fork 49
incorrect output power settings #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
update - still working on power setting but I tried configuring one LORA unit via Arduino (Radiohead) and it cannot communicate with the CP configured unit. |
Major progress - The frequency configuration was not correctly implemented. The transmitting frequency was not actually getting set and defaulted to 434Mhz, not 915MHz. I think it worked because it was being done the same on both boards but tit was not transmitting optimally thus the poor range and RSSI. Now I get much better RSSI readings and much longer range. I'm still having issues with Arduino vs CP compatibility and will hold off on a PR until I resolve that. current diff: index 72d5d93..17ec80a 100644
--- a/adafruit_rfm9x.py
+++ b/adafruit_rfm9x.py
@@ -374,7 +374,7 @@ class RFM9x:
# Set preamble length (default 8 bytes to match radiohead).
self.preamble_length = preamble_length
# Set frequency
- self.frequency = frequency
+ self.frequency_mhz = frequency
# Set TX power to low defaut, 13 dB.
self.tx_power = 13
@@ -487,6 +487,7 @@ class RFM9x:
self._write_u8(_RH_RF95_REG_06_FRF_MSB, msb)
self._write_u8(_RH_RF95_REG_07_FRF_MID, mid)
self._write_u8(_RH_RF95_REG_08_FRF_LSB, lsb)
+ self.low_frequency_mode = 0
@property
def tx_power(self):
@@ -507,6 +508,7 @@ class RFM9x:
# Enable power amp DAC if power is above 20 dB.
if val > 20:
self.pa_dac = _RH_RF95_PA_DAC_ENABLE
+ val -= 3
else:
self.pa_dac = _RH_RF95_PA_DAC_DISABLE
self.pa_select = True |
Thanks for sorting this out @jerryneedell ! |
submitted PR #4 - I hope this fixes these issues. |
closed via PR #4 |
This is just a heads up It looks like the output power level is not being set correctly resulting in the output power being significantly lower than expected. What I thought was a simple fix, does not appear to have worked so I'll continue digging and will post a detailed explanation soon. I just wanted to put out a warning in case anyone else notices this.
In brief:
I think this patch is needed in any case, but it does not seem to result is a significant improvement.
From the data sheet and comparing to the Arduino RadioHead code, subtracting 3 from the request power should be done here to ensure that the value sent to the register at lin 507 (requested power -5) is between 0 and 15. The register only accepts a 4 bit value. Without this change, a setting of 23 will result in a value of 18 being sent, but 18 &0xf is 2 not the desired 15 for maximum power.
https://github.com/adafruit/Adafruit_CircuitPython_RFM9x/blob/master/adafruit_rfm9x.py#L513
patch to fix power level:
Applying this patch does not result in the expected output power improvement so I'll keep looking into it,
The text was updated successfully, but these errors were encountered: