rm-hull / bme280

Raspberry PI schematics & python module to drive a Bosch BME280 digital sensor module
https://bme280.readthedocs.io/en/latest/
MIT License
99 stars 36 forks source link

Id is not the Chip-ID #20

Open bluepup opened 3 years ago

bluepup commented 3 years ago

Please note in the documentation, that the ID is not the chip-id.

From the sample I was assuming that the id was the chip-ID, using it as a key in my database. In fact it is a UUID that changes with every read of a sample.

I know that it was my assumption that was flawed, no real error in the code. But the bme280 has a id that you can read via i2c (not implemented) which mislead me.

rm-hull commented 3 years ago

yes, the id is a sample ID. I did not know that the BME280 has a device id - that would be a useful addition

bluepup commented 3 years ago

the chip-ID is not a serial number, it is merely a hint to the type of chip.

The datasheet says:

but useful anyways.

tkotz8105 commented 2 years ago

I just started using this repo for reading BME280 data. Thanks for making it available. I chose this repo due to it looked like there was a unique id for each BME280. As mentioned by @bluepup who was also looking for a unique id but the uuid is created randomly on each read. So in doing some Googling there is an undocumented id for the sensors in registers offset 0x83 through 0x86. Here's the link I found: [https://community.bosch-sensortec.com/t5/MEMS-sensors-forum/Unique-IDs-in-Bosch-Sensors/td-p/6012. The article includes the formula for getting the id. I wrote it in python but included the code in my main program... I'm still testing it. I will submit a pull request with the code added to your code so that it will be an object included with temperature, pressure, RHG, etc. Hopefully, this will be used by others.