Problems with OctoWS2811 Library

I’m having two (possibly related) problems accessing the OctoWS2811 library by Paul Stoffregen/PJRC. The first problem has apparently existed for some time: When the latest version is specified with
lib_deps = paulstoffregen/OctoWS2811 @ ^1.4
an older version is actually loaded. The workaround (which I learned from someone else) is to find the correct-version .h and .cpp files on GitHub and overwrite the ones in .pio/libdeps/teensy40/OctoWS2811. This method has worked fine, but it seems like it should really be fixed.

Unfortunately, that method has stopped working on my current project. The difference is that I’ve now created some private libraries, which I’m referencing with
lib_extra_dirs = /Users/keith/Documents/PlatformIO/Projects/EFD_libraries

When that line is added, I get the following compile messages:

    Dependency Graph
    |-- <OctoWS2811> 1.4.0
    |-- <PixelDriver>
    Building in release mode
    Archiving .pio/build/teensy40/lib803/libOctoWS2811.a
    Compiling .pio/build/teensy40/lib5e3/PixelDriver/PixelDriver.cpp.o
    Indexing .pio/build/teensy40/lib803/libOctoWS2811.a
    Compiling .pio/build/teensy40/FrameworkArduino/CrashReport.cpp.o
    Compiling .pio/build/teensy40/FrameworkArduino/DMAChannel.cpp.o
    Compiling .pio/build/teensy40/FrameworkArduino/EventResponder.cpp.o
    Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial.cpp.o
    Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial1.cpp.o
    src/PixelDriver.cpp:2:24: fatal error: OctoWS2811.h: No such file or directory

When I remove the lib_extra_deps command, it compiles fine (as long as I don’t reference the private libraries). Alternatively, I can delete the OctoWS2811 library reference and access the private libraries fine. I just can’t do both.

Can anyone shed some light on this? I’ve tried lots of things but am out of ideas. I also posted this to the PJRC forum yesterday but have no responses yet.

The problem is that there hasn’t been a new release since 2017 (Releases · PaulStoffregen/OctoWS2811 · GitHub) or changes to the library.json, so PlatformIO won’t automatically update. (@ivankravets can you manually update the library?)

That’s not very safe. You should just use the intended way of using lib_deps and pointing it at the Github source (e.g. the downloadable ZIP) using

lib_deps =

Can you post the complete folder (and the referenced libraries folder) for reproduction?

Thanks for getting back to me so quickly!

The 2017 release (v1.4) works fine, and that’s what I’ve been using. It just doesn’t load correctly as other libraries do.

OK, thanks, I wasn’t aware of that method. It didn’t fix the second problem, but I’ll continue using this as needed.

I’m not completely sure what you’re asking for, but I’ll try. Below is the relevant directory structure. I’m trying to compile the “PixelDriver” library (inside the library folder), which uses OctoWS2811 and also the “ColorUtilsHsi” library in the same folder.


I just tried moving the referenced ColorUtilsHsi library to a different folder and changed lib_extra_dirs accordingly, and that seems to work (i.e. can reference that lib and also OctoWS2811).
This seems like either a bug or a limitation that I don’t understand.

This is just a temporary hack, not a solution, since it requires me to move libraries to places they don’t below (and remember to move them back) just to get the code to compile.