-
Notifications
You must be signed in to change notification settings - Fork 41
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
Update for BME688 #43
Conversation
Should we rename this bme68x to make it clear that it supports more than one SKU? Another option would be to make a separate 688 library that subclasses the 680 class. I like having separate libraries generally because it makes it very clear what is supported by any given driver. |
My 2¢ from the user side would be separate libraries. It’s clearer when coding, and probably saves a tiny bit of space when deployed. |
Just to be clear "separate library" = separate repo? |
separate repo is ok, but i think best to subclass rather than copy & paste it all over and make the small changes |
Agree. The code diff for this PR is essentially all that is specific to the BME688. The majority of the code is the same. How about renaming repo to BME68X and refactoring things into separate files for BME680 and BME688? Something like?
Might be easier to keep code in one repo? |
Yes, that is my preference generally.
I think you are right that this is clearer as one repo. It'll be easier to grab all of the necessary files because they are all here. Switching to a package will be a breaking change though. |
What are the non-breaking options? |
The only one I can think of is creating a second repo with a 688 class that subclasses the 680 one. |
So I think we either break things or make the two repos and run into issues later trying to keep the code between them synced? Guess could make a new BMP688 repo be dependent on this (BMP680) repo? But seems like an odd way to setup things in terms of class inheritance. Are there any objections to breaking things? |
Just tested this and confirm I'm getting lower (3-4Kohm) gas readings, and more importantly changing up and down.I did note that reading the gas every second produced a continuously increasing resistance reading; sleeping the loop for 10sec produced a much more stable value. A lot to learn about this sensor. Test environment was a Funhouse running v6. |
Thank you for the work on this! I did confirm it works just fine with the patch. Is there anything needed here for the merge? It would be nice to not require a manual patch. I also like the rename to bme68x.
|
I think we're just waiting for decision on possible renaming and layout. |
This update has resolved my issue with bme688 i2c gas readings as well. Thank you! |
Merging this as is. Can refactor later if desired and use conversation here as a starting point. |
Updating https://github.com/adafruit/Adafruit_CircuitPython_BME680 to 3.4.0 from 3.3.4: > Merge pull request adafruit/Adafruit_CircuitPython_BME680#43 from caternuson/bme688_update > update rtd py version Updating https://github.com/adafruit/Adafruit_CircuitPython_CharLCD to 3.3.12 from 3.3.11: > Merge pull request adafruit/Adafruit_CircuitPython_CharLCD#70 from dhalbert/make-package > update rtd py version Updating https://github.com/adafruit/Adafruit_CircuitPython_DS3231 to 2.4.10 from 2.4.9: > Merge pull request adafruit/Adafruit_CircuitPython_DS3231#39 from tekktrik/docfix/correct-example-wday-num > update rtd py version Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP_ATcontrol to 0.6.1 from 0.6.0: > Merge pull request adafruit/Adafruit_CircuitPython_ESP_ATcontrol#51 from dhalbert/make-package > Merge pull request adafruit/Adafruit_CircuitPython_ESP_ATcontrol#50 from mperino/main > update rtd py version Updating https://github.com/adafruit/Adafruit_CircuitPython_FRAM to 1.3.10 from 1.3.9: > Merge pull request adafruit/Adafruit_CircuitPython_FRAM#28 from tekktrik/fix/slice-notation > update rtd py version Updating https://github.com/adafruit/Adafruit_CircuitPython_OV5640 to 1.0.3 from 1.0.2: > Merge pull request adafruit/Adafruit_CircuitPython_OV5640#10 from adafruit/stop-motion-example > update rtd py version Updating https://github.com/adafruit/Adafruit_CircuitPython_RFM69 to 2.1.6 from 2.1.5: > Merge pull request adafruit/Adafruit_CircuitPython_RFM69#41 from jerryneedell/jerryn_ticks > update rtd py version Updating https://github.com/adafruit/Adafruit_CircuitPython_RFM9x to 2.2.2 from 2.2.1: > Merge pull request adafruit/Adafruit_CircuitPython_RFM9x#68 from jerryneedell/jerryn_ticks > update rtd py version Updating https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO to 5.6.0 from 5.5.1: > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#81 from kattni/create-and-get-feed > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#77 from aerialist/main > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#80 from dhalbert/make-examples-packages > update rtd py version Updating https://github.com/adafruit/Adafruit_CircuitPython_asyncio to 0.5.1 from 0.5.0: > fix exception printing Updating https://github.com/adafruit/Adafruit_CircuitPython_binascii to 1.2.7 from 1.2.6: > Merge pull request adafruit/Adafruit_CircuitPython_binascii#13 from tekktrik/feature/add-typing > update rtd py version Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout to 1.15.0 from 1.14.0: > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_Layout#58 from FoamyGuy/cell_anchor_point Updating https://github.com/adafruit/Adafruit_CircuitPython_FunHouse to 2.1.8 from 2.1.7: > Merge pull request adafruit/Adafruit_CircuitPython_FunHouse#21 from RufusVS/tone_frequency_0_fix > update rtd py version Updating https://github.com/adafruit/Adafruit_CircuitPython_Gizmo to 1.3.6 from 1.3.5: > Merge pull request adafruit/Adafruit_CircuitPython_Gizmo#17 from caternuson/iss22 > update rtd py version Updating https://github.com/adafruit/Adafruit_CircuitPython_MagTag to 2.1.3 from 2.1.2: > Merge pull request adafruit/Adafruit_CircuitPython_MagTag#74 from dhalbert/make-package > update rtd py version Updating https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal to 3.0.3 from 3.0.2: > Merge pull request adafruit/Adafruit_CircuitPython_MatrixPortal#81 from dhalbert/make-package > update rtd py version
For #42.
This at least allows getting a gas resistance value that varies with the BME688. There are a few key things that are not covered in the datasheet. Getting this working required looking through Bosch's driver here:
https://github.com/BoschSensortec/BME68x-Sensor-API
The BME680 is a "low" variant while the BME688 is a "high" variant. Key differences for the BME688/high variant:
run_gas
is actually bit 5 ofCTRL_GAS_1
(0x70) register. (see here)gas_r_msb/lsb
are at 0x2C/0x2D, up two bytes from BME680. (this is in datasheet)Tested with BME688 attached: