-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error while running sample code.. #22
Comments
Which version of BSEC are you using and which version of bme68x-python-library? The current BSEC 2 is 2.4.0.0 and you will find a version of bme68x-python-library that work with this release The bmerawdata.py example does not record in a format compatible with the current release of BME AI Studio. The 8 sensor BOSCH Sensortec dev board is a better bet for recording data than a single sensor. I have some notes and data here:. Keith |
The 8 sensor dev board is used to collect data, that data is loaded off the sd-card into BME AI studio, and a model is generated. In my example here the folder 8x-test.bmeproject is the project folder from my BME AI Studio it has the data collected and BME AI studio should be able to load the project using this data and generate a model config. The model I generated is in the main folder 2023_05_06_15_00_Air-Ethanol_HP-354_RDC-5-10.config along with the python file sniff.py. The python code sniff.py loads the config in this line:
I have assumed that the config file is in the same folder as sniff.py and build a path based on the location of the running python file
So you will need to change the name of config_file to your generated config and if you want to put the file somewhere else you will need to change the config_path. My sniff.py code will output Air and Ethanol results as that was what the model trained for, however your model is coffee so you may want to change the labels in the code
There can be up to 4 subscriptions so "gas_estimate_1" to "gas_estimate_4", but you will know how many your model trained on and therefore need to be subscribed. If this changes from 2 then you need to alter the sniff.py subscriptions here.
In your ls listing above I see coffe.zip, and that is a bit confusing - is coffee.zip the config file output by BME AI Studio or the whole project folder? All you need to transfer to the PI is sniff.py and the "<...> .config file" - in my project that is 2023_05_06_15_00_Air-Ethanol_HP-354_RDC-5-10.config. Try to run through my example by loading the project into BME AI studio and following from Step 4 in the ReadMe. If you do not have hand sanitiser try a few drops of perfume on a tissue (uses ethanol as a base that evaporates). |
@mcalisterkm - Thanks Keith. You saved me at least a couple of days of research time. Thank you so much. I checked with your config file and it's working well. Now I may be being lazy and leaning a bit (hope not) - but is there a ready code that gives gas inference as well as the temperature and humidity reading? |
What do you mean by gas inference? I have an example of how to collect data, produce a model and run the model on a single bme688 sensor/Pi here:. PI3G have a video on youtube - the meat & cheese demo. And Bosh have software and docs here Oops - BSEC does give an estimated CO2 ppm value, which is calculated. But the principle remains you need to train on the gas you wish to detect. |
Hi Everyone,
while running the sample code (python3 forced_mode.py ) I am getting the following error:
TESTING FORCED MODE WITHOUT BSEC
INITIALIZED BME68X
VARIANT = BME688
SET BME68X CONFIG
SET HEATER CONFIG (FORCED MODE)
SET HEATER CONFIG (FORCED MODE)
{'sample_nr': 1, 'timestamp': 312986, 'temperature': 23.257213592529297, 'pressure': 100083.6015625, 'humidity': 82.25715637207031, 'gas_resistance': 9402.5849609375, 'status': 160}
TESTING FORCED MODE WITH BSEC
INITIALIZED BME68X
VARIANT = BME688
SET BME68X CONFIG
SET HEATER CONFIG (FORCED MODE)
Traceback (most recent call last):
File "forced_mode.py", line 18, in
bme.set_sample_rate(bsec.BSEC_SAMPLE_RATE_LP)
AttributeError: 'bme68x.BME68X' object has no attribute 'set_sample_rate'
and when i try to run :
~/bme68x-python-library/tools/bmerawdata $ python3 bmerawdata.py
i get the following error :
INITIALIZED BME68X
VARIANT = BME688
SET BME68X CONFIG
SET HEATER CONFIG (FORCED MODE)
HEATR CONF IN SET AI CONF
[5, 2, 10, 30, 5, 5, 5, 5, 5, 5]
320 100 100 100 200 200 200 320 320 320
5 2 10 30 5 5 5 5 5 5
SET HEATER CONFIG (PARALLEL MODE)
Traceback (most recent call last):
File "bmerawdata.py", line 178, in
bme68x_ai = BME68X_AI(BME68XCONST.BME68X_I2C_ADDR_HIGH, ai_conf)
File "bmerawdata.py", line 67, in init
self.sensor_id = self.get_sensor_id()
AttributeError: 'BME68X_AI' object has no attribute 'get_sensor_id'
any idea what could be wrong?
The text was updated successfully, but these errors were encountered: