Skip to content
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

SX126x in FSK works with v6.6.0, but not with v7.0.0 or v7.1.0 #1353

Closed
matthias-bs opened this issue Dec 16, 2024 · 5 comments
Closed

SX126x in FSK works with v6.6.0, but not with v7.0.0 or v7.1.0 #1353

matthias-bs opened this issue Dec 16, 2024 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@matthias-bs
Copy link
Contributor

Describe the bug
I am using an SX1262 in FSK mode in a setup very close to SX126x_Receive_Interrupt.ino.

  • 868.3 MHz
  • Fixed packet length
  • CRC filtering disabled
  • Preamble: 32 bits
  • Sync word: 2 bytes

RadioLib v6.6.0

Works as expected, i.e. receives messages starting with 0xD4:

08:49:55:644 -> [   285][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 43 =========== Before Setup Start ===========
08:49:55:644 -> Chip Info:
08:49:55:646 -> ------------------------------------------
08:49:55:646 ->   Model             : ESP32-S3
08:49:55:646 ->   Package           : 0
08:49:55:650 ->   Revision          : 0.02
08:49:55:651 ->   Cores             : 2
08:49:55:653 ->   CPU Frequency     : 240 MHz
08:49:55:656 ->   XTAL Frequency    : 40 MHz
08:49:55:659 ->   Features Bitfield : 0x00000012
08:49:55:661 ->   Embedded Flash    : No
08:49:55:663 ->   Embedded PSRAM    : No
08:49:55:666 ->   2.4GHz WiFi       : Yes
08:49:55:670 ->   BT Low Energy     : Yes
08:49:55:668 ->   Classic BT        : No
08:49:55:673 ->   IEEE 802.15.4     : No
08:49:55:676 -> ------------------------------------------
08:49:55:678 -> INTERNAL Memory Info:
08:49:55:682 -> ------------------------------------------
08:49:55:686 ->   Total Size        :   402284 B ( 392.9 KB)
08:49:55:690 ->   Free Bytes        :   372748 B ( 364.0 KB)
08:49:55:694 ->   Allocated Bytes   :    24488 B (  23.9 KB)
08:49:55:701 ->   Minimum Free Bytes:   367700 B ( 359.1 KB)
08:49:55:703 ->   Largest Free Block:   335860 B ( 328.0 KB)
08:49:55:706 -> ------------------------------------------
08:49:55:707 -> Flash Info:
08:49:55:711 -> ------------------------------------------
08:49:55:715 ->   Chip Size         :  4194304 B (4 MB)
08:49:55:719 ->   Block Size        :    65536 B (  64.0 KB)
08:49:55:723 ->   Sector Size       :     4096 B (   4.0 KB)
08:49:55:727 ->   Page Size         :      256 B (   0.2 KB)
08:49:55:729 ->   Bus Speed         : 80 MHz
08:49:55:732 ->   Bus Mode          : QIO
08:49:55:735 -> ------------------------------------------
08:49:55:737 -> Partitions Info:
08:49:55:741 -> ------------------------------------------
08:49:55:748 ->                 nvs : addr: 0x00009000, size:    20.0 KB, type: DATA, subtype: NVS
08:49:55:755 ->             otadata : addr: 0x0000E000, size:     8.0 KB, type: DATA, subtype: OTA
08:49:55:765 ->                app0 : addr: 0x00010000, size:  1280.0 KB, type:  APP, subtype: OTA_0
08:49:55:771 ->                app1 : addr: 0x00150000, size:  1280.0 KB, type:  APP, subtype: OTA_1
08:49:55:778 ->              spiffs : addr: 0x00290000, size:  1408.0 KB, type: DATA, subtype: SPIFFS
08:49:55:786 ->            coredump : addr: 0x003F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
08:49:55:789 -> ------------------------------------------
08:49:55:791 -> Software Info:
08:49:55:795 -> ------------------------------------------
08:49:55:798 ->   Compile Date/Time : Dec 16 2024 08:42:46
08:49:55:803 ->   Compile Host OS   : linux
08:49:55:806 ->   ESP-IDF Version   : v5.1.4-972-g632e0c2a9f-dirty
08:49:55:808 ->   Arduino Version   : 3.0.7
08:49:55:812 -> ------------------------------------------
08:49:55:813 -> Board Info:
08:49:55:817 -> ------------------------------------------
08:49:55:820 ->   Arduino Board     : LILYGO_T3S3_SX1262
08:49:55:824 ->   Arduino Variant   : lilygo_t3_s3_sx1262
08:49:55:835 ->   Arduino FQBN      : esp32:esp32:lilygo_t3s3:PSRAM=disabled,LoopCore=1,EventsCore=1,USBMode=hwcdc,CDCOnBoot=cdc,MSCOnBoot=default,DFUOnBoot=default,UploadMode=default,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,UploadSpeed=921600,DebugLevel=verbose,EraseFlash=none,Revision=Radio_SX1262
08:49:55:855 -> ============ Before Setup End ============
08:49:55:955 -> [  1078][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 19 already has type USB_DM (45) with bus 0x3fc94ea8
08:49:55:964 -> [  1078][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 20 already has type USB_DP (46) with bus 0x3fc94ea8
08:49:55:975 -> [  1087][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type SPI_MASTER_SCK (34) successfully set to 0x42007998
08:49:55:986 -> [  1099][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type SPI_MASTER_MISO (35) successfully set to 0x420078c0
08:49:55:999 -> [  1111][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type SPI_MASTER_MOSI (36) successfully set to 0x420077e8
08:49:56:011 -> [  1123][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type SPI_MASTER_SS (37) successfully set to 0x420076d4
08:49:56:022 -> [  1134][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202a1f0
08:49:56:032 -> [  1145][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 5 successfully set to type GPIO (1) with bus 0x6
08:49:56:046 -> [  1155][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 5 successfully set to type SPI_MASTER_SCK (34) with bus 0x1
08:49:56:053 -> [  1165][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202a1f0
08:49:56:063 -> [  1176][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 3 successfully set to type GPIO (1) with bus 0x4
08:49:56:074 -> [  1186][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 3 successfully set to type SPI_MASTER_MISO (35) with bus 0x1
08:49:56:085 -> [  1197][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202a1f0
08:49:56:100 -> [  1208][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 6 successfully set to type GPIO (1) with bus 0x7
08:49:56:105 -> [  1217][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 6 successfully set to type SPI_MASTER_MOSI (36) with bus 0x1
08:49:56:116 -> [  1228][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202a1f0
08:49:56:125 -> [  1239][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 7 successfully set to type GPIO (1) with bus 0x8
08:49:56:136 -> [  1249][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202a1f0
08:49:56:146 -> [  1260][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 33 successfully set to type GPIO (1) with bus 0x22
08:49:56:157 -> [  1269][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202a1f0
08:49:56:167 -> [  1280][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 34 successfully set to type GPIO (1) with bus 0x23
08:49:56:179 -> [  1290][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202a1f0
08:49:56:187 -> [  1301][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 8 successfully set to type GPIO (1) with bus 0x9
08:49:56:238 -> [  1361][D][SX1262_FSK_RX.ino:73] setup(): success!
08:49:56:240 -> [  1362][D][SX1262_FSK_RX.ino:113] setup(): [SX1262] Setup complete - awaiting incoming messages...
08:49:56:246 -> =========== After Setup Start ============
08:49:56:246 -> INTERNAL Memory Info:
08:49:56:250 -> ------------------------------------------
08:49:56:254 ->   Total Size        :   402284 B ( 392.9 KB)
08:49:56:260 ->   Free Bytes        :   371804 B ( 363.1 KB)
08:49:56:263 ->   Allocated Bytes   :    25272 B (  24.7 KB)
08:49:56:266 ->   Minimum Free Bytes:   366700 B ( 358.1 KB)
08:49:56:272 ->   Largest Free Block:   335860 B ( 328.0 KB)
08:49:56:274 -> ------------------------------------------
08:49:56:275 -> GPIO Info:
08:49:56:278 -> ------------------------------------------
08:49:56:281 ->   GPIO : BUS_TYPE[bus/unit][chan]
08:49:56:285 ->   --------------------------------------  
08:49:56:288 ->      3 : SPI_MASTER_MISO[0]
08:49:56:290 ->      5 : SPI_MASTER_SCK[0]
08:49:56:293 ->      6 : SPI_MASTER_MOSI[0]
08:49:56:294 ->      7 : GPIO
08:49:56:295 ->      8 : GPIO
08:49:56:297 ->     19 : USB_DM
08:49:56:298 ->     20 : USB_DP
08:49:56:300 ->     33 : GPIO
08:49:56:307 ->     34 : GPIO
08:49:56:307 ->     43 : UART_TX[0]
08:49:56:307 ->     44 : UART_RX[0]
08:49:56:308 -> ============ After Setup End =============
08:50:00:231 -> [  5353][V][SX1262_FSK_RX.ino:153] getMessage(): [SX1262] Data: D4 CA BA 44 51 EF D2 98 BE AA AA 00 00 00 00 00 00 00 00 00 36 4E BD A0 D1 4E 42 
08:50:00:238 -> [  5355][D][SX1262_FSK_RX.ino:155] getMessage(): [SX1262] R [D4] RSSI: -79.0
08:50:05:641 -> [ 10763][V][SX1262_FSK_RX.ino:153] getMessage(): [SX1262] Data: D4 0E B3 39 58 23 76 18 FE 68 FE 24 68 FE AD 69 FF 01 B9 AA 00 00 00 00 00 00 00 
08:50:05:648 -> [ 10765][D][SX1262_FSK_RX.ino:155] getMessage(): [SX1262] R [D4] RSSI: -102.0
08:50:11:350 -> [ 16473][V][SX1262_FSK_RX.ino:153] getMessage(): [SX1262] Data: D4 AC B7 28 96 67 96 5B 70 00 00 00 00 00 00 00 00 03 D5 6A 50 EE 8A FD DF EF CD 
08:50:11:358 -> [ 16475][D][SX1262_FSK_RX.ino:155] getMessage(): [SX1262] R [D4] RSSI: -97.0
08:50:17:660 -> [ 22783][V][SX1262_FSK_RX.ino:153] getMessage(): [SX1262] Data: D4 5B 2F 39 58 23 76 18 FE EE FE 24 88 10 10 97 FF F0 81 AA 00 00 00 00 00 00 00 
08:50:17:668 -> [ 22785][D][SX1262_FSK_RX.ino:155] getMessage(): [SX1262] R [D4] RSSI: -102.5
08:50:27:170 -> [ 32293][V][SX1262_FSK_RX.ino:153] getMessage(): [SX1262] Data: D4 5A 5C FC 2A AA EA 89 AA EA AA BA AA 8A AA 8A AA 2A AB AA AB BA 92 FA AA AA 00 
08:50:27:178 -> [ 32295][D][SX1262_FSK_RX.ino:155] getMessage(): [SX1262] R [D4] RSSI: -74.0
08:50:29:680 -> [ 34803][V][SX1262_FSK_RX.ino:153] getMessage(): [SX1262] Data: D4 EE CD 39 58 23 76 18 FE 9B FE 28 88 FE AD 69 FF 01 62 AA 00 00 00 00 00 00 00 
08:50:29:688 -> [ 34805][D][SX1262_FSK_RX.ino:155] getMessage(): [SX1262] R [D4] RSSI: -102.0
08:50:41:690 -> [ 46813][V][SX1262_FSK_RX.ino:153] getMessage(): [SX1262] Data: D4 54 9B 39 58 23 76 18 FC CD FC 24 08 10 10 97 FF F0 26 AA 00 00 00 00 00 00 00 
08:50:41:698 -> [ 46815][D][SX1262_FSK_RX.ino:155] getMessage(): [SX1262] R [D4] RSSI: -104.0
08:50:47:399 -> [ 52523][V][SX1262_FSK_RX.ino:153] getMessage(): [SX1262] Data: D4 E7 84 67 56 63 00 49 BB BB BB BB B0 10 76 09 BB B0 00 00 00 00 00 00 00 00 03 
08:50:47:407 -> [ 52525][D][SX1262_FSK_RX.ino:155] getMessage(): [SX1262] R [D4] RSSI: -102.0
08:50:53:710 -> [ 58833][V][SX1262_FSK_RX.ino:153] getMessage(): [SX1262] Data: D4 86 08 39 58 23 76 18 FC 68 FC 19 28 FE AD 69 FF 01 08 AA 00 00 00 00 00 00 00 
08:50:53:717 -> [ 58835][D][SX1262_FSK_RX.ino:155] getMessage(): [SX1262] R [D4] RSSI: -103.0
08:50:58:720 -> [ 63843][V][SX1262_FSK_RX.ino:153] getMessage(): [SX1262] Data: D4 CA BA 44 51 EF D2 98 BE AA AA 00 00 00 00 00 00 00 00 00 76 51 BA 68 3D 43 F1 
08:50:58:727 -> [ 63845][D][SX1262_FSK_RX.ino:155] getMessage(): [SX1262] R [D4] RSSI: -81.5
08:51:05:629 -> [ 70753][V][SX1262_FSK_RX.ino:153] getMessage(): [SX1262] Data: D4 3D B4 39 58 23 76 18 FD DF FD 24 88 10 10 97 FF F0 92 AA 00 00 00 00 00 00 00 
08:51:05:637 -> [ 70755][D][SX1262_FSK_RX.ino:155] getMessage(): [SX1262] R [D4] RSSI: -104.5
08:51:10:439 -> [ 75563][V][SX1262_FSK_RX.ino:153] getMessage(): [SX1262] Data: D4 AC B7 28 96 67 96 5B 70 00 00 00 00 00 00 00 00 02 D4 1E C2 75 A9 D6 17 DA BE 
08:51:10:447 -> [ 75565][D][SX1262_FSK_RX.ino:155] getMessage(): [SX1262] R [D4] RSSI: -98.5
 

RadioLib v7.0.0

After startup, only one message is received.

09:07:03:619 -> [   285][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 43 =========== Before Setup Start ===========
09:07:03:619 -> Chip Info:
09:07:03:619 -> ------------------------------------------
09:07:03:620 ->   Model             : ESP32-S3
09:07:03:623 ->   Package           : 0
09:07:03:624 ->   Revision          : 0.02
09:07:03:626 ->   Cores             : 2
09:07:03:629 ->   CPU Frequency     : 240 MHz
09:07:03:631 ->   XTAL Frequency    : 40 MHz
09:07:03:634 ->   Features Bitfield : 0x00000012
09:07:03:637 ->   Embedded Flash    : No
09:07:03:639 ->   Embedded PSRAM    : No
09:07:03:642 ->   2.4GHz WiFi       : Yes
09:07:03:643 ->   Classic BT        : No
09:07:03:646 ->   BT Low Energy     : Yes
09:07:03:648 ->   IEEE 802.15.4     : No
09:07:03:652 -> ------------------------------------------
09:07:03:654 -> INTERNAL Memory Info:
09:07:03:658 -> ------------------------------------------
09:07:03:663 ->   Total Size        :   402236 B ( 392.8 KB)
09:07:03:666 ->   Free Bytes        :   372700 B ( 364.0 KB)
09:07:03:672 ->   Allocated Bytes   :    24488 B (  23.9 KB)
09:07:03:674 ->   Minimum Free Bytes:   367652 B ( 359.0 KB)
09:07:03:678 ->   Largest Free Block:   335860 B ( 328.0 KB)
09:07:03:682 -> ------------------------------------------
09:07:03:683 -> Flash Info:
09:07:03:687 -> ------------------------------------------
09:07:03:690 ->   Chip Size         :  4194304 B (4 MB)
09:07:03:694 ->   Block Size        :    65536 B (  64.0 KB)
09:07:03:698 ->   Sector Size       :     4096 B (   4.0 KB)
09:07:03:702 ->   Page Size         :      256 B (   0.2 KB)
09:07:03:705 ->   Bus Speed         : 80 MHz
09:07:03:707 ->   Bus Mode          : QIO
09:07:03:713 -> ------------------------------------------
09:07:03:716 -> Partitions Info:
09:07:03:716 -> ------------------------------------------
09:07:03:723 ->                 nvs : addr: 0x00009000, size:    20.0 KB, type: DATA, subtype: NVS
09:07:03:731 ->             otadata : addr: 0x0000E000, size:     8.0 KB, type: DATA, subtype: OTA
09:07:03:740 ->                app0 : addr: 0x00010000, size:  1280.0 KB, type:  APP, subtype: OTA_0
09:07:03:746 ->                app1 : addr: 0x00150000, size:  1280.0 KB, type:  APP, subtype: OTA_1
09:07:03:753 ->              spiffs : addr: 0x00290000, size:  1408.0 KB, type: DATA, subtype: SPIFFS
09:07:03:761 ->            coredump : addr: 0x003F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
09:07:03:765 -> ------------------------------------------
09:07:03:766 -> Software Info:
09:07:03:770 -> ------------------------------------------
09:07:03:774 ->   Compile Date/Time : Dec 16 2024 09:05:53
09:07:03:776 ->   Compile Host OS   : linux
09:07:03:781 ->   ESP-IDF Version   : v5.1.4-972-g632e0c2a9f-dirty
09:07:03:787 ->   Arduino Version   : 3.0.7
09:07:03:791 -> ------------------------------------------
09:07:03:791 -> Board Info:
09:07:03:793 -> ------------------------------------------
09:07:03:796 ->   Arduino Board     : LILYGO_T3S3_SX1262
09:07:03:799 ->   Arduino Variant   : lilygo_t3_s3_sx1262
09:07:03:811 ->   Arduino FQBN      : esp32:esp32:lilygo_t3s3:PSRAM=disabled,LoopCore=1,EventsCore=1,USBMode=hwcdc,CDCOnBoot=cdc,MSCOnBoot=default,DFUOnBoot=default,UploadMode=default,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,UploadSpeed=921600,DebugLevel=verbose,EraseFlash=none,Revision=Radio_SX1262
09:07:03:835 -> ============ Before Setup End ============
09:07:03:931 -> [   889][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 19 already has type USB_DM (45) with bus 0x3fc94ed0
09:07:03:939 -> [   889][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 20 already has type USB_DP (46) with bus 0x3fc94ed0
09:07:03:950 -> [   898][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type SPI_MASTER_SCK (34) successfully set to 0x420080e0
09:07:03:962 -> [   910][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type SPI_MASTER_MISO (35) successfully set to 0x42008008
09:07:03:974 -> [   922][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type SPI_MASTER_MOSI (36) successfully set to 0x42007f30
09:07:03:986 -> [   933][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type SPI_MASTER_SS (37) successfully set to 0x42007e1c
09:07:03:998 -> [   945][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202aeec
09:07:04:007 -> [   956][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 5 successfully set to type GPIO (1) with bus 0x6
09:07:04:021 -> [   966][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 5 successfully set to type SPI_MASTER_SCK (34) with bus 0x1
09:07:04:029 -> [   976][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202aeec
09:07:04:038 -> [   987][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 3 successfully set to type GPIO (1) with bus 0x4
09:07:04:051 -> [   997][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 3 successfully set to type SPI_MASTER_MISO (35) with bus 0x1
09:07:04:060 -> [  1008][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202aeec
09:07:04:070 -> [  1019][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 6 successfully set to type GPIO (1) with bus 0x7
09:07:04:080 -> [  1028][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 6 successfully set to type SPI_MASTER_MOSI (36) with bus 0x1
09:07:04:091 -> [  1039][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202aeec
09:07:04:101 -> [  1050][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 7 successfully set to type GPIO (1) with bus 0x8
09:07:04:112 -> [  1060][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202aeec
09:07:04:122 -> [  1070][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 33 successfully set to type GPIO (1) with bus 0x22
09:07:04:132 -> [  1080][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202aeec
09:07:04:142 -> [  1091][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 34 successfully set to type GPIO (1) with bus 0x23
09:07:04:153 -> [  1101][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202aeec
09:07:04:163 -> [  1112][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 8 successfully set to type GPIO (1) with bus 0x9
09:07:04:214 -> [  1172][D][SX1262_FSK_RX.ino:73] setup(): success!
09:07:04:216 -> [  1173][D][SX1262_FSK_RX.ino:113] setup(): [SX1262] Setup complete - awaiting incoming messages...
09:07:04:222 -> =========== After Setup Start ============
09:07:04:222 -> INTERNAL Memory Info:
09:07:04:225 -> ------------------------------------------
09:07:04:229 ->   Total Size        :   402236 B ( 392.8 KB)
09:07:04:233 ->   Free Bytes        :   371756 B ( 363.0 KB)
09:07:04:237 ->   Allocated Bytes   :    25272 B (  24.7 KB)
09:07:04:243 ->   Minimum Free Bytes:   366652 B ( 358.1 KB)
09:07:04:247 ->   Largest Free Block:   335860 B ( 328.0 KB)
09:07:04:249 -> ------------------------------------------
09:07:04:253 -> GPIO Info:
09:07:04:255 -> ------------------------------------------
09:07:04:257 ->   GPIO : BUS_TYPE[bus/unit][chan]
09:07:04:261 ->   --------------------------------------  
09:07:04:263 ->      3 : SPI_MASTER_MISO[0]
09:07:04:266 ->      5 : SPI_MASTER_SCK[0]
09:07:04:270 ->      7 : GPIO
09:07:04:271 ->      8 : GPIO
09:07:04:268 ->      6 : SPI_MASTER_MOSI[0]
09:07:04:272 ->     19 : USB_DM
09:07:04:274 ->     20 : USB_DP
09:07:04:275 ->     33 : GPIO
09:07:04:276 ->     34 : GPIO
09:07:04:278 ->     43 : UART_TX[0]
09:07:04:280 ->     44 : UART_RX[0]
09:07:04:284 -> ============ After Setup End =============
09:07:05:606 -> [  2564][V][SX1262_FSK_RX.ino:153] getMessage(): [SX1262] Data: D4 51 9D 39 58 23 76 18 FD BD FD 28 88 10 10 97 FF F0 B0 AA 00 00 00 00 00 00 00 
09:07:05:614 -> [  2566][D][SX1262_FSK_RX.ino:155] getMessage(): [SX1262] R [D4] RSSI: -99.5

RadioLib v7.0.0

After startup, no messages are received.

08:52:52:270 -> [   275][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 44 =========== Before Setup Start ===========
08:52:52:270 -> Chip Info:
08:52:52:270 -> ------------------------------------------
08:52:52:270 ->   Model             : ESP32-S3
08:52:52:272 ->   Package           : 0
08:52:52:272 ->   Revision          : 0.02
08:52:52:274 ->   Cores             : 2
08:52:52:276 ->   CPU Frequency     : 240 MHz
08:52:52:280 ->   XTAL Frequency    : 40 MHz
08:52:52:282 ->   Features Bitfield : 0x00000012
08:52:52:284 ->   Embedded Flash    : No
08:52:52:286 ->   Embedded PSRAM    : No
08:52:52:289 ->   2.4GHz WiFi       : Yes
08:52:52:291 ->   Classic BT        : No
08:52:52:293 ->   BT Low Energy     : Yes
08:52:52:296 ->   IEEE 802.15.4     : No
08:52:52:299 -> ------------------------------------------
08:52:52:301 -> INTERNAL Memory Info:
08:52:52:305 -> ------------------------------------------
08:52:52:309 ->   Total Size        :   402188 B ( 392.8 KB)
08:52:52:313 ->   Free Bytes        :   372652 B ( 363.9 KB)
08:52:52:317 ->   Allocated Bytes   :    24488 B (  23.9 KB)
08:52:52:325 ->   Minimum Free Bytes:   367604 B ( 359.0 KB)
08:52:52:326 ->   Largest Free Block:   335860 B ( 328.0 KB)
08:52:52:330 -> ------------------------------------------
08:52:52:331 -> Flash Info:
08:52:52:334 -> ------------------------------------------
08:52:52:342 ->   Block Size        :    65536 B (  64.0 KB)
08:52:52:338 ->   Chip Size         :  4194304 B (4 MB)
08:52:52:346 ->   Sector Size       :     4096 B (   4.0 KB)
08:52:52:350 ->   Page Size         :      256 B (   0.2 KB)
08:52:52:352 ->   Bus Speed         : 80 MHz
08:52:52:354 ->   Bus Mode          : QIO
08:52:52:358 -> ------------------------------------------
08:52:52:360 -> Partitions Info:
08:52:52:364 -> ------------------------------------------
08:52:52:371 ->                 nvs : addr: 0x00009000, size:    20.0 KB, type: DATA, subtype: NVS
08:52:52:378 ->             otadata : addr: 0x0000E000, size:     8.0 KB, type: DATA, subtype: OTA
08:52:52:386 ->                app0 : addr: 0x00010000, size:  1280.0 KB, type:  APP, subtype: OTA_0
08:52:52:393 ->                app1 : addr: 0x00150000, size:  1280.0 KB, type:  APP, subtype: OTA_1
08:52:52:401 ->              spiffs : addr: 0x00290000, size:  1408.0 KB, type: DATA, subtype: SPIFFS
08:52:52:409 ->            coredump : addr: 0x003F0000, size:    64.0 KB, type: DATA, subtype: COREDUMP
08:52:52:412 -> ------------------------------------------
08:52:52:414 -> Software Info:
08:52:52:419 -> ------------------------------------------
08:52:52:422 ->   Compile Date/Time : Dec 16 2024 08:42:46
08:52:52:424 ->   Compile Host OS   : linux
08:52:52:428 ->   ESP-IDF Version   : v5.1.4-972-g632e0c2a9f-dirty
08:52:52:432 ->   Arduino Version   : 3.0.7
08:52:52:435 -> ------------------------------------------
08:52:52:436 -> Board Info:
08:52:52:440 -> ------------------------------------------
08:52:52:443 ->   Arduino Board     : LILYGO_T3S3_SX1262
08:52:52:447 ->   Arduino Variant   : lilygo_t3_s3_sx1262
08:52:52:458 ->   Arduino FQBN      : esp32:esp32:lilygo_t3s3:PSRAM=disabled,LoopCore=1,EventsCore=1,USBMode=hwcdc,CDCOnBoot=cdc,MSCOnBoot=default,DFUOnBoot=default,UploadMode=default,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,UploadSpeed=921600,DebugLevel=verbose,EraseFlash=none,Revision=Radio_SX1262
08:52:52:478 -> ============ Before Setup End ============
08:52:52:578 -> [   980][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 19 already has type USB_DM (45) with bus 0x3fc94efc
08:52:52:586 -> [   980][I][esp32-hal-periman.c:141] perimanSetPinBus(): Pin 20 already has type USB_DP (46) with bus 0x3fc94efc
08:52:52:598 -> [   989][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type SPI_MASTER_SCK (34) successfully set to 0x42009044
08:52:52:610 -> [  1000][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type SPI_MASTER_MISO (35) successfully set to 0x42008f6c
08:52:52:622 -> [  1012][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type SPI_MASTER_MOSI (36) successfully set to 0x42008e94
08:52:52:633 -> [  1024][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type SPI_MASTER_SS (37) successfully set to 0x42008d80
08:52:52:645 -> [  1036][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202be90
08:52:52:655 -> [  1047][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 5 successfully set to type GPIO (1) with bus 0x6
08:52:52:665 -> [  1057][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 5 successfully set to type SPI_MASTER_SCK (34) with bus 0x1
08:52:52:676 -> [  1067][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202be90
08:52:52:686 -> [  1078][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 3 successfully set to type GPIO (1) with bus 0x4
08:52:52:697 -> [  1088][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 3 successfully set to type SPI_MASTER_MISO (35) with bus 0x1
08:52:52:707 -> [  1099][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202be90
08:52:52:717 -> [  1109][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 6 successfully set to type GPIO (1) with bus 0x7
08:52:52:728 -> [  1119][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 6 successfully set to type SPI_MASTER_MOSI (36) with bus 0x1
08:52:52:739 -> [  1130][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202be90
08:52:52:748 -> [  1141][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 7 successfully set to type GPIO (1) with bus 0x8
08:52:52:759 -> [  1150][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202be90
08:52:52:775 -> [  1161][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 33 successfully set to type GPIO (1) with bus 0x22
08:52:52:780 -> [  1171][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202be90
08:52:52:790 -> [  1182][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 34 successfully set to type GPIO (1) with bus 0x23
08:52:52:801 -> [  1192][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type GPIO (1) successfully set to 0x4202be90
08:52:52:811 -> [  1203][V][esp32-hal-periman.c:160] perimanSetPinBus(): Pin 8 successfully set to type GPIO (1) with bus 0x9
08:52:52:861 -> [  1263][D][SX1262_FSK_RX.ino:73] setup(): success!
08:52:52:863 -> [  1264][D][SX1262_FSK_RX.ino:113] setup(): [SX1262] Setup complete - awaiting incoming messages...
08:52:52:871 -> =========== After Setup Start ============
08:52:52:871 -> INTERNAL Memory Info:
08:52:52:873 -> ------------------------------------------
08:52:52:877 ->   Total Size        :   402188 B ( 392.8 KB)
08:52:52:881 ->   Free Bytes        :   371708 B ( 363.0 KB)
08:52:52:885 ->   Allocated Bytes   :    25272 B (  24.7 KB)
08:52:52:889 ->   Minimum Free Bytes:   366604 B ( 358.0 KB)
08:52:52:893 ->   Largest Free Block:   335860 B ( 328.0 KB)
08:52:52:897 -> ------------------------------------------
08:52:52:898 -> GPIO Info:
08:52:52:901 -> ------------------------------------------
08:52:52:905 ->   GPIO : BUS_TYPE[bus/unit][chan]
08:52:52:912 ->   --------------------------------------  
08:52:52:912 ->      3 : SPI_MASTER_MISO[0]
08:52:52:916 ->      5 : SPI_MASTER_SCK[0]
08:52:52:916 ->      6 : SPI_MASTER_MOSI[0]
08:52:52:917 ->      7 : GPIO
08:52:52:918 ->      8 : GPIO
08:52:52:920 ->     19 : USB_DM
08:52:52:921 ->     20 : USB_DP
08:52:52:923 ->     33 : GPIO
08:52:52:924 ->     34 : GPIO
08:52:52:926 ->     43 : UART_TX[0]
08:52:52:928 ->     44 : UART_RX[0]
08:52:52:932 -> ============ After Setup End =============

To Reproduce

Sketch that is causing the module fail

///////////////////////////////////////////////////////////////////////////////////////////////////
// SX1262_FSK_RX.ino
//
// Test for FSK reception with SX1262
// - 868.3 MHz
// - Fixed packet length
// - No CRC
// - Preamble: 32 bits
// - Sync word: 2 bytes
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////

#include <Arduino.h>
#include <RadioLib.h>

#define MSG_BUF_SIZE 27

#if defined(ARDUINO_LILYGO_T3S3_SX1262)
// https://github.com/espressif/arduino-esp32/blob/master/variants/lilygo_t3_s3_sx1262/pins_arduino.h
#define RECEIVER_CHIP "[SX1262]"

#define PIN_RECEIVER_CS LORA_CS

// CC1101: GDO0 / RFM95W/SX127x: G0 // SX1262: IRQ / LR1121: IRQ
#define PIN_RECEIVER_IRQ LORA_IRQ

// CC1101: GDO2 / RFM95W/SX127x: G1 / SX1262: BUSY / LR1121: BUSY
#define PIN_RECEIVER_GPIO LORA_BUSY

// RFM95W/SX127x - GPIOxx / CC1101 - RADIOLIB_NC
#define PIN_RECEIVER_RST LORA_RST
#endif

SPIClass spi(SPI);
SX1262 radio = new Module(PIN_RECEIVER_CS, PIN_RECEIVER_IRQ, PIN_RECEIVER_RST, PIN_RECEIVER_GPIO);

// Flag to indicate that a packet was received
volatile bool receivedFlag = false;

// This function is called when a complete packet is received by the module
// IMPORTANT: This function MUST be 'void' type and MUST NOT have any arguments!
#if defined(ESP8266) || defined(ESP32)
IRAM_ATTR
#endif
void setFlag(void)
{
    // We got a packet, set the flag
    receivedFlag = true;
}

void setup()
{
    Serial.begin(115200);
    Serial.setDebugOutput(true);

#if defined(ARDUINO_LILYGO_T3S3_SX1262)
    SPISettings spiSettings(2000000, MSBFIRST, SPI_MODE0);
    spi.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS);
    radio = new Module(PIN_RECEIVER_CS, PIN_RECEIVER_IRQ, PIN_RECEIVER_RST, PIN_RECEIVER_GPIO, spi);
#endif

    // carrier frequency:                   868.3 MHz
    // bit rate:                            8.22 kbps
    // frequency deviation:                 57.136417 kHz
    // Rx bandwidth:                        270.0 kHz (CC1101) / 250 kHz (SX1276) / 234.3 kHz (SX1262)
    // output power:                        10 dBm
    // preamble length:                     40 bits
    // USE_SX1262
    int state = radio.beginFSK(868.3, 8.21, 57.136417, 234.3, 10, 32);

    if (state == RADIOLIB_ERR_NONE)
    {
        log_d("success!");
        state = radio.fixedPacketLengthMode(MSG_BUF_SIZE);
        if (state != RADIOLIB_ERR_NONE)
        {
            log_e("%s Error setting fixed packet length: [%d]", RECEIVER_CHIP, state);
            while (true)
                delay(10);
        }

        // Disable CRC filtering
        state = radio.setCRC(0);

        if (state != RADIOLIB_ERR_NONE)
        {
            log_e("%s Error disabling crc filtering: [%d]", RECEIVER_CHIP, state);
            while (true)
                delay(10);
        }

        // Preamble: AA AA AA AA AA
        // Sync is: 2D D4
        // Preamble 40 bits but the CC1101 doesn't allow us to set that
        // so we use a preamble of 32 bits and then use the sync as AA 2D
        // which then uses the last byte of the preamble - we recieve the last sync byte
        // as the 1st byte of the payload.
        uint8_t sync_word[] = {0xAA, 0x2D};
        state = radio.setSyncWord(sync_word, 2);
        if (state != RADIOLIB_ERR_NONE)
        {
            log_e("%s Error setting sync words: [%d]", RECEIVER_CHIP, state);
            while (true)
                delay(10);
        }
    }
    else
    {
        log_e("%s Error initialising: [%d]", RECEIVER_CHIP, state);
        while (true)
            delay(10);
    }
    log_d("%s Setup complete - awaiting incoming messages...", RECEIVER_CHIP);

    // Set callback function
    radio.setPacketReceivedAction(setFlag);

    state = radio.startReceive();
    if (state != RADIOLIB_ERR_NONE)
    {
        log_e("%s startReceive() failed, code %d", RECEIVER_CHIP, state);
        while (true)
            delay(10);
    }
}

int getMessage(void)
{
    uint8_t recvData[MSG_BUF_SIZE];
    int decode_res = -1;

    // Receive data
    if (receivedFlag)
    {
        receivedFlag = false;

        int state = radio.readData(recvData, MSG_BUF_SIZE);
        float rssi = radio.getRSSI();
        state = radio.startReceive();

        if (state == RADIOLIB_ERR_NONE)
        {
            // Verify last syncword is 1st byte of payload (see setSyncWord() above)
            if (recvData[0] == 0xD4)
            {
#if CORE_DEBUG_LEVEL == ARDUHAL_LOG_LEVEL_VERBOSE
                char buf[128];
                *buf = '\0';
                for (size_t i = 0; i < sizeof(recvData); i++)
                {
                    sprintf(&buf[strlen(buf)], "%02X ", recvData[i]);
                }
                log_v("%s Data: %s", RECEIVER_CHIP, buf);
#endif
                log_d("%s R [%02X] RSSI: %0.1f", RECEIVER_CHIP, recvData[0], rssi);

                // decode_res = decodeMessage(&recvData[1], sizeof(recvData) - 1);
            } // if (recvData[0] == 0xD4)
        } // if (state == RADIOLIB_ERR_NONE)
        else if (state == RADIOLIB_ERR_RX_TIMEOUT)
        {
            log_v("T");
        }
        else
        {
            // some other error occurred
            log_d("%s Receive failed: [%d]", RECEIVER_CHIP, state);
        }
    } // if (receivedFlag)

    return decode_res;
}

void loop()
{
    // Tries to receive radio message (non-blocking) and to decode it.
    // Timeout occurs after a small multiple of expected time-on-air.
    getMessage();

    delay(100);
} // loop()

Expected behavior
The sketch should work with RadioLib > v6.6.0.

Additional info (please complete):

@jgromes
Copy link
Owner

jgromes commented Dec 16, 2024

See #1350 - this might be the same issue, though to solution to it is probably not complete yet.

@matthias-bs
Copy link
Contributor Author

@jgromes Ah, I missed the recent comments on #1350! Thanks!

@StevenCellist
Copy link
Collaborator

As the attention-paying master @jgromes found the footnote showing why the configured 32-bit preamble of this setup is incompatible with the 2-byte syncword, I think we can close this one and track it in #1350 😉
Either way, jinx on the problem and kudos for the well-filed issue.

@StevenCellist StevenCellist added the duplicate This issue or pull request already exists label Dec 16, 2024
@tonbor
Copy link

tonbor commented Dec 25, 2024

With radiolib 7.1.1 all ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants