BME280 sensor project won't compile

Dr. Watson
Posts: 2
Joined: Sat Feb 10, 2018 4:07 pm

BME280 sensor project won't compile

Postby Dr. Watson » Sat Feb 10, 2018 4:33 pm

Hi,

I've recently bought some ESP32 modules and a Bosch BME280 temperature/humidity/pressure sensor. I want to build a weather station. To start, I wanted to use this project: https://github.com/yanbe/bme280-esp-idf-i2c. However, it won't compile. I'm new to C, but it seems like the definitions in bme280_defs.h are not found, and therefore it can't compile the main.c file. I've contacted the repository maintainer, but he didn't respond. I've included the error messages as an attachment (makelog.txt).

My directory structure looks like this:

Code: Select all

.
├── build [47 entries exceeds filelimit, not opening dir]
├── components
│   └── bme280
│       ├── component.mk
│       └── driver
│           ├── bme280.c
│           ├── bme280_defs.h
│           ├── bme280.h
│           ├── changelog.md
│           ├── README.md
│           └── selftest
│               ├── bme280_selftest.c
│               └── bme280_selftest.h
├── LICENSE
├── main
│   ├── component.mk
│   └── main.c
├── Makefile
├── README.rst
├── sdkconfig
└── sdkconfig.old
The bme280 component.mk file contains the following:

Code: Select all

COMPONENT_ADD_INCLUDEDIRS=./driver
COMPONENT_SRCDIRS=./driver
COMPONENT_OBJS=./driver/bme280.o
(This is the same as in the GitHub repository).
The bme280 driver files (bme280.c, bme280.h, bme280_defs.h) are from the official Bosch directory linked in the GitHub project.
I've also tried an empty component.mk file, and placing the driver bme280.c file directly in the bme280 folder and the two driver .h files in an include subdirectory, to no avail (see makelog2.txt). I would be very grateful if anybody could give me a hint ;)
Attachments
makelog2.txt
with include subdirectory and empty component.mk file
(22.66 KiB) Downloaded 752 times
makelog.txt
with driver subdirectory
(22.6 KiB) Downloaded 735 times

Dr. Watson
Posts: 2
Joined: Sat Feb 10, 2018 4:07 pm

Re: BME280 sensor project won't compile

Postby Dr. Watson » Sun Feb 11, 2018 8:32 am

I just got a reply from the maintainer. Apperently Bosch changed the driver in June 2017 and broke backwards compatibility. If anyone uses the library, commit cf40d00 from Bosch should work.

Who is online

Users browsing this forum: Bing [Bot] and 107 guests