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

Patch for #834 #839

Merged
merged 9 commits into from
Apr 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
./build

- name: provide pigpio
if: ${{ matrix.config-options != '--driver=MRAA' }}
if: ${{ matrix.config-options == '--driver=pigpio' || endsWith(matrix.config-options, '--driver=RPi') }}
run: |
git clone https://github.com/joan2937/pigpio.git
cd pigpio
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 11 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -413,12 +414,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)
Expand All @@ -428,7 +433,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
Expand Down
10 changes: 7 additions & 3 deletions docs/linux_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions docs/using_cmake.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion examples_linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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