Giter VIP home page Giter VIP logo

bme68x_lib's People

Contributors

mauriciobarroso avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

bme68x_lib's Issues

Having issue with i2c

Hello,
I just got a BME688 and a ESP32C6 wroom board, so I'm using the latest master on esp-idf to have support for esp32c6. I tried to do something like this in app main:

    i2c_t i2cinfo;
    i2cinfo.i2c_addr = BME68X_I2C_ADDR_LOW;
    i2cinfo.i2c_conf = conf;
    i2cinfo.i2c_num = 0;
    memset(&bsec2_dev, 0, sizeof(bsec2_t));
    bsec2_init(&bsec2_dev, &i2cinfo, BME68X_I2C_INTF);
    if (bsec2_dev.status != 0)
    {
        printf("Something is wrong with bme688 %d \n", bsec2_dev.status);
    }
        bsec_sensor_configuration_t requested_virtual_sensors[7];
    uint8_t n_requested_virtual_sensors = BSEC_MAX_PHYSICAL_SENSOR;

    requested_virtual_sensors[0].sensor_id = BSEC_OUTPUT_IAQ;
    requested_virtual_sensors[0].sample_rate = BSEC_SAMPLE_RATE_CONT;
    requested_virtual_sensors[1].sensor_id = BSEC_OUTPUT_RAW_TEMPERATURE;
    requested_virtual_sensors[1].sample_rate = BSEC_SAMPLE_RATE_CONT;
    requested_virtual_sensors[2].sensor_id = BSEC_OUTPUT_RAW_PRESSURE;
    requested_virtual_sensors[2].sample_rate = BSEC_SAMPLE_RATE_CONT;
    requested_virtual_sensors[3].sensor_id = BSEC_OUTPUT_RAW_HUMIDITY;
    requested_virtual_sensors[3].sample_rate = BSEC_SAMPLE_RATE_CONT;
    requested_virtual_sensors[4].sensor_id = BSEC_OUTPUT_RAW_GAS;
    requested_virtual_sensors[4].sample_rate = BSEC_SAMPLE_RATE_CONT;
    requested_virtual_sensors[5].sensor_id = BSEC_OUTPUT_STABILIZATION_STATUS;
    requested_virtual_sensors[5].sample_rate = BSEC_SAMPLE_RATE_CONT;
    requested_virtual_sensors[6].sensor_id = BSEC_OUTPUT_RUN_IN_STATUS;
    requested_virtual_sensors[6].sample_rate = BSEC_SAMPLE_RATE_CONT;

    // Allocate a struct for the returned physical sensor settings
    bsec_sensor_configuration_t required_sensor_settings[BSEC_MAX_PHYSICAL_SENSOR];
    uint8_t n_required_sensor_settings = BSEC_MAX_PHYSICAL_SENSOR;

    // Call bsec_update_subscription() to enable/disable the requested virtual sensors
    bsec_library_return_t update_result = bsec_update_subscription(requested_virtual_sensors, n_requested_virtual_sensors, required_sensor_settings, &n_required_sensor_settings);
    printf("update sub result is %d \n", update_result);

    xTaskCreate(bme_task, "bme688", 4096, NULL, 5, NULL);

Then in the task I'm doing requestion data from bme688 with:

bsec2_run(&bsec2_dev);
        vTaskDelay(5000 / portTICK_PERIOD_MS);

        bsec_outputs_t *thisout = bsec2_get_outputs(&bsec2_dev);
        if (thisout)
            printf("bme688 Sensor id: %.2d %%\n", thisout->output->sensor_id);
        }

        bsec_data_t temp_data = bsec2_get_data(&bsec2_dev, BSEC_OUTPUT_RAW_TEMPERATURE);
        printf("temp data is %0.2f \n", temp_data.signal);

but im getting I2C error, so I looked into the I2C stuff and it seems to using the wrong i2c number and/or i2c address?

Sorry my code is super messy, I'm quite new to the esp-idf stuff and also bme688, so everything seems quite difficult for me, I wonder if you can point me in the right direction on how to properly use this?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.