There is a closed-source library for the BME680 weather sensor that allows it to detect specific gases based on some advanced mathematical manipulation of the raw sensor data:
But unfortunately they are only distributed as precompiled binaries, in the .a file format, for various chip types.
But they do offer one for the ARM Cortex M3, which I'm pretty sure is the same chip that is in my Particle Photon.
Is it at all possible to import and use these .a files in the Particle IDE? Just wondering if this is even possible before I go digging into how.
It is not possible to use a pre-compiled .a file with the cloud compilers.
It may be possible with the gcc-arm local compiler and Particle Workbench. However, you can't do it using the build.mk file, so you actually need to modify the Makefiles in the device-os source in order to get it to work.
Success! Thanks to the link you gave me, I was able to flash the precompiled BSEC library to my Particle Photon. I had to rearrange the library a bit so that the .a file I needed was in the root, and then just like that user described, it was just a matter of editing the two makefiles:
to C:\Users\USERNAME\.particle\toolchains\buildscripts\1.10.0\makefile
I wasn't actually sure what I was doing translating linux directories to Windows file structure, but I was pretty sure that what I had just told it with project_root was to look in C:\Users\USERNAME.particle\toolchains\deviceOS\2.3.1, so that's where I added the BSEC library as well, and I just renamed it BSEC to shorten it. I'm not sure which directory the compiler was really looking at, so I just made sure if I made any changes to BSEC library in one, I copied them to the other.
It compiled successfully, but threw up an error when trying to use the cloud compile button, so I just ran
And it flashed successfully. And now I'm getting CO2 levels out of a tin dioxide gas sensor thanks to Bosch's 20kB of sensor integration code based on lab analysis. Neato. Thanks guys!