sx1276 FSK reception non-sensitive #1797
Replies: 5 comments 8 replies
|
Hmmm, seems like there is a typo here, although it does not explain the poor sensitivity: SX1278::setGain(uint8_t gain) {
What's missing in the gain=0 case is: |
|
The person who did the clearest test wrote this (lightly edited):
" I placed my [transmitter] about 50m away with a 10dB inline attenuator
and a 1/4 wave copper wire antenna directly connected. I have a short mast
on my workshop with a simple 1/4 wave and groundplane antenna cabled
indoors. I have various fixed and variable inline attenuators that I apply
until I reach failure point (roughly where by eye 50% packets are received,
the cutoff is quite sharp).
Using [FSK] I consistently found:
[Radiolib] failed with 12dB inline attenuation (-75 RSSI reported)
[old library] failed with 41dB inline attenuation (-99 RSSI reported)
...
I then swapped to [LORA], ... both [library] versions seem to behave about
the same. I say about because I could not make it fail even by
disconnecting the antenna cable from the input to my attenuators! Only when
the pigtail was unplugged from the attenuator did it finally give up the
ghost. Remarkable."
Message ID: ***@***.***
… .com>
|
|
Maybe there is a bug in the function SX127x::calculateBWManExp(float bandwidth)? My code passes to beginFSK() the bandwidth value 234.3f (intended for a single-sided bandwidth of 125 KHz, with the modulation being +-50KHz FSK). The register RADIOLIB_SX127X_REG_RX_BW seems to be set to 0x00. (Seen via a readReg() after the setup.) The old library sets it to 0x02. 0 is not a valid value. That function should not return 0 unless the loop runs out without hitting the return((m << 3) | e); Note that I changed this line in that function: Or maybe I should not give it the bandwidth value 234.3? I got it from example code from somebody else. (The value 234.3 is one of the valid values for the sx1262.) The comment in SX1276.h says: |
|
Experimental results: I already had the LNA boost turned on, and AGC enabled. Now just changed the rx bandwidth (passed from my app to Radiolib) from 234.3 to 250.0 KHz. So that the rx bw setting function in Radiolib can actually work, rather than setting that register to 0 which is invalid. Now I get reception down to a reported RSSI of about -100, while earlier it was failing at about -76. So that was the main issue. I am thinking of also changing some other registers too, to make them more like the old library sets them. Those would be:
|
|
Also noted some inconsistencies: For the sx1276 the bandwidth passed to RadioLib is treated as single-sided. E.g., I passed 250.0 and it set the register to 1, which is 250 single-sided (table 40). Compare that to the sx1262 code, which translates 234.3 to the register value 0x0A, which AFAIK is 234.3 KHz double-sided (table 6-4)? The sx1276 code only checked the passed bandwidth against a range, which is why I ended up with 0 in the register and poor reception. The sx1262 code checks the passed bandwidth against the exact valid values (+- 0.001), otherwise it returns an error code. The LR1110 code finds the "best fit" valid value, thus if you pass it 200.0 it will give you 234.3. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Using the same hardware (T-Beam) with an sx1276, and 2 versions of the software (SoftRF), one using RadioLib and one using an older "basicmac" library, experiments show that the RadioLib version is 30dB (!) less sensitive in reception. This is in the 915 MHz band. I cannot find the reason. The sx1276 is set up with the normal beginFSK() call etc. I did notice that the LORA begin() takes a "gain" parameter, but beginFSK() does not - even though the setGain() function has a section for FSK. So I added setGain(0) to the code in SX1276::beginFSK(). Also added this line into SX1278::setGain() after the line turning on AGC when gain=0:
state |= mod->SPIsetRegValue(RADIOLIB_SX127X_REG_LNA, (1 << 5) | RADIOLIB_SX127X_LNA_BOOST_ON);
(Note: the sx1276 class is derived from the sx1278 class.) Still, no change in the rx sensitivity. What am I missing? 30dB is a lot. Maybe there is an issue with the rx/tx switching, not happening for FSK?
All reactions