alexh-name / bsec_bme680_linux

Read the BME680 sensor with the BSEC library on Linux (e.g. Raspberry Pi)
Other
87 stars 48 forks source link

compiling from new version of BSEC (1.4.7.1) yelds some errors #12

Closed kplaczek closed 5 years ago

kplaczek commented 5 years ago

Hi i tried to compile the program using provided make.sh. There is new version of BSEC since last time sources were updated so I changed the path in make.config (from BSEC_1.4.6.0_Generic_Release_20180425 to BSEC_1.4.7.1_Generic_Release_20180907) and that was fine. But when I tried to run make.sh this didn't go well and ended quickly with errors I can't fix on my own.

Compiling...
./bsec_bme680.c: In function ‘main’:
./bsec_bme680.c:338:43: warning: passing argument 3 of ‘bsec_iot_loop’ from incompatible pointer type [-Wincompatible-pointer-types]
   bsec_iot_loop(_sleep, get_timestamp_us, output_ready, state_save, 10000);
                                           ^~~~~~~~~~~~
In file included from ./bsec_bme680.c:24:0:
./src/BSEC_1.4.7.1_Generic_Release_20180907/examples/bsec_integration.h:155:6: note: expected ‘output_ready_fct {aka void (*)(long long int,  float,  unsigned char,  float,  float,  float,  float,  float,  float,  enum <anonymous>,  float,  float,  float)}’ but argument is of type ‘void (*)(int64_t,  float,  uint8_t,  float,  float,  float,  float,  float,  float,  bsec_library_return_t) {aka void (*)(long long int,  float,  unsigned char,  float,  float,  float,  float,  float,  float,  enum <anonymous>)}’
 void bsec_iot_loop(sleep_fct sleep, get_timestamp_us_fct get_timestamp_us, output_ready_fct output_ready,
      ^~~~~~~~~~~~~
Compiled.
Copied config.

Since BOSCH don't keep the older versions of BSEC to download I could use some help with the newer sources. At the end it says 'Compiled' and bsec_bme680 file is there but when I run it there is no output. Even when I remove bsec_iaq.state file

EDIT output_ready function in this newer version is expanded and expects a few extra parameters so i updated that according to bsec_integration.h:103 but no luck so far and no output as well.

EDIT2 It works. One i updated function output_ready https://github.com/alexh-name/bsec_bme680_linux/blob/1a7aaf1030f29899873eef4ef3a9e4aab72bd3ac/bsec_bme680.c#L178 so parameters are correct to the ones from bsec_integration header file everything works.

alexh-name commented 5 years ago

Thanks for pointing it out! Fixed in 787b6d3.