Skip to content

Conversation

@andrmuel
Copy link
Contributor

Fixes #<GitHub-issue-number>.

Make sure all boxes are checked (add x inside the brackets) when you submit your contribution, remove this sentence before doing so.

  • This PR is for the dev branch rather than for master.
  • This PR is compliant with the other contributing guidelines as well (if not, please describe why).
  • [~] I have thoroughly tested my contribution.
    ⇒ I only tested it on master; current dev fails for me
  • [n/a] The code changes are reflected in the documentation at docs/*.

<Description of and rationale behind this PR>

the data type for t (U_T) should be long according to the BMP085
datasheet (rev. 1.2, section 3.5). values over 32767 can indeed occur,
and in my case lead to a wrong value for the temperature (and
consequently also pressure).

note: this problem only occurs above a certain temperature (exact
value depends on the calibration, but I assume somewhere around 26°C).
this adapts the data types and calculation to be consistent with the
datasheet (rev. 1.2, section 3.5). while I did not notice any issues,
using the wrong data types could trigger edge cases.
@nwf nwf changed the title Dev Correct integer types in BMP085 driver Apr 19, 2020
@nwf
Copy link
Member

nwf commented Apr 19, 2020

These seem sensible enough to me, but I do not have one of these devices to test. Any of the active maintainers have one?

@andrmuel Can you elaborate on why dev isn't working for you?

@andrmuel
Copy link
Contributor Author

I was able to build the firmware on dev and flash it, but afterwards I was not able to flash any Lua code for testing.

In regards to testing with the BMP085: if you want to reproduce the original problem as well, that might be possible with heating it up to 30-40 deg C.

@HHHartmann
Copy link
Member

That's probably due to bug #2963. It is fixed in #2912.
It was IIRC introduced with #2836. So you could rebase your branch to a commit before that and retry.

@andrmuel
Copy link
Contributor Author

I'm not sure I understand correctly. The commit you are referring to is 14c1b8f (from Sep. 2019)? The commit before that would be c7ff86f, and that is already part of master. It does work on the current master. What would be the benefit of testing it with an older version of master (which contains less of dev)?

@HHHartmann
Copy link
Member

The changes in this PR are very local, so that I would not expect any of the changes in dev to influence the outcome of the test.
But I think there was another upload to mentioned somewhere which still works on current dev.
Another alternative would be to flash the entire SPIFFS partition containing all the files you need.

@nwf nwf merged commit e47c267 into nodemcu:dev Apr 24, 2020
@nwf
Copy link
Member

nwf commented Apr 24, 2020

Given the highly localized nature of this change, as @HHHartmann says, I've just merged it to dev.

@marcelstoer marcelstoer added this to the Next release milestone Apr 25, 2020
marcelstoer pushed a commit that referenced this pull request Jun 9, 2020
* BMP085 pressure sensor: fix temperature value data type

the data type for t (U_T) should be long according to the BMP085
datasheet (rev. 1.2, section 3.5). values over 32767 can indeed occur,
and in my case lead to a wrong value for the temperature (and
consequently also pressure).

note: this problem only occurs above a certain temperature (exact
value depends on the calibration, but I assume somewhere around 26°C).

* BMP085 pressure sensor: adapt data types and calculation

this adapts the data types and calculation to be consistent with the
datasheet (rev. 1.2, section 3.5). while I did not notice any issues,
using the wrong data types could trigger edge cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants