Skip to content

fix(bme680): fixed bme680 loss of precision int math error in pressure and altitude measurements#2149

Open
NickDunklee wants to merge 1 commit intomeshcore-dev:devfrom
NickDunklee:fix-bme680-pressure-altitude
Open

fix(bme680): fixed bme680 loss of precision int math error in pressure and altitude measurements#2149
NickDunklee wants to merge 1 commit intomeshcore-dev:devfrom
NickDunklee:fix-bme680-pressure-altitude

Conversation

@NickDunklee
Copy link

BME680.pressure / 100 was integer division before being passed onward resulting in loss of sensor resoluiton for both altitude and pressure changes.

  • Changed to float math to fix the value only moving in 1hPa steps
  • Pressure/altitude should no longer appear "stuck" waiting to jump the next 1hPa change
  • Tested on RAK19003+BME680

It looks like BME280, BMP280, etc. should not be affected as their readPressure() is a float. BMP085 may have a similar problem, but I do not have one to test with.

@NickDunklee NickDunklee force-pushed the fix-bme680-pressure-altitude branch 2 times, most recently from b5feb58 to 1c14441 Compare March 24, 2026 21:36
…asurements

BME680.pressure / 100 was integer division before being passed onward resulting
in loss of sensor resoluiton for both altitude and pressure changes.

- Changed to float math to fix the value only moving in 1hPa steps
- Pressure/altitude should no longer appear "stuck" waiting to jump
  the next 1hPa change
- Tested on RAK19003+BME680

It looks like BME280, BMP280, etc. should not be affected as their
readPressure() is a float. BMP085 may have a similar problem, but
I do not have one to test with.
@NickDunklee NickDunklee force-pushed the fix-bme680-pressure-altitude branch from 1c14441 to 96f8786 Compare March 24, 2026 21:49
@NickDunklee
Copy link
Author

NickDunklee commented Mar 25, 2026

Screenshot 2026-03-24 at 20 38 37

Left side of graph was before change, right side after. Updated this comment with a better graph.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant