Skip to content

Exclude utility/pigpio from PlatformIO package export - #1078

Merged
2bndy5 merged 1 commit into
nRF24:masterfrom
kuralabs:fix/exclude-pigpio-from-pio-export
Aug 12, 2026
Merged

2bndy5 merged 1 commit into
nRF24:masterfrom
kuralabs:fix/exclude-pigpio-from-pio-export

Conversation

@carlos-jenkins

Copy link
Copy Markdown
Contributor

Summary

library.json's  export.exclude  strips every Linux/SBC-specific backend under  utility/  from the packaged PlatformIO library -  wiringPi ,  MRAA ,  LittleWire ,  RPi ,  SPIDEV ,  rp2 ,  ATXMegaD3  - but  utility/pigpio  was missed. This one-line change adds it, consistent with the sibling backends.

Why it matters

utility/pigpio/{compatibility,gpio,interrupt,spi}.cpp  #include <pigpio.h>, a Raspberry-Pi–only dependency. Because it isn't excluded, it ships in the packaged library and is the only remaining  utility/ backend with .cpp sources that a non-LDF consumer will try to compile.

  • On classic PlatformIO this is harmless: the Library Dependency Finder (LDF) prunes those files via the #if !defined(ARDUINO) guards, so they're never compiled on Arduino targets.
  • On build systems that compile all packaged sources without running the LDF, the pigpio backend gets force-compiled and the build fails with  fatal error: pigpio.h: No such file or directory.

A concrete case is ESPHome on ESP32: current ESPHome builds the Arduino framework through the IDF-based pioarduino platform, whose PlatformIO -> ESP-IDF converter globs every source file in a dependency (no LDF). Pulling RF24 via lib_deps  / cg.add_library("nRF24/RF24")  therefore compiles utility/pigpio/*.cpp and fails on ESP32. ESP8266 (classic PlatformIO) is unaffected.

The `export.exclude` list in library.json strips every Linux/SBC-specific
backend under `utility/` from the packaged PlatformIO library (wiringPi, MRAA,
LittleWire, RPi, SPIDEV, rp2, ATXMegaD3) — but `utility/pigpio` was missed.

`utility/pigpio/{compatibility,gpio,interrupt,spi}.cpp` include <pigpio.h>,
which is a Raspberry-Pi-only dependency. When RF24 is consumed as a PlatformIO
dependency on Arduino targets, classic PlatformIO's Library Dependency Finder
prunes these files via the `#if !defined(ARDUINO)` guards, so the omission is
harmless there. However, build systems that compile all packaged sources
without running the LDF (e.g. ESPHome's ESP32 arduino/pioarduino -> ESP-IDF
converter, which globs every source file in a dependency) attempt to compile
the pigpio backend and fail with "pigpio.h: No such file or directory".

Excluding `utility/pigpio/*` from the export — consistent with the other
Linux-only backends already listed — fixes those builds and has no effect on
platforms that relied on LDF pruning.

@2bndy5 2bndy5 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks. FYI, the pigpio driver was added after the platform io support was added. We just missed it when merging the pigpio driver to master branch.

@2bndy5
2bndy5 merged commit 02b1203 into nRF24:master Aug 12, 2026
74 checks passed
@carlos-jenkins

Copy link
Copy Markdown
Contributor Author

Thanks a lot @2bndy5 ! I made a ESPHome external component for the nRF24L01+ that works on ESP32 and ESP8266:

https://github.com/kuralabs/esphome-nrf24

That's why found this issue. Currently its pointing to my fork, as soon as this is released (no pressure, just a statement) I'll update it to pull from upstream.

Thanks.

@2bndy5

2bndy5 commented Aug 13, 2026

Copy link
Copy Markdown
Member

I think we can push a release, right @TMRh20 ?

@TMRh20

TMRh20 commented Aug 13, 2026

Copy link
Copy Markdown
Member

@2bndy5 Yes!

Thank you @carlos-jenkins

@2bndy5

2bndy5 commented Aug 13, 2026

Copy link
Copy Markdown
Member

Deployed v1.6.2. Should be live already on PIO registry.

carlos-jenkins added a commit to kuralabs/esphome-nrf24 that referenced this pull request Aug 13, 2026
RF24 v1.6.2 was released with the fix from nRF24/RF24#1078

Changes:

- __init__.py: pull `nRF24/RF24@1.6.2` from the PlatformIO registry instead of
  our fork's git branch.
- README: rewrite the RF24 dependency section to describe the registry
  dependency and the >=1.6.2 requirement; remove all references to the fork.

Verified: `tox -e validate` and `tox -e compile` (ESP32 + ESP8266) pass, with
RF24 installed from the registry (Library Manager: nRF24/RF24 @ 1.6.2).
@carlos-jenkins
carlos-jenkins deleted the fix/exclude-pigpio-from-pio-export branch August 13, 2026 06:34
@carlos-jenkins

Copy link
Copy Markdown
Contributor Author

Appreciated @2bndy5 and @TMRh20

I just updated the component to use upstream 1.6.2 and everything worked flawlessly. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants