Skip to content

docs(sx127x): enhance documentation and update default configurations#18493

Open
arjav1528 wants to merge 2 commits intoapache:masterfrom
arjav1528:dev-issue-17447
Open

docs(sx127x): enhance documentation and update default configurations#18493
arjav1528 wants to merge 2 commits intoapache:masterfrom
arjav1528:dev-issue-17447

Conversation

@arjav1528
Copy link
Contributor

Fixes: #17447

Updated the SX127X demo documentation to include an overview, default configuration settings, short-range FSK testing recommendations, and troubleshooting tips. The default TX power has been changed from 14 dBm to 17 dBm, and CRC is now enabled by default. These changes aim to improve user experience and ensure robust communication for the SX127X radio driver.

Summary

  • Raise the default SX127X TX power by setting CONFIG_LPWAN_SX127X_TXPOWER_DEFAULT from 14 dBm to 17 dBm.
  • Enable CRC by default by setting CONFIG_LPWAN_SX127X_CRCON from 0 to 1.
  • Expand sx127x_demo documentation with defaults, short-range FSK recommendations, and troubleshooting, following the behavior observed and recommendations in apache/nuttx#17447.

Impact

  • SX127X users get a stronger and more reliable default link (higher RSSI at short range).
  • CRC-on by default improves payload integrity by rejecting corrupted frames.
  • Boards that already override TX power or CRC remain unaffected; users needing CRC off can still explicitly set CONFIG_LPWAN_SX127X_CRCON=0.

@github-actions github-actions bot added Area: Drivers Drivers issues Size: S The size of the change in this PR is small labels Mar 4, 2026
Copy link
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include testing. Do you have this hardware to test with?

xiaoxiang781216
xiaoxiang781216 previously approved these changes Mar 5, 2026
@arjav1528
Copy link
Contributor Author

Please include testing. Do you have this hardware to test with?

Nope

@acassis
Copy link
Contributor

acassis commented Mar 5, 2026

@linguini1 we commented at #17447 I agreed that he could modify the Kconfig without testing in real hardware, because I already tested it. BTW, I can retest here to have peace of mind

@acassis acassis closed this Mar 5, 2026
@acassis acassis reopened this Mar 5, 2026
acassis
acassis previously approved these changes Mar 5, 2026
jerpelea
jerpelea previously approved these changes Mar 5, 2026
@arjav1528
Copy link
Contributor Author

@linguini1 we commented at #17447 I agreed that he could modify the Kconfig without testing in real hardware, because I already tested it. BTW, I can retest here to have peace of mind

Could you please restart the workflows, seems like a timeout error

@acassis
Copy link
Contributor

acassis commented Mar 5, 2026

@linguini1 we commented at #17447 I agreed that he could modify the Kconfig without testing in real hardware, because I already tested it. BTW, I can retest here to have peace of mind

Could you please restart the workflows, seems like a timeout error

@arjav1528 actually it is not timeout error. Since you changed the default values in the Kconfig some boards using this driver need to be updated (normalized), please use this command for each board and profile listed in the error:

./tools/refresh.sh --silent boardname:profilename

ie

./tools/refresh.sh --silent esp32-devkitc:bmp280

Then create a commit with the updated board profiles

@arjav1528
Copy link
Contributor Author

@linguini1 we commented at #17447 I agreed that he could modify the Kconfig without testing in real hardware, because I already tested it. BTW, I can retest here to have peace of mind

Could you please restart the workflows, seems like a timeout error

@arjav1528 actually it is not timeout error. Since you changed the default values in the Kconfig some boards using this driver need to be updated (normalized), please use this command for each board and profile listed in the error:

./tools/refresh.sh --silent boardname:profilename

ie

./tools/refresh.sh --silent esp32-devkitc:bmp280

Then create a commit with the updated board profiles

@acassis I guess this is a timeout issue only as I ran the commands which you suggested on every board profile that uses SX127X drivers. All of them existed with code 0, and neither of them produced any deconfig changes
could you please check the CI logs and try restarting the workflows.
btw attached the logs in the PR desc

