Hello All,
I am working on a project using the Bosch BME688, and the Adafruit ESP32 Huzzah Featherboard (combined together to make the BME688 Development Kit). I am trying to utilize the BSEC2 and BME68x libraries in conjunction with each other to lessen the influence of environmental factors such as humidity, pressure, and temperature, on the recorded gas resistance. I will then use this corrected and smoothened data to train machine learning algorithms to detect the gas resistance. I have written a script that records raw data on the sensor, corrects the data using the BSEC library, and then writes that corrected raw data to a .bmerawdata file. I wrote this script in Arduino IDE, and made sure that the sensor was connected to my MacBook Pro 2017 via USBc - MicroUSB cable. I also made sure that the Adafruit Featherboard was properly connected to the IDE via the USB serial port.
While I noticed no errors while compiling and uploading the code onto the sensor, when I went to test, the debug messages that I included in the code were indicating that the sensor was failing to initialize, and stopping with BSEC warning code 14. I was wondering whether this could be because of three reasons:
1. Is there different procedure for using the libraries, or maybe sensors, with different operating systems? Could it be failing because of improper syntax for my operating system (Intel Chip MacOS)?
2. Is the power supply to the sensor not sufficient? As I mentioned before, I am running a USBc - MicroUSB cable from my Mac to the sensor, and so I was wondering whether that could be the issue? Should I try connecting to a wall outlet instead?
3. Could it be because of the configuration file that I have uploaded? Since I am using an SD card inside the sensor to write the corrected data onto, I thought that I would need to have a configuration file on there as well. I was not sure what configuration file to use, and where to get it from. So, I went the BSEC 2 library, SRC, config, bme688, then reg_18v_300s_4d. From that folder, I copied the bsec_selectivity.config file, and then I pasted that into the SD card. I wanted to try to debug if this could be the issue, and so I uploaded a .bmeconfig file that was generated in BME Ai Studio, and already proven to work through their firmware. But, that didn't work either.
Another thing that I tried to implement to debug was using bluetooth to connect the sensor to the computer. I did this to check whether the power supply could be the issue. But, for the program to run, I need to give the sensor an input of "run" in the serial monitor. But, through wireless connection, this would not be possible except through bluetooth. I tried to implement bluetooth in, but when I tried that, I was not getting any output from the program in the Arduino Serial Monitor. I thought that this could be because Arduino Serial Monitor could not communicate with bluetooth, and so I downloaded a 3rd party serial monitor called CoolTerm. But, even there, I was not able to provide any input to the serial monitor. When I typed in "run", and pressed enter, I got no output, showing that mostly likely, the input did not go through.
So, what could be causing the issue of the sensor not initializing (it fails on the first sensor). Could it be because of any of the issues I highlighted, a typo in the code, or because of maybe the file structure or improper downloading of the libraries I included? Please let me know what you all think, and I would be happy to provide more information. Linked below is the initialization code that I am using currently (without bluetooth integrated).
This is the output that I get when I run that code (this output is provided in Arduino IDE Serial Monitor):
20:12:46.504 -> Starting program...
20:12:46.700 -> Initializing sensor 0...
20:12:46.734 -> BSEC warning code: 14
20:12:46.734 -> Subscription failed for sensor 0
If the bluetooth is the solution and the power supply is the problem, then I can provide that code as well, and we can work through how to make that functionality work. Thank you very much for taking the time to read this and providing advice on this issue. Again, I am happy to provide more information about the specifics of my project, code, libraries used, etc.
Thanks,
SM