jgromes / RadioLib

Universal wireless communication library for embedded devices
https://jgromes.github.io/RadioLib/
MIT License
1.59k stars 395 forks source link

LLCC68 dosn't work in SF11 #425

Closed steven52880 closed 2 years ago

steven52880 commented 2 years ago

Additional info (please complete):

Describe the bug Hello. My module can't work while begin with 500k and sf10/sf11.
[SX1262] Initializing ... failed, code -20 I found another issue about it, but the problem dosn't seem to be resolved. Could you help me check the problem?

Log

[SX1262] Initializing ... M     SX126x
CMD     80
DATW    0       A2

CMD     80
DATW    0       A2

CMD     8F
DATW    0       A2      0       A2

CMD     8A
DATW    1       A2

CMD     93
DATW    20      A2

CMD     88
DATW    3       A2      18      A2      A       A2      0       A2      0       A2      0       A2      0       A2

CMD     2
DATW    3       A2      FF      A2

CMD     8
DATW    0       A2      0       A2      0       A2      0       A2      0       A2      0       A2      0       A2      0       A2    

CMD     89
DATW    7F      A2

CMD     11
DATR    0       A2      0       1

Symbol length: 4.10 ms
CMD     8B
DATW    B       A2      4       A2      3       A2      0       A2

CMD     11
DATR    0       A8      0       FF

failed, code -20

To Reproduce

radio.begin(434.53, 500.0, 11, 7, '\022', 10, 8, 0);
jgromes commented 2 years ago

You're right, LLCC68 is missing a dedicated begin, so it's actually calling SX1262::begin, which is the reason why the range checks fail.

I added the missing method, so it should be fixed now.

steven52880 commented 2 years ago

setBandwidth should be ahead of setSpreadingFactor, or it will exit with -9. @jgromes

jgromes commented 2 years ago

You'Re right, that's indeed the case when using non-default parameters for begin(). It should be be fixed now.