@arjav1528 arjav1528 requested a review from linguini1 March 5, 2026 13:43
@acassis
Copy link
Contributor

acassis commented Mar 5, 2026

@linguini1 we commented at #17447 I agreed that he could modify the Kconfig without testing in real hardware, because I already tested it. BTW, I can retest here to have peace of mind

Could you please restart the workflows, seems like a timeout error

@arjav1528 actually it is not timeout error. Since you changed the default values in the Kconfig some boards using this driver need to be updated (normalized), please use this command for each board and profile listed in the error:

./tools/refresh.sh --silent boardname:profilename

ie

./tools/refresh.sh --silent esp32-devkitc:bmp280

Then create a commit with the updated board profiles

@acassis I guess this is a timeout issue only as I ran the commands which you suggested on every board profile that uses SX127X drivers. All of them existed with code 0, and neither of them produced any deconfig changes could you please check the CI logs and try restarting the workflows. btw attached the logs in the PR desc

@arjav1528 please look the logs, there are real errors:

board/esp32_bringup.c: In function 'esp32_bringup':
Error: board/esp32_bringup.c:351:9: error: implicit declaration of function 'btn_lower_initialize'; did you mean 'nullmtd_initialize'? [-Wimplicit-function-declaration]
  351 |   ret = btn_lower_initialize("/dev/buttons");
      |         ^~~~~~~~~~~~~~~~~~~~
      |         nullmtd_initialize
make[1]: *** [/github/workspace/sources/nuttx/boards/Board.mk:83: esp32_bringup.o] Error 1
make[1]: Target 'libboard.a' not remade because of errors.
make: *** [tools/LibTargets.mk:89: arch/xtensa/src/board/libboard.a] Error 2
make: Target 'all' not remade because of errors.
/github/workspace/sources/nuttx/tools/testbuild.sh: line 385: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
  [1/1] Normalize esp32-wrover-kit/buttons
19d18
< CONFIG_ARCH_IRQBUTTONS=y
35d33
< CONFIG_INPUT_BUTTONS_LOWER=y
Saving the new configuration file
HEAD detached at pull/18493/merge
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   boards/xtensa/esp32/esp32-devkitc/configs/bmp280/defconfig
	modified:   boards/xtensa/esp32/esp32-devkitc/configs/buttons/defconfig
	modified:   boards/xtensa/esp32/esp32-ethernet-kit/configs/buttons/defconfig
	modified:   boards/xtensa/esp32/esp32-lyrat/configs/buttons/defconfig
	modified:   boards/xtensa/esp32/esp32-wrover-kit/configs/buttons/defconfig
	modified:   boards/xtensa/esp32/esp32-wrover-kit/configs/lua/defconfig

Maybe it was generated by some other user, please move to upstream branch, run git pull, move back to your branch and rebase with upstream to see if it will help.

@simbit18 did you see this error in the mainline?

@linguini1
Copy link
Contributor

@linguini1 we commented at #17447 I agreed that he could modify the Kconfig without testing in real hardware, because I already tested it. BTW, I can retest here to have peace of mind

I missed that! Sounds good!

@linguini1 linguini1 dismissed their stale review March 5, 2026 14:10

To be tested by @acassis

@simbit18
Copy link
Contributor

simbit18 commented Mar 5, 2026

@linguini1 we commented at #17447 I agreed that he could modify the Kconfig without testing in real hardware, because I already tested it. BTW, I can retest here to have peace of mind

Could you please restart the workflows, seems like a timeout error

@arjav1528 actually it is not timeout error. Since you changed the default values in the Kconfig some boards using this driver need to be updated (normalized), please use this command for each board and profile listed in the error:

./tools/refresh.sh --silent boardname:profilename

ie

./tools/refresh.sh --silent esp32-devkitc:bmp280

Then create a commit with the updated board profiles

@acassis I guess this is a timeout issue only as I ran the commands which you suggested on every board profile that uses SX127X drivers. All of them existed with code 0, and neither of them produced any deconfig changes could you please check the CI logs and try restarting the workflows. btw attached the logs in the PR desc

@arjav1528 please look the logs, there are real errors:

board/esp32_bringup.c: In function 'esp32_bringup':
Error: board/esp32_bringup.c:351:9: error: implicit declaration of function 'btn_lower_initialize'; did you mean 'nullmtd_initialize'? [-Wimplicit-function-declaration]
  351 |   ret = btn_lower_initialize("/dev/buttons");
      |         ^~~~~~~~~~~~~~~~~~~~
      |         nullmtd_initialize
make[1]: *** [/github/workspace/sources/nuttx/boards/Board.mk:83: esp32_bringup.o] Error 1
make[1]: Target 'libboard.a' not remade because of errors.
make: *** [tools/LibTargets.mk:89: arch/xtensa/src/board/libboard.a] Error 2
make: Target 'all' not remade because of errors.
/github/workspace/sources/nuttx/tools/testbuild.sh: line 385: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
  [1/1] Normalize esp32-wrover-kit/buttons
19d18
< CONFIG_ARCH_IRQBUTTONS=y
35d33
< CONFIG_INPUT_BUTTONS_LOWER=y
Saving the new configuration file
HEAD detached at pull/18493/merge
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   boards/xtensa/esp32/esp32-devkitc/configs/bmp280/defconfig
	modified:   boards/xtensa/esp32/esp32-devkitc/configs/buttons/defconfig
	modified:   boards/xtensa/esp32/esp32-ethernet-kit/configs/buttons/defconfig
	modified:   boards/xtensa/esp32/esp32-lyrat/configs/buttons/defconfig
	modified:   boards/xtensa/esp32/esp32-wrover-kit/configs/buttons/defconfig
	modified:   boards/xtensa/esp32/esp32-wrover-kit/configs/lua/defconfig

Maybe it was generated by some other user, please move to upstream branch, run git pull, move back to your branch and rebase with upstream to see if it will help.

@simbit18 did you see this error in the mainline?

@arjav1528 please rebase

@arjav1528
Copy link
Contributor Author

@linguini1 we commented at #17447 I agreed that he could modify the Kconfig without testing in real hardware, because I already tested it. BTW, I can retest here to have peace of mind

Could you please restart the workflows, seems like a timeout error

@arjav1528 actually it is not timeout error. Since you changed the default values in the Kconfig some boards using this driver need to be updated (normalized), please use this command for each board and profile listed in the error:

./tools/refresh.sh --silent boardname:profilename

ie

./tools/refresh.sh --silent esp32-devkitc:bmp280

Then create a commit with the updated board profiles

@acassis I guess this is a timeout issue only as I ran the commands which you suggested on every board profile that uses SX127X drivers. All of them existed with code 0, and neither of them produced any deconfig changes could you please check the CI logs and try restarting the workflows. btw attached the logs in the PR desc

@arjav1528 please look the logs, there are real errors:

board/esp32_bringup.c: In function 'esp32_bringup':
Error: board/esp32_bringup.c:351:9: error: implicit declaration of function 'btn_lower_initialize'; did you mean 'nullmtd_initialize'? [-Wimplicit-function-declaration]
  351 |   ret = btn_lower_initialize("/dev/buttons");
      |         ^~~~~~~~~~~~~~~~~~~~
      |         nullmtd_initialize
make[1]: *** [/github/workspace/sources/nuttx/boards/Board.mk:83: esp32_bringup.o] Error 1
make[1]: Target 'libboard.a' not remade because of errors.
make: *** [tools/LibTargets.mk:89: arch/xtensa/src/board/libboard.a] Error 2
make: Target 'all' not remade because of errors.
/github/workspace/sources/nuttx/tools/testbuild.sh: line 385: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
  [1/1] Normalize esp32-wrover-kit/buttons
19d18
< CONFIG_ARCH_IRQBUTTONS=y
35d33
< CONFIG_INPUT_BUTTONS_LOWER=y
Saving the new configuration file
HEAD detached at pull/18493/merge
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   boards/xtensa/esp32/esp32-devkitc/configs/bmp280/defconfig
	modified:   boards/xtensa/esp32/esp32-devkitc/configs/buttons/defconfig
	modified:   boards/xtensa/esp32/esp32-ethernet-kit/configs/buttons/defconfig
	modified:   boards/xtensa/esp32/esp32-lyrat/configs/buttons/defconfig
	modified:   boards/xtensa/esp32/esp32-wrover-kit/configs/buttons/defconfig
	modified:   boards/xtensa/esp32/esp32-wrover-kit/configs/lua/defconfig

Maybe it was generated by some other user, please move to upstream branch, run git pull, move back to your branch and rebase with upstream to see if it will help.
@simbit18 did you see this error in the mainline?

@arjav1528 please rebase

done, builds pass now, @acassis @simbit18 @linguini1 thank you for helping

@arjav1528
Copy link
Contributor Author

ig now its a timeout issue 😔

@simbit18
Copy link
Contributor

simbit18 commented Mar 5, 2026

@arjav1528, let's wait for the msvc and msys2 jobs to complete, then I'll restart.

@arjav1528
Copy link
Contributor Author

@arjav1528, let's wait for the msvc and msys2 jobs to complete, then I'll restart.

sure, no problem

@arjav1528 arjav1528 requested a review from acassis March 5, 2026 16:06
@simbit18
Copy link
Contributor

simbit18 commented Mar 5, 2026

GitHub is having problems! :)

Multiple services are affected, service degradation
https://www.githubstatus.com/incidents/g5gnt5l5hf56

@simbit18
Copy link
Contributor

simbit18 commented Mar 6, 2026

@arjav1528 After this PR #18502 is merged,

you must remove all defconfig files that do not relate to your PR

and perform a rebase.

@arjav1528
Copy link
Contributor Author

@arjav1528 After this PR #18502 is merged,

you must remove all defconfig files that do not relate to your PR

and perform a rebase.

sure, will do that

@cederom
Copy link
Contributor

cederom commented Mar 6, 2026

@acassis: @linguini1 we commented at #17447 I agreed that he could modify the Kconfig without testing in real hardware, because I already tested it. BTW, I can retest here to have peace of mind

Yes @acassis please attach build and runtime logs to PR description thanks! <3

Copy link
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @arjav1528 :-)

  • There are three functional changes in this PR, please provide each change as separate commit with proper description.
  • Build and runtime tests are mandatory, if @acassis can provide them as your guide this is okay too :-)
  • Why removing CONFIG_ARCH_IRQBUTTONS from buttons configs? I see no explanation in the git commit message.

@acassis
Copy link
Contributor

acassis commented Mar 6, 2026

Thanks @arjav1528 :-)

* There are three functional changes in this PR, please provide each change as separate commit with proper description.

* Build and runtime tests are mandatory, if @acassis can provide them as your guide this is okay too :-)

* Why removing `CONFIG_ARCH_IRQBUTTONS` from `buttons` configs? I see no explanation in the git commit message.

@arjav1528 @cederom yes, boards modifications, documentation and driver Kconfig should be in separated commits.

I think he tried to remove CONFIG_ARCH_IRQBUTTONS to fix the issue in the ESP32, please don't modify it.

@cederom
Copy link
Contributor

cederom commented Mar 6, 2026

The ESP32 fix from Espressif is already here #18502 :-) Big thank you @tmedicci :-)

We should wait until the fix is in the master, then this PR should build fine.. and we can remove unrelated esp changes and we have clean PR dedicated to doc and sx127x power (in two commits plz) :-)

@acassis
Copy link
Contributor

acassis commented Mar 6, 2026

@arjav1528 please update your upstream and rebase your branch to fix the previous Xtensa/ESP32 issue

Increase default TX power from 14 to 17 dBm and enable CRC
by default to improve link reliability and data integrity.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
Add default configuration, short-range FSK testing tips,
and troubleshooting guidance for the SX127X demo example.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Drivers Drivers issues Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Improve sx127x application to get data and verify data integrity

7 participants