-
Notifications
You must be signed in to change notification settings - Fork 105
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
Unique fingerprint BME280 #98
Comments
Fell free to make a change and submit and pull request! I am not sure this is functionality the library should support, but, it never hurts to have it out there.
Thanks!
… On Oct 28, 2018, at 12:56 PM, Bollie ***@***.***> wrote:
Expected behavior
I would like to fingerprint each BME280 using the hash of the individual trimming parameters. I need a function that returns a copy of uint8_t m_dig[32].
Actual behavior
Individual trimming parameter are not public.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Took right a shot: Changes The receiving array has to be supplied by reference. The function returns the reference to this array (so not void, see below an example). Please comment, I am not proud on the long function name, but thought it should be descriptive. Example use: uint8_t parameters[32];
CRC32 crc;
uint32_t checksum = CRC32::calculate(bme.compensationParameters(parameters), 32);
Serial.printf("SensorID: 0x%08X\nHash(CRC32) of ", checksum);
for (int i=0; i<32; i++) Serial.printf("%02X ", parameters[i]);
Serial.print("\n"); Output: SensorID: 0x27F4DEF5
Hash(CRC32) of CF 6C AF 65 32 00 54 91 5F D6 D0 0B 66 1D BC FF F9 FF 0C 30 20 D1 88 13 4B 47 01 00 1A 20 03 1E |
Little bump as your first reaction was so quick. |
I believe that the simplest way is to add this in the library. |
in the past i discovered this and it really works as suggested by Bosch. This is how you read the unique ID in any BME sensor. Edit: I added example screen for two BME280 sensors. uid_regs0[0] = BME0.readRegister(0x83); |
Fantastic. Let’s have this implemented ! |
Implementation: https://github.com/Bolukan/BME280/ |
Example show an error here (IDE 1.8.10 and AVR core 1.8.2) this compile but not tested
|
You are right: printf is not available for all Arduino family members. I will use your code to adapt the example. Thanks for testing! |
I thought it was ESP8266 code, that's the reason I specified the AVR core. |
Example updated (Btw, 19 would be too small) |
Has a pull request been created for this? |
Expected behavior
I would like to fingerprint each BME280 using the hash of the individual trimming parameters. I need a function that returns a copy of uint8_t m_dig[32].
Actual behavior
Individual trimming parameters are not public.
The text was updated successfully, but these errors were encountered: