Skip to content

Conversation

@tiberiusteng
Copy link

@tiberiusteng tiberiusteng commented Jul 15, 2024

si7021_env::humidityBasisPoints is unsigned int, but SI7021::getHumidityBasisPoints is returning a value ranged from -600 ... 11900 inclusive, where negative values will underflow to 64936 ... 65535.

struct Payload::humidity is signed integer and we don't want to modify si7021 library, so we just cast it as signed integer when doing conversion.

Here's one of my emonTH presenting this behavior; my location is constantly very humid so I suspect it has been driven into an extreme state. I'm going to play with built-in heater of si7021 to see if I can make it properly report humidity again.

firefox_znR4vX1xLV

`si7021_env::humidityBasisPoints` is `unsigned int`, but `SI7021::getHumidityBasisPoints` is returning a value ranged from -600 ... 11900 inclusive, where negative values will underflow to 64936 ... 65535.

`struct Payload::humidity` is signed integer and we don't want to modify si7021 library, so we just pad the value when doing conversion, where calculation is done in (signed) floating point.
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