arduino / nicla-sense-me-fw

Arduino Nicla Sense ME resources (libraries, bootloader, host pc utilities)
GNU Affero General Public License v3.0
46 stars 27 forks source link

[AE-197] Newly added sensor IDs do not print values to terminal #114

Open aliphys opened 10 months ago

aliphys commented 10 months ago

Description of defect

As part of https://github.com/arduino/nicla-sense-me-fw/pull/85 , new sensor IDs have become avaliable for use on the Nicla Sense ME. These include the following:

  SENSOR_ID_KLIO                     = 112,  /* KLIO output */
  SENSOR_ID_PDR                      = 113,  /* PDR output */
  SENSOR_ID_SWIM                     = 114, /* SWIM output */
  SENSOR_ID_BSEC2_COLLECTOR          = 116,  /* BSEC 2.x raw data collector for AI training */
  SENSOR_ID_BSEC2                    = 117,  /* BSEC 2.x gas classifier output */
  SENSOR_ID_HMC                      = 120, /* HMC output */
  SENSOR_ID_OC                       = 121, /* OC output */
  SENSOR_ID_NOC                      = 122, /* NOC output */
  SENSOR_ID_OCE                      = 123, /* OCE output */
  SENSOR_ID_NOCE                     = 124, /* NOCE output */

To test the features, I modified this sketch by @marqdevx as follows:

Test Sketch ``` /* Sketch that new sensor IDs with four classes, requesting 5 samples of each With Putty, log the Serial output as a .txt @author: Pablo Marquínez, Modified by Ali Jahangiri */ #include "Arduino_BHY2.h" /* Sensor SensorXYZ SensorQuaternion SensorOrientation SensorBSEC SensorActivity */ int sensors[] = {112, 113,114, 116, 117, 120, 121, 122, 123, 124}; Sensor* ptrSensor; int sensorsBSEC[] = {112, 113,114, 116, 117, 120, 121, 122, 123, 124}; SensorBSEC* ptrSensorBSEC; int sensorsBSEC2[] = {112, 113,114, 116, 117, 120, 121, 122, 123, 124}; SensorBSEC2* ptrSensorBSEC2; int sensorsBSEC2Collector[] = {112, 113,114, 116, 117, 120, 121, 122, 123, 124}; SensorBSEC2Collector* ptrSensorBSEC2Collector; void setup() { // put your setup code here, to run once: Serial.begin(9600); while (!Serial) ; delay(10000); BHY2.begin(); delay(1000); checkSensors(); checkSensorsBSEC(); checkSensorsBSEC2(); checkSensorsBSEC2Collector(); Serial.println("--------"); Serial.println("END"); } void loop() { // put your main code here, to run repeatedly: } void checkSensors() { Serial.println("-------"); Serial.println("Checking type Sensor"); int listLength = sizeof(sensors) / sizeof(sensors[0]); for (int checkID = 0; checkID < listLength; checkID++) { ptrSensor = new Sensor(sensors[checkID]); ptrSensor->begin(); Serial.print("\tChecking "); Serial.println(sensors[checkID]); for (int i = 0; i < 3; i++) { BHY2.update(); Serial.println(String("\t\tSample n") + String(i) + String(" ") + ptrSensor->toString()); delay(20); } ptrSensor->end(); } } void checkSensorsBSEC() { Serial.println("-------"); Serial.println("Checking type SensorBSEC"); int listLength = sizeof(sensorsBSEC) / sizeof(sensorsBSEC[0]); for (int checkID = 0; checkID < listLength; checkID++) { ptrSensorBSEC = new SensorBSEC(sensorsBSEC[checkID]); ptrSensorBSEC->begin(); Serial.print("\tChecking "); Serial.println(sensorsBSEC[checkID]); for (int i = 0; i < 3; i++) { BHY2.update(); Serial.println(String("\t\tSample n") + String(i) + String(" ") + ptrSensorBSEC->toString()); delay(20); } ptrSensorBSEC->end(); } } void checkSensorsBSEC2() { Serial.println("-------"); Serial.println("Checking type SensorBSEC2"); int listLength = sizeof(sensorsBSEC2) / sizeof(sensorsBSEC2[0]); for (int checkID = 0; checkID < listLength; checkID++) { ptrSensorBSEC2 = new SensorBSEC2(sensorsBSEC2[checkID]); ptrSensorBSEC2->begin(); Serial.print("\tChecking "); Serial.println(sensorsBSEC2[checkID]); for (int i = 0; i < 3; i++) { BHY2.update(); Serial.println(String("\t\tSample n") + String(i) + String(" ") + ptrSensorBSEC2->toString()); delay(20); } ptrSensorBSEC2->end(); } } void checkSensorsBSEC2Collector() { Serial.println("-------"); Serial.println("Checking type SensorBSEC2Collector"); int listLength = sizeof(sensorsBSEC2Collector) / sizeof(sensorsBSEC2Collector[0]); for (int checkID = 0; checkID < listLength; checkID++) { ptrSensorBSEC2Collector = new SensorBSEC2Collector(sensorsBSEC2Collector[checkID]); ptrSensorBSEC2Collector->begin(); Serial.print("\tChecking "); Serial.println(sensorsBSEC2Collector[checkID]); for (int i = 0; i < 3; i++) { BHY2.update(); Serial.println(String("\t\tSample n") + String(i) + String(" ") + ptrSensorBSEC2Collector->toString()); delay(20); } ptrSensorBSEC2Collector->end(); } } ```

In this test sketch, the sample IDs {112, 113,114, 116, 117, 120, 121, 122, 123, 124} are called via the Sensor, SensorBSEC, SensorBSEC2 and SensorBSEC2Collector classes. In all cases, a null output is given.

Full Serial Output ``` ------- Checking type Sensor Checking 112 Sample n0 Data value: 0.000 Sample n1 Data value: 0.000 Sample n2 Data value: 0.000 Checking 113 Sample n0 Data value: 0.000 Sample n1 Data value: 0.000 Sample n2 Data value: 0.000 Checking 114 Sample n0 Data value: 0.000 Sample n1 Data value: 0.000 Sample n2 Data value: 0.000 Checking 116 Sample n0 Data value: 0.000 Sample n1 Data value: 0.000 Sample n2 Data value: 0.000 Checking 117 Sample n0 Data value: 0.000 Sample n1 Data value: 0.000 Sample n2 Data value: 0.000 Checking 120 Sample n0 Data value: 0.000 Sample n1 Data value: 0.000 Sample n2 Data value: 0.000 Checking 121 Sample n0 Data value: 0.000 Sample n1 Data value: 0.000 Sample n2 Data value: 0.000 Checking 122 Sample n0 Data value: 0.000 Sample n1 Data value: 0.000 Sample n2 Data value: 0.000 Checking 123 Sample n0 Data value: 0.000 Sample n1 Data value: 0.000 Sample n2 Data value: 0.000 Checking 124 Sample n0 Data value: 0.000 Sample n1 Data value: 0.000 Sample n2 Data value: 0.000 ------- Checking type SensorBSEC Checking 112 Sample n0 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n1 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n2 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Checking 113 Sample n0 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n1 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n2 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Checking 114 Sample n0 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n1 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n2 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Checking 116 Sample n0 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n1 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n2 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Checking 117 Sample n0 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n1 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n2 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Checking 120 Sample n0 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n1 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n2 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Checking 121 Sample n0 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n1 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n2 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Checking 122 Sample n0 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n1 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n2 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Checking 123 Sample n0 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n1 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n2 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Checking 124 Sample n0 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n1 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 Sample n2 BSEC output values - iaq: 0 iaq_s: 0 b_voc_eq: 0.00 co2_eq: 0 accuracy: 0 comp_t: 0.00 comp_h: 0.00 comp_g: 0 ------- Checking type SensorBSEC2 Checking 112 Sample n0 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n1 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n2 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Checking 113 Sample n0 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n1 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n2 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Checking 114 Sample n0 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n1 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n2 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Checking 116 Sample n0 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n1 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n2 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Checking 117 Sample n0 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n1 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n2 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Checking 120 Sample n0 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n1 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n2 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Checking 121 Sample n0 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n1 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n2 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Checking 122 Sample n0 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n1 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n2 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Checking 123 Sample n0 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n1 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n2 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Checking 124 Sample n0 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n1 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 Sample n2 BSEC2 output values (%) - gas[0]: 0 gas[1]: 0 gas[2]: 0 gas[3]: 0 accuracy: 0 ------- Checking type SensorBSEC2Collector Checking 112 Sample n0 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n1 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n2 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Checking 113 Sample n0 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n1 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n2 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Checking 114 Sample n0 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n1 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n2 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Checking 116 Sample n0 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n1 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n2 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Checking 117 Sample n0 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n1 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n2 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Checking 120 Sample n0 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n1 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n2 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Checking 121 Sample n0 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n1 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n2 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Checking 122 Sample n0 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n1 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n2 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Checking 123 Sample n0 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n1 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n2 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Checking 124 Sample n0 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n1 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 Sample n2 timestamp: 00 temp: 0.00 pressure: 0.00 hum: 0.00 gas: 0.00 gas_index: 0 -------- ```

It is expected that some form of output is avaliable to the users. Otherwise, sensor IDs cannot be used as specified in the Nicla Sense ME cheatsheet:

The IDs to address the sensors both through ESLOV and WebBLE are as follows:

Target(s) affected by this defect ?

