From 8ffd5bf1dc7483e6e6c5bc751327dcc553207a4d Mon Sep 17 00:00:00 2001 From: 2bndy5 <2bndy5@gmail.com> Date: Fri, 15 Apr 2022 04:51:06 -0700 Subject: [PATCH 1/9] fail to configure if pigpio not found --- configure | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure b/configure index dbca071f5..e44ce4fac 100755 --- a/configure +++ b/configure @@ -428,7 +428,11 @@ LittleWire) SHARED_LINKER_LIBS+=" -llittlewire-spi" ;; pigpio) - SHARED_LINKER_LIBS+=" -lpigpio" + if [ $pigpio_detected -eq 0 ]; then + die "[ERROR] pigpio was not detected. Make sure pigpio is installed." 2 + else + SHARED_LINKER_LIBS+=" -lpigpio" + fi ;; *) die "Unsupported DRIVER: ${DRIVER}." 2 From 3a72833c0af92e9ccb1ce5946134988ad854bc39 Mon Sep 17 00:00:00 2001 From: 2bndy5 <2bndy5@gmail.com> Date: Fri, 15 Apr 2022 04:56:26 -0700 Subject: [PATCH 2/9] configure disable IRQ support if no pigpio found --- configure | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure b/configure index e44ce4fac..5e5f3866d 100755 --- a/configure +++ b/configure @@ -413,12 +413,16 @@ SPIDEV) if [ $pigpio_detected -eq 1 ]; then echo "[INFO] linking to pigpio for interrupt compatibility" SHARED_LINKER_LIBS+=" -lpigpio" + else + CFLAGS+=" -DRF24_NO_INTERRUPT" fi ;; RPi) if [ $pigpio_detected -eq 1 ]; then echo "[INFO] linking to pigpio for interrupt compatibility" SHARED_LINKER_LIBS+=" -lpigpio" + else + CFLAGS+=" -DRF24_NO_INTERRUPT" fi ;; MRAA) From 2a4c5b7e6d4040eaeee1b4bfe9fe0c422db0ed15 Mon Sep 17 00:00:00 2001 From: 2bndy5 <2bndy5@gmail.com> Date: Fri, 15 Apr 2022 05:00:18 -0700 Subject: [PATCH 3/9] [Linux CI] test changhes to configure script --- .github/workflows/build_linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 7cd9b03f1..9dbbc0ea8 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -93,7 +93,7 @@ jobs: ./build - name: provide pigpio - if: ${{ matrix.config-options != '--driver=MRAA' }} + if: ${{ matrix.config-options != '--driver=pigpio' }} run: | git clone https://github.com/joan2937/pigpio.git cd pigpio From 78dcbfe6355910ed64ca50f40d3facd3ec58f27d Mon Sep 17 00:00:00 2001 From: 2bndy5 <2bndy5@gmail.com> Date: Fri, 15 Apr 2022 05:02:07 -0700 Subject: [PATCH 4/9] oops; reverse logic in CI step --- .github/workflows/build_linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 9dbbc0ea8..561ce903b 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -93,7 +93,7 @@ jobs: ./build - name: provide pigpio - if: ${{ matrix.config-options != '--driver=pigpio' }} + if: ${{ matrix.config-options == '--driver=pigpio' }} run: | git clone https://github.com/joan2937/pigpio.git cd pigpio From 886365567baef587875affd43781dc56a4b34b6b Mon Sep 17 00:00:00 2001 From: 2bndy5 <2bndy5@gmail.com> Date: Fri, 15 Apr 2022 05:22:35 -0700 Subject: [PATCH 5/9] better checking for libpigpio.so existence --- configure | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 5e5f3866d..84dd4593d 100755 --- a/configure +++ b/configure @@ -58,7 +58,8 @@ function execute_check { fi } -if [[ $(execute_check "file /usr/lib/libpigpio.so") ]]; then +if [[ -f "/usr/lib/libpigpio.so" || -f "/usr/local/lib/libpigpio.so" || -f "/usr/arm-linux-gnueabihf/lib/libpigpio.so" ]]; then + echo "[INFO] pigpio lib found." pigpio_detected=1 fi From 83fd9aaf7679653fe3c31171a9bfed247d292da8 Mon Sep 17 00:00:00 2001 From: 2bndy5 <2bndy5@gmail.com> Date: Fri, 15 Apr 2022 05:49:37 -0700 Subject: [PATCH 6/9] adjust Makefile for no pigpio support --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 02eb2d22c..ada2ffecb 100644 --- a/Makefile +++ b/Makefile @@ -21,9 +21,15 @@ OBJECTS=RF24.o ifeq ($(DRIVER), MRAA) OBJECTS+=spi.o gpio.o compatibility.o else ifeq ($(DRIVER), RPi) -OBJECTS+=spi.o bcm2835.o interrupt.o compatibility.o +OBJECTS+=spi.o bcm2835.o compatibility.o +ifneq (,$(findstring -lpigpio,$(SHARED_LINKER_LIBS))) +OBJECTS+=interrupt.o +endif else ifeq ($(DRIVER), SPIDEV) -OBJECTS+=spi.o gpio.o compatibility.o interrupt.o +OBJECTS+=spi.o gpio.o compatibility.o +ifneq (,$(findstring -lpigpio,$(SHARED_LINKER_LIBS))) +OBJECTS+=interrupt.o +endif else ifeq ($(DRIVER), wiringPi) OBJECTS+=spi.o else ifeq ($(DRIVER), pigpio) From fc3e9da7775bbfb88143b659ddbb0b7a69afb4a2 Mon Sep 17 00:00:00 2001 From: 2bndy5 <2bndy5@gmail.com> Date: Fri, 15 Apr 2022 05:57:27 -0700 Subject: [PATCH 7/9] adjust examples_linux/Makefile as well --- examples_linux/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples_linux/Makefile b/examples_linux/Makefile index e3a3c4998..bd9a71287 100644 --- a/examples_linux/Makefile +++ b/examples_linux/Makefile @@ -18,6 +18,9 @@ endif include ../Makefile.inc # define all programs -PROGRAMS = gettingstarted acknowledgementPayloads manualAcknowledgements streamingData multiceiverDemo scanner interruptConfigure +PROGRAMS = gettingstarted acknowledgementPayloads manualAcknowledgements streamingData multiceiverDemo scanner +ifneq (,$(findstring -lpigpio,$(SHARED_LINKER_LIBS))) +PROGRAMS+=interruptConfigure +endif include Makefile.examples From 10899795e049dd1ac305dd4135531a1067cfa533 Mon Sep 17 00:00:00 2001 From: 2bndy5 <2bndy5@gmail.com> Date: Fri, 15 Apr 2022 06:48:12 -0700 Subject: [PATCH 8/9] update docs about pigpio req --- docs/linux_install.md | 10 +++++++--- docs/using_cmake.md | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/linux_install.md b/docs/linux_install.md index a434234ba..6fc120b4d 100644 --- a/docs/linux_install.md +++ b/docs/linux_install.md @@ -7,13 +7,17 @@ Generic Linux devices are supported via SPIDEV, MRAA, RPi native via BCM2835, or @warning The manual install instructions are beginning to age because they were designed with the assumption that the arm-linux-gnueabihf-g\*\* compilers were available and default for the system. If you have problems -using those instructions, please try the [instructions using CMake](md_docs_using_cmake.html). +using the manual install instructions (especially on a 64-bit OS), please try the +[instructions using CMake](md_docs_using_cmake.html). + +@note Since wiringPi is no longer maintained or distributed (as of RPi OS 11 bullseye), +pigpio is now required for using the radio's IRQ pin. This applies to RPi, SPIDEV, and pigpio drivers. The MRAA driver may provide its own IRQ implementation. Remember that the RPi OS lite variant does not ship with pigpio installed. ## Automated Install **Designed & Tested on RPi** - Defaults to SPIDEV on devices supporting it -1. Install prerequisites if there are any (MRAA, LittleWire libraries, setup SPI device etc) +1. Install prerequisites if there are any (pigpio, MRAA, LittleWire libraries, setup SPI device etc) 2. Download the install.sh file from [https://github.com/nRF24/.github/blob/main/installer/install.sh](https://raw.githubusercontent.com/nRF24/.github/main/installer/install.sh) ```shell wget https://raw.githubusercontent.com/nRF24/.github/main/installer/install.sh @@ -39,7 +43,7 @@ using those instructions, please try the [instructions using CMake](md_docs_usin ## Manual Install -1. Install prerequisites if there are any (MRAA, LittleWire libraries, setup SPI device etc) +1. Install prerequisites if there are any (pigpio, MRAA, LittleWire libraries, setup SPI device etc) @note See the [MRAA](http://iotdk.intel.com/docs/master/mraa/index.html) documentation for more info on installing MRAA 2. Make a directory to contain the RF24 and possibly RF24Network lib and enter it ```shell diff --git a/docs/using_cmake.md b/docs/using_cmake.md index 94fd4401e..333522ad5 100644 --- a/docs/using_cmake.md +++ b/docs/using_cmake.md @@ -20,6 +20,9 @@ sudo rm /usr/local/lib/librf24-bcm.so sudo rm -r /usr/local/include/RF24 ``` +@note Since wiringPi is no longer maintained or distributed (as of RPi OS 11 bullseye), +pigpio is now required for using the radio's IRQ pin. This applies to RPi, SPIDEV, and pigpio drivers. The MRAA driver may provide its own IRQ implementation. Remember that the RPi OS lite variant does not ship with pigpio installed. + The _librf24-bcm.so_ file may not exist if you used CMake to install the library. 1. Download the appropriate package for your machine From d06f0d73730ac6307b398aa867a468a7685b7d35 Mon Sep 17 00:00:00 2001 From: 2bndy5 <2bndy5@gmail.com> Date: Fri, 15 Apr 2022 07:12:38 -0700 Subject: [PATCH 9/9] [linux CI] install pigpio w/ RPi driver --- .github/workflows/build_linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 561ce903b..8ce3f16d2 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -93,7 +93,7 @@ jobs: ./build - name: provide pigpio - if: ${{ matrix.config-options == '--driver=pigpio' }} + if: ${{ matrix.config-options == '--driver=pigpio' || endsWith(matrix.config-options, '--driver=RPi') }} run: | git clone https://github.com/joan2937/pigpio.git cd pigpio