# Compile PIR\_sensor\_switch option is failing?

**URL:** <https://wled.discourse.group/t/compile-pir-sensor-switch-option-is-failing/4777>\
**Category:** Issues\
**Created:** [January 25, 2022, 6:59am UTC](https://wled.discourse.group/t/compile-pir-sensor-switch-option-is-failing/4777 "2022-01-25T06:59:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mtrcycllvr](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/mtrcycllvr/32/2738_2.png) [@mtrcycllvr](https://wled.discourse.group/u/mtrcycllvr)\
**Post date:** [January 25, 2022, 6:59am UTC](https://wled.discourse.group/t/compile-pir-sensor-switch-option-is-failing/4777/1 "2022-01-25T06:59:58Z")

</div>

Greetings!  
Download latest WLED version from git hub, save in Arudino projects folder WHOLE and intact.

After sorting out library dependencies, I compile with default options as downloaded from github. Fails with resulting binary too big to load. Drop/comment out OTA updates. Compiles at 99% of available space.

In wled.h, add this:

> // TRY to use the PIR mod as “intended…” Doesn’t seem to work?  
> #define USERMOD\_PIRSWITCH

Compiler fails saying it can’t find the files… But if I cut and paste the EXACT error paths and look at them directly? Nothing amis… The are right there in plain sight with no permissions issues…

> usermods\_list.cpp:37:10: fatal error: …/usermods/PIR\_sensor\_switch/usermod\_PIR\_sensor\_switch.h: No such file or directory  
> #include “…/usermods/PIR\_sensor\_switch/usermod\_PIR\_sensor\_switch.h”

Is this something platform dependent, aka, Arduino can’t look “up” out of the project directory? Should I just give in a move it all around so it’s in a flat structure and try again?

OS X 11.6  
Arduino 1.8.13

I’m not a super experienced compiler, so I’m not clear what’s going on - I did some research and found an old pull request that seems to have lead to the modern usermods\_list.cpp, and this all LOOKS like fine code to my feeble mind. Clearly I shouldn’t HAVE to do the “flaten it out, move the libraries thus and there” to get this compile based on what I can see?

Any thoughts on what I might be doing incorrectly?

Thanks so much!

---

<div class="post-metadata">

**Author:** ![blazoncek](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/blazoncek/32/1886_2.png) [@blazoncek](https://wled.discourse.group/u/blazoncek)\
**Post date:** [January 25, 2022, 1:11pm UTC](https://wled.discourse.group/t/compile-pir-sensor-switch-option-is-failing/4777/2 "2022-01-25T13:11:32Z")

</div>

Use Visual Studio Code + PlatformIO.  
Arduino IDE just doesn’t cut it.

---

<div class="post-metadata">

**Author:** ![mtrcycllvr](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/mtrcycllvr/32/2738_2.png) [@mtrcycllvr](https://wled.discourse.group/u/mtrcycllvr)\
**Post date:** [January 25, 2022, 8:35pm UTC](https://wled.discourse.group/t/compile-pir-sensor-switch-option-is-failing/4777/3 "2022-01-25T20:35:49Z")

</div>

Thank you, Blazoncek! I will look at building the indicated tool chain… I actually DID get arduino IDE to compile with PIR switch, but had to “flatten” the file hierarchy…

Appreciate your time!!

Sincerely,

-ET-
