From a8719f84ffd73119ce758e45882a7af9f719c1d5 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Tue, 25 Nov 2025 02:19:36 -0800 Subject: [PATCH 1/4] chore(dev): revise CI corresponds to nRF24/.github#23 --- .gitattributes | 43 +++++++++++++++++++----------- .github/dependabot.yml | 8 +++++- .github/workflows/build_linux.yml | 29 +++++++++++++------- .github/workflows/clang_format.yml | 25 ++++++++++++----- .github/workflows/doxygen.yml | 26 +++++++++++++----- 5 files changed, 92 insertions(+), 39 deletions(-) diff --git a/.gitattributes b/.gitattributes index bdb0cab..df5f001 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,17 +1,30 @@ -# Auto detect text files and perform LF normalization +# Set the default behavior, in case people don't have core.autocrlf set. * text=auto -# Custom for Visual Studio -*.cs diff=csharp - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain +# Explicitly declare text files you want to always be normalized and converted +# to native line endings on checkout. +*.py text eol=lf +*.rst text eol=lf +*.sh text eol=lf +*.h text eol=lf +*.cpp text eol=lf +*.c text eol=lf +.yaml text eol=lf +*.yml text eol=lf +*.md text eol=lf +*.txt text eol=lf +*.json text eol=lf +*.properties text eol=lf +LICENSE text eol=lf +nurfile text eol=lf +.gitignore text eol=lf +.gitattributes text eol=lf +.clang-format text eol=lf +.clang-tidy text eol=lf +Makefile text eol=lf +*.svg text eol=lf +*.ino text eol=lf +*.dot text eol=lf +*.cmake text eol=lf +*.css text eol=lf +Doxyfile text eol=lf diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 05a48fc..078f0ce 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,4 +10,10 @@ updates: # default location of `.github/workflows` directory: "/" schedule: - interval: "weekly" + interval: "monthly" + cooldown: + default-days: 5 + groups: + actions: + patterns: + - "*" diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index ab25925..0a6485f 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -1,4 +1,4 @@ -name: Linux build +name: Linux on: pull_request: @@ -23,22 +23,21 @@ on: - "examples/**CMakeLists.txt" - "!**Makefile" # old build system is not tested in this workflow - ".github/workflows/build_linux.yml" - release: - types: [published, edited] + tags: ["*"] -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release +permissions: {} -jobs: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} - using_cmake: - uses: nRF24/.github/.github/workflows/build_linux_cmake.yaml@main +jobs: + build: + uses: nRF24/.github/.github/workflows/build_linux_cmake.yaml@review-ci with: compiler: ${{ matrix.toolchain.compiler }} usr-dir: ${{ matrix.toolchain.usr_dir }} examples-path: examples - deploy-release: ${{ github.event_name == 'release' && (matrix.toolchain.compiler == 'armhf' || matrix.toolchain.compiler == 'arm64') }} strategy: fail-fast: false matrix: @@ -53,3 +52,13 @@ jobs: # usr_dir: "i686-linux-gnu" - compiler: "default" # github runner is hosted on a "amd64" usr_dir: "local" # use default compiler to test build all examples (including the ncurses ones) + + deploy: + name: deploy release assets + needs: [build] + permissions: + # needed for uploading release assets + contents: write + if: startsWith(github.ref, 'refs/tags/') + uses: nRF24/.github/.github/workflows/deploy_cpack_artifacts.yaml@review-ci + secrets: inherit diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index f82a4b6..e359b9c 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -1,11 +1,22 @@ -name: check code formatting +name: Code format on: - push: - branches: [master, v1.x] - pull_request: - branches: [master, v1.x] + push: + branches: [master, v1.x] + pull_request: + branches: [master, v1.x] + +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} jobs: - check_formatting: - uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main + check: + uses: nRF24/.github/.github/workflows/cpp_lint.yaml@review-ci + permissions: + # needed to detect changed files + contents: read + # needed to post review suggestions on PRs + pull-requests: write diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml index 515f92d..df9838e 100644 --- a/.github/workflows/doxygen.yml +++ b/.github/workflows/doxygen.yml @@ -1,4 +1,4 @@ -name: build Docs +name: Docs on: pull_request: @@ -21,14 +21,28 @@ on: - "examples**.cpp" - ".github/workflows/doxygen.yml" - "Doxyfile" - release: - types: [published, edited] + tags: ["*"] workflow_dispatch: +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} + jobs: - build-docs: - uses: nRF24/.github/.github/workflows/build_docs.yaml@main + build: + uses: nRF24/.github/.github/workflows/build_docs.yaml@review-ci with: - deploy-gh-pages: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master') }} doxygen-version: '1.13.2' + + deploy: + needs: [build] + if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') + permissions: + # to authenticate the gh-pages environment + id-token: write + # to upload to GitHub Pages + pages: write + uses: nRF24/.github/.github/workflows/deploy_docs.yaml@review-ci secrets: inherit From a69676f9f18ca0a13138e10c2555df598f9a9b76 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Tue, 25 Nov 2025 05:24:19 -0800 Subject: [PATCH 2/4] doc updates for doxygen v1.15.0 --- .github/workflows/doxygen.yml | 2 +- docs/Doxyfile | 2 +- docs/README.md | 2 +- docs/{ => images}/favicon.ico | Bin docs/main_page.md | 49 ++++++++++++++++++++-------------- docs/rpi_tcpip_link.md | 29 +++++++++++--------- 6 files changed, 49 insertions(+), 35 deletions(-) rename docs/{ => images}/favicon.ico (100%) diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml index df9838e..8d4c52e 100644 --- a/.github/workflows/doxygen.yml +++ b/.github/workflows/doxygen.yml @@ -34,7 +34,7 @@ jobs: build: uses: nRF24/.github/.github/workflows/build_docs.yaml@review-ci with: - doxygen-version: '1.13.2' + doxygen-version: '1.15.0' deploy: needs: [build] diff --git a/docs/Doxyfile b/docs/Doxyfile index 97d2939..83cae92 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -17,7 +17,7 @@ # Project related configuration options #--------------------------------------------------------------------------- -PROJECT_ICON = favicon.ico +PROJECT_ICON = images/favicon.ico # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the diff --git a/docs/README.md b/docs/README.md index 227bb44..7042b8f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# Please browse the docs from http://nrf24.github.io/RF24Gateway +# Please browse the docs from ## Intended for use in Doxygen diff --git a/docs/favicon.ico b/docs/images/favicon.ico similarity index 100% rename from docs/favicon.ico rename to docs/images/favicon.ico diff --git a/docs/main_page.md b/docs/main_page.md index 51e53a4..6b11024 100644 --- a/docs/main_page.md +++ b/docs/main_page.md @@ -15,40 +15,47 @@ Introducing **RF24Network, RF24Mesh & RF24Gateway v2.0** with some *significant in order to support a range of ESB enabled radios, most recently NRF52x radios. **Important Notes:** + - Any network layer that uses v2 needs to have RF24Network/RF24Mesh dependencies of v2 or newer. RF24 v1.x is an exception here. - General usage should remain backward compatible, see the included examples of the related libraries for more info - Any third party libs that extend the network/mesh layer may also need to be updated to incorporate the new templated class prototypes: -```cpp -template -class ESBNetwork; - -template -class ESBMesh; -``` + + ```cpp + template + class ESBNetwork; + + template + class ESBMesh; + ``` + - Third party libs should also be able to use the backward-compatible typedef in their template: - ESBGateway.h: - ```cpp - template - class ESBGateway - ``` + + ```cpp + template + class ESBGateway + ``` + and inform the compiler what types they intend to support: - ESBGateway.cpp: - ```cpp - template class ESBGateway; - ``` + + ```cpp + template class ESBGateway; + ``` + - The auto installers do not perform a version check like package managers, so having the correct versions of the software is important. - We *will* be maintaining the v1.x versions with bugfixes etc for those who cannot or do not wish to migrate to the newer template approach. ## Installation -See http://nRF24.github.io/RF24 for installation instructions using the installer, or clone the RF24 libs and run 'make install' for each one. +See for installation instructions using the installer, or clone the RF24 libs and run 'make install' for each one. After running the installer, RF24Gateway will be installed at rf24libs/RF24Gateway. [**Examples**](examples.html) are included for operating the gateway as well as client scripts & programs to control nodes via http requests. Note: RF24Gateway is tested with and defaults to using RF24Mesh. Sensor nodes must also use RF24Mesh or be statically assigned within RF24Mesh. -See http://nRF24.github.io/RF24Ethernet/ for related documentation for use with RF24Gateway. +See for related documentation for use with RF24Gateway. ## How It Works @@ -90,9 +97,10 @@ To maximize throughput between Raspberry Pi or other Linux devices, run the foll sudo sysctl net.ipv4.tcp_wmem="1500 1500 1500" sudo sysctl net.ipv4.tcp_rmem="1500 1500 1500" ``` + These changes are only temporary and need to be run each time after reboot of the operating system. To make them permanent, edit `/etc/sysctl.conf` -See http://nRF24.github.io/RF24Ethernet/ConfigAndSetup.html for more info +See for more info ## Advanced Configuration @@ -113,7 +121,8 @@ To fully enable routing beyond the RPi devices, a routing table needs to be adde ## Network Configuration Example -Local WiFi/Ethernet Network (Windows,Linux,RPi devices etc) - 10.10.1.0 - 255.255.255.0 ( 10.10.1.x network )
+Local WiFi/Ethernet Network (Windows,Linux,RPi devices etc) - 10.10.1.0 - 255.255.255.0 ( 10.10.1.x network ) + RPi devices (tun_nrf24 interfaces & all connected devices) - 10.1.0.0 - 255.255.0.0 ( 10.1.x.x network ) ### Explanation @@ -182,6 +191,6 @@ Examples are: 0.0.0.0 0.0.0.0 10.10.3.32 ``` -# Example: create TCP/IP link between two Raspberry Pi +## Example: create TCP/IP link between two Raspberry Pi -This example demonstrates how a tcpip link could be created between two RPIs: [Example LINK](md_docs_2rpi__tcpip__link.html) +This example demonstrates how a TCP/IP link could be created between two RPIs: [Example LINK](rpi_tcpip_link.md) diff --git a/docs/rpi_tcpip_link.md b/docs/rpi_tcpip_link.md index 5c4105f..399db1d 100644 --- a/docs/rpi_tcpip_link.md +++ b/docs/rpi_tcpip_link.md @@ -1,22 +1,22 @@ -# longer range TCPIP via NRF24L01 for a pair of Raspberry PIs +# longer range TCP/IP via NRF24L01 for a pair of Raspberry PIs ## Intro This tutorial is trying to use `NRF24L01` to create a TCP/IP link between two Raspberry Pi boards. -Due to long range of NRFs, some of those have 1800 meter wireless range, it would be good to have a TCPIP link between two RPi via NRFs so it would be possible to have a TCPIP connection between two RPi in longer range. The onboard wifi of RPi cannot do long ranges like 50 meter even in clear sight. +Due to long range of NRFs, some of those have 1800 meter wireless range, it would be good to have a TCP/IP link between two RPi via NRFs so it would be possible to have a TCP/IP connection between two RPi in longer range. The onboard wifi of RPi cannot do long ranges like 50 meter even in clear sight. ![schematics](rpi_tcpip_link.png) ## Hardware Configuration -1. wiring: Here is how I did connect the module to the RPi as described in the main RF24 documentation [here](https://nrf24.github.io/RF24/#autotoc_md227). -2. Noise on 3.3v on RPi: Put some capacitor or L-C filter to reduce the noise on 3.3v supply from RPi. -3. Shielding PA/LNA module: Shield your radio module, if it has none. See more details [in the RF24 Common Issues document](https://github.com/nRF24/RF24/blob/master/COMMON_ISSUES.md#my-palna-module-fails-to-transmit) +1. **Wiring:** Here is how I did connect the module to the RPi as described in the [RF24 documentation](https://nrf24.github.io/RF24/md_docs_2rpi__general.html#autotoc_md268). +2. **Noise on 3.3v on RPi:** Put some capacitor or L-C filter to reduce the noise on 3.3v supply from RPi. +3. **Shielding PA/LNA module:** Shield your radio module, if it has none. See more details [in the RF24 Common Issues document](https://github.com/nRF24/RF24/blob/master/COMMON_ISSUES.md#my-palna-module-fails-to-transmit) ## Software Configuration 1. Enable SPI from [`raspi-config`](https://www.raspberrypi.com/documentation/computers/configuration.html#raspi-config). Select "Interface Options" -> "SPI" -> "Yes" -> "Ok", then exit and reboot the RPi (`sudo reboot`). -2. Install nRF24 library stack on each machine. See more detail in the [RF24 docs](https://nrf24.github.io/RF24/md_docs_2linux__install.html). +2. Install nRF24 library stack on each machine. See more detail in the [RF24 documentation](https://nrf24.github.io/RF24/md_docs_2linux__install.html). ```text sudo apt-get update @@ -25,7 +25,8 @@ wget https://raw.githubusercontent.com/nRF24/.github/main/installer/install.sh chmod +x install.sh ./install.sh ``` -Installer will promp which modules you want to install. I did installed all modules: "RF24", "RF24Network" "RF24Mesh" "RF24Gateway". Also please select `SPIDEV` driver during installation. + +Installer will prompt which modules you want to install. I did installed all modules: "RF24", "RF24Network" "RF24Mesh" "RF24Gateway". Also please select `SPIDEV` driver during installation. after installation done, and if there are no errors in the process, there will be these directories inside the RPi: @@ -40,6 +41,7 @@ Next we need to choose a master/primary node (as discussed [here](https://github this code is already cloned to local device in process of installation. so we need to have some edits on the code. On the Master/Primary machine no need to do edits, but on the secondary machine we need to edit `~/rf24libs/RF24Gateway/examples/ncurses/RF24Gateway_ncurses.cpp` file, first lines of method `main()` Before edit (first lines) + ```cpp int main() { @@ -53,7 +55,9 @@ int main() //uint16_t address = 0; //gw.begin(address,3,RF24_2MBPS); ``` + after edit: + ```cpp int main() { @@ -85,13 +89,14 @@ sudo ifconfig tun_nrf24 10.11.2.2/24 ``` The following commands can be run to modify the default TCP/IP window sizes. This can severely impact other network -functionality. Run `sudo sysctl net.ipv4.tcp_wmem` and `sudo sysctl net.ipv4.tcp_rmem` to get the defaults so they can be +functionality. Run `sudo sysctl net.ipv4.tcp_wmem` and `sudo sysctl net.ipv4.tcp_rmem` to get the defaults so they can be restored. -``` +```shell sudo sysctl net.ipv4.tcp_wmem="1500 1500 1500" sudo sysctl net.ipv4.tcp_rmem="1500 1500 1500" ``` + These changes are only temporary and need to be run each time after reboot of the operating system. ### Secondary machine config @@ -102,13 +107,14 @@ sudo ifconfig tun_nrf24 10.11.2.3/24 ``` The following commands can be run to modify the default TCP/IP window sizes. This can severely impact other network -functionality. Run `sudo sysctl net.ipv4.tcp_wmem` and `sudo sysctl net.ipv4.tcp_rmem` to get the defaults so they can be +functionality. Run `sudo sysctl net.ipv4.tcp_wmem` and `sudo sysctl net.ipv4.tcp_rmem` to get the defaults so they can be restored. -``` +```shell sudo sysctl net.ipv4.tcp_wmem="1500 1500 1500" sudo sysctl net.ipv4.tcp_rmem="1500 1500 1500" ``` + These changes are only temporary and need to be run each time after reboot of the operating system. ### Run the ncurses example on both machines @@ -141,4 +147,3 @@ rtt min/avg/max/mdev = 13.014/14.281/15.603/0.698 ms ``` The resulting latency when pinging primary machine from secondary is about 14 millisecond. Let's check the transfer speed. The speed, most of the times, is about `10 kB/s` (equal to 100K bits per second) but sometimes less. `5 kB/s` should be good approximation for an average. - From 670815d20a2017e8a36b65a65230efa505c01fa4 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Tue, 25 Nov 2025 05:27:02 -0800 Subject: [PATCH 3/4] update RTD config --- .readthedocs.yaml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index db23052..e467b11 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -6,23 +6,22 @@ version: 2 build: - os: "ubuntu-22.04" - apt_packages: - - libclang1-12 - - libclang-cpp12 + os: "ubuntu-24.04" + # apt_packages: + # - libclang1-12 + # - libclang-cpp12 tools: python: "3" commands: # Install doxygen from source distributions (conda forge does not keep up-to-date doxygen releases) - > - DOXYGEN_VERSION="1.13.2" && + DOXYGEN_VERSION="1.15.0" && + RELEASE_TITLE=$(echo ${DOXYGEN_VERSION} | tr '.' '_') && mkdir .doxygen && cd .doxygen && - echo $(pwd) && - echo "https://sourceforge.net/projects/doxygen/files/rel-$DOXYGEN_VERSION/doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz" && - curl -L https://sourceforge.net/projects/doxygen/files/rel-$DOXYGEN_VERSION/doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz > doxygen.tar.gz && + curl -L "https://github.com/doxygen/doxygen/releases/download/Release_${RELEASE_TITLE}/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz" --output doxygen.tar.gz && gunzip doxygen.tar.gz && tar xf doxygen.tar && - mv doxygen-$DOXYGEN_VERSION/bin/doxygen ./ + mv doxygen-${DOXYGEN_VERSION}/bin/doxygen ./ # get lib version & overwrite Doxyfile values - python3 .github/doxygen.py # run doxygen From 66b2d585136802f9fd0d54a8cab58b082043fb4c Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 27 Nov 2025 01:55:07 -0800 Subject: [PATCH 4/4] switch CI back to org-repo main branch --- .github/workflows/build_linux.yml | 4 ++-- .github/workflows/clang_format.yml | 2 +- .github/workflows/doxygen.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 0a6485f..64e8a6c 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -33,7 +33,7 @@ concurrency: jobs: build: - uses: nRF24/.github/.github/workflows/build_linux_cmake.yaml@review-ci + uses: nRF24/.github/.github/workflows/build_linux_cmake.yaml@main with: compiler: ${{ matrix.toolchain.compiler }} usr-dir: ${{ matrix.toolchain.usr_dir }} @@ -60,5 +60,5 @@ jobs: # needed for uploading release assets contents: write if: startsWith(github.ref, 'refs/tags/') - uses: nRF24/.github/.github/workflows/deploy_cpack_artifacts.yaml@review-ci + uses: nRF24/.github/.github/workflows/deploy_cpack_artifacts.yaml@main secrets: inherit diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index e359b9c..a198a70 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -14,7 +14,7 @@ concurrency: jobs: check: - uses: nRF24/.github/.github/workflows/cpp_lint.yaml@review-ci + uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main permissions: # needed to detect changed files contents: read diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml index 8d4c52e..b9196c6 100644 --- a/.github/workflows/doxygen.yml +++ b/.github/workflows/doxygen.yml @@ -32,7 +32,7 @@ concurrency: jobs: build: - uses: nRF24/.github/.github/workflows/build_docs.yaml@review-ci + uses: nRF24/.github/.github/workflows/build_docs.yaml@main with: doxygen-version: '1.15.0' @@ -44,5 +44,5 @@ jobs: id-token: write # to upload to GitHub Pages pages: write - uses: nRF24/.github/.github/workflows/deploy_docs.yaml@review-ci + uses: nRF24/.github/.github/workflows/deploy_docs.yaml@main secrets: inherit