-
Notifications
You must be signed in to change notification settings - Fork 8.4k
drivers: lora: LDRO and bandwith additions #100977
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
base: main
Are you sure you want to change the base?
Conversation
|
Okay was able to cross check using force-ldro, sx1278, and LLCC68, as expected they cant talk to each others when only one is forced into ldro, assuming the maths for the 16 ms is correct everything should be good. |
Add missing values and replace arbitrary BW enum with actual value Signed-off-by: Camille BAUD <mail@massdriver.space>
|
Well and went and checked the possible edge results for the maths with this little program: #include <stdio.h>
int main()
{
for (int sf = 5; sf < 12; sf++) {
for (float bw = 1000.0; bw > 5.0 ; bw/=2.0) {
int t = (1 << sf) / (int)(bw);
if (t > 10 && t < 22) {
printf("bw: %f (%d), sf: %d, t:%d\n", bw, (int)(bw), sf, t);
}
}
}
}Gets all the same result as the calculator so all good. |
Enable LDRO when it should be enabled Signed-off-by: Camille BAUD <mail@massdriver.space>
Allows Enabling LDRO all the time via DTS Signed-off-by: Camille BAUD <mail@massdriver.space>
|
| BW_500_KHZ = 500, /**< 500 kHz */ | ||
| BW_800_KHZ = 800, /**< 812 kHz */ | ||
| BW_1000_KHZ = 1000, /**< 1000 kHz */ | ||
| BW_1600_KHZ = 1600, /**< 1625 kHz */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the extra bandwidth options, whats the behaviour when an invalid bandwidth for the modem is selected? Does LBM reject it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it does (I think i tried it once? but LBM doesnt know about LLCC68 for example sooo), but it doesn't matter, I was working on this to solve those kind of possible issues: #100989



Add missing bandwidths, set enum to be value in khz, add missing sf
use enum value in khz to calculate approximate symbol time
use symbol time to determine if ldro should be enabled
add option to always enable ldro regardless of symbol time
symbol time checked against lora calculator https://www.semtech.com/design-support/lora-calculator, formula is good enough to match without using floats.
See any modem datasheet for 16ms/16.38ms times and the symbol rate / symbol time formulas