for those trying to get BME680 to work using BSEC proprietary software on esp8266, so that you can gather IAQ and other air quality data.
it took a bit effort to figure out how to get the BME680 to work with an ESP. it works fine with esp32. but an esp was a bit illusive on how to setup on esp. as most internet information was missing one piece of important info (MMU).
so basically download the BSEC from arduino library
then edit esp platform.txt found either in windows /appData/locals/ or as hidden folder on linux
Arduino15\packages\esp8266\hardware\esp8266"ESPVersion"
add
compiler.libraries.ldflags=
to the bottom of this section
#These can be overridden in platform.local.txt
compiler.c.extra_flags=
compiler.c.elf.extra_flags=
compiler.S.extra_flags=
compiler.cpp.extra_flags=
compiler.ar.extra_flags=
compiler.objcopy.eep.extra_flags=
compiler.elf2hex.extra_flags=
and then edit this section:
## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {build.exception_flags} -Wl,-Map "-Wl,{build.path}/{build.project_name}.map" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} -Wl,--end-group "-L{build.path}"
to include
{compiler.libraries.ldflags}
after {compiler.c.elf.libs}
and then save file.
Next modify MMU of your esp8266 device to 16kb cache and 48kb IRAM
then once that is done you can flash your esp8266 with BSEC library and get more IAQ data from it
such as
"Timestamp [ms], raw temperature [°C], pressure [hPa], raw relative humidity [%], gas [Ohm], IAQ, IAQ accuracy, temperature [°C], relative humidity [%], Static IAQ, CO2 equivalent, breath VOC equivalent";
arduino sketch for basic publishing a JSON. it does not publish for 320000 as it waits for the device to warm. if the device is mobile use IAQ for air quality if the device is inside use StaticIAQ for air quality measurements
MQTT_IAQ_BME680.zip (2.5 KB)