Nicla Sense ME.

Toolchain(s) (name and version) displaying this defect ?

Uploaded latest firmware and compiled with library commit 40437b6

What version of Mbed-os are you using (tag or sha) ?

4.0.8

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

How is this defect reproduced ?

Running the example sketch provided.

bstbud commented 9 months ago

@aliphys maybe we can fix this by only keeping 116 and 117, while removing they others given that there are no sensor classes defined for them. What do you think?

aliphys commented 9 months ago

Hello @bstbud What sensor class can we use to extract data for sensor IDs 116 (BSEC 2.x raw data collector for AI training) and 117 (BSEC 2.x gas classifier output)? Using SensorBSEC2Collector and SensorBSEC2 did not provide and output for me. Maybe I it is another class?

SensorBSEC Class

Checking 116
                Sample n0 BSEC output values - iaq: 0   iaq_s: 0   b_voc_eq: 0.00   co2_eq: 0   accuracy: 0   comp_t: 0.00   comp_h: 0.00   comp_g: 0

                Sample n1 BSEC output values - iaq: 0   iaq_s: 0   b_voc_eq: 0.00   co2_eq: 0   accuracy: 0   comp_t: 0.00   comp_h: 0.00   comp_g: 0

                Sample n2 BSEC output values - iaq: 0   iaq_s: 0   b_voc_eq: 0.00   co2_eq: 0   accuracy: 0   comp_t: 0.00   comp_h: 0.00   comp_g: 0

        Checking 117
                Sample n0 BSEC output values - iaq: 0   iaq_s: 0   b_voc_eq: 0.00   co2_eq: 0   accuracy: 0   comp_t: 0.00   comp_h: 0.00   comp_g: 0

                Sample n1 BSEC output values - iaq: 0   iaq_s: 0   b_voc_eq: 0.00   co2_eq: 0   accuracy: 0   comp_t: 0.00   comp_h: 0.00   comp_g: 0

                Sample n2 BSEC output values - iaq: 0   iaq_s: 0   b_voc_eq: 0.00   co2_eq: 0   accuracy: 0   comp_t: 0.00   comp_h: 0.00   comp_g: 0

SensorBSEC2 Class


Checking 116
                Sample n0 BSEC2 output values (%) - gas[0]: 0   gas[1]: 0   gas[2]: 0   gas[3]: 0   accuracy: 0

                Sample n1 BSEC2 output values (%) - gas[0]: 0   gas[1]: 0   gas[2]: 0   gas[3]: 0   accuracy: 0

                Sample n2 BSEC2 output values (%) - gas[0]: 0   gas[1]: 0   gas[2]: 0   gas[3]: 0   accuracy: 0

        Checking 117
                Sample n0 BSEC2 output values (%) - gas[0]: 0   gas[1]: 0   gas[2]: 0   gas[3]: 0   accuracy: 0

                Sample n1 BSEC2 output values (%) - gas[0]: 0   gas[1]: 0   gas[2]: 0   gas[3]: 0   accuracy: 0

                Sample n2 BSEC2 output values (%) - gas[0]: 0   gas[1]: 0   gas[2]: 0   gas[3]: 0   accuracy: 0

SensorBSEC2Collector Class

Checking 116
                Sample n0 timestamp: 00   temp: 0.00   pressure: 0.00   hum: 0.00   gas: 0.00   gas_index: 0

                Sample n1 timestamp: 00   temp: 0.00   pressure: 0.00   hum: 0.00   gas: 0.00   gas_index: 0

                Sample n2 timestamp: 00   temp: 0.00   pressure: 0.00   hum: 0.00   gas: 0.00   gas_index: 0

        Checking 117
                Sample n0 timestamp: 00   temp: 0.00   pressure: 0.00   hum: 0.00   gas: 0.00   gas_index: 0

                Sample n1 timestamp: 00   temp: 0.00   pressure: 0.00   hum: 0.00   gas: 0.00   gas_index: 0

                Sample n2 timestamp: 00   temp: 0.00   pressure: 0.00   hum: 0.00   gas: 0.00   gas_index: 0
bstbud commented 9 months ago

Hi @aliphys Please check BSEC2GasScannerClassify.ino, and https://github.com/arduino/nicla-sense-me-fw/blob/main/Arduino_BHY2/examples/BSEC2GasScannerCollectData/BSEC2GasScannerCollectData.ino on the two sensors.

aliphys commented 9 months ago

So in this case:

In which case, it is not straightforward to expect the user to simply change the class name and pass through the new sensor ID. Is this understanding correct?

bstbud commented 9 months ago

hi @aliphys

So in this case:

  • Additional configuration is required for 116 (SENSOR_ID_BSEC2) and 117 (SENSOR_ID_BSEC2_COLLECTOR) before they can be used.

[zg] additional configuration is not required - i.e., when those additional configuration are not done, you can still get data from both sensors. sensors 116 and 117 are mainly for applications where people desire to be able to detect specific gases of interest, where custom configurations (such as different heater profiles and different BSEC2 conigurations) are needed. The two example sketches are there to demonstrate how such additional configurations can be done.

  • For sensorID 116 and 117 the methods sensortec.bhy2_bsec2_setConfigString() and sensortec.bhy2_bsec2_setHP() methods respectively need to be called in the setup()

[zg] correct

  • CONFIG_BSEC2_USE_DEAULT_HP refers to a variable in the fw.h file

[zg] actually no, CONFIG_BSEC2_USE_DEAULT_HP does not use anything from fw.h

In which case, it is not straightforward to expect the user to simply change the class name and pass through the new sensor ID. Is this understanding correct? [zg] this is explained in the first question

bstbud commented 9 months ago

Hello @bstbud What sensor class can we use to extract data for sensor IDs 116 (BSEC 2.x raw data collector for AI training) and 117 (BSEC 2.x gas classifier output)? Using SensorBSEC2Collector and SensorBSEC2 did not provide and output for me. Maybe I it is another class?

SensorBSEC Class

Checking 116
                Sample n0 BSEC output values - iaq: 0   iaq_s: 0   b_voc_eq: 0.00   co2_eq: 0   accuracy: 0   comp_t: 0.00   comp_h: 0.00   comp_g: 0

                Sample n1 BSEC output values - iaq: 0   iaq_s: 0   b_voc_eq: 0.00   co2_eq: 0   accuracy: 0   comp_t: 0.00   comp_h: 0.00   comp_g: 0

                Sample n2 BSEC output values - iaq: 0   iaq_s: 0   b_voc_eq: 0.00   co2_eq: 0   accuracy: 0   comp_t: 0.00   comp_h: 0.00   comp_g: 0

        Checking 117
                Sample n0 BSEC output values - iaq: 0   iaq_s: 0   b_voc_eq: 0.00   co2_eq: 0   accuracy: 0   comp_t: 0.00   comp_h: 0.00   comp_g: 0

                Sample n1 BSEC output values - iaq: 0   iaq_s: 0   b_voc_eq: 0.00   co2_eq: 0   accuracy: 0   comp_t: 0.00   comp_h: 0.00   comp_g: 0

                Sample n2 BSEC output values - iaq: 0   iaq_s: 0   b_voc_eq: 0.00   co2_eq: 0   accuracy: 0   comp_t: 0.00   comp_h: 0.00   comp_g: 0

SensorBSEC2 Class


Checking 116
                Sample n0 BSEC2 output values (%) - gas[0]: 0   gas[1]: 0   gas[2]: 0   gas[3]: 0   accuracy: 0

                Sample n1 BSEC2 output values (%) - gas[0]: 0   gas[1]: 0   gas[2]: 0   gas[3]: 0   accuracy: 0

                Sample n2 BSEC2 output values (%) - gas[0]: 0   gas[1]: 0   gas[2]: 0   gas[3]: 0   accuracy: 0

        Checking 117
                Sample n0 BSEC2 output values (%) - gas[0]: 0   gas[1]: 0   gas[2]: 0   gas[3]: 0   accuracy: 0

                Sample n1 BSEC2 output values (%) - gas[0]: 0   gas[1]: 0   gas[2]: 0   gas[3]: 0   accuracy: 0

                Sample n2 BSEC2 output values (%) - gas[0]: 0   gas[1]: 0   gas[2]: 0   gas[3]: 0   accuracy: 0

SensorBSEC2Collector Class

Checking 116
                Sample n0 timestamp: 00   temp: 0.00   pressure: 0.00   hum: 0.00   gas: 0.00   gas_index: 0

                Sample n1 timestamp: 00   temp: 0.00   pressure: 0.00   hum: 0.00   gas: 0.00   gas_index: 0

                Sample n2 timestamp: 00   temp: 0.00   pressure: 0.00   hum: 0.00   gas: 0.00   gas_index: 0

        Checking 117
                Sample n0 timestamp: 00   temp: 0.00   pressure: 0.00   hum: 0.00   gas: 0.00   gas_index: 0

                Sample n1 timestamp: 00   temp: 0.00   pressure: 0.00   hum: 0.00   gas: 0.00   gas_index: 0

                Sample n2 timestamp: 00   temp: 0.00   pressure: 0.00   hum: 0.00   gas: 0.00   gas_index: 0

Hi @aliphys sorry, I forgot to reply to this specific question. everything is zero which is not expected. Maybe it's because the BHI260 firmware is out of date. Could you update the firmware via the sketch and recheck this please? Please make sure to use the example sketch from the main branch.