Describe the bug
I tried to experiment with the BME680 device binding but unfortunately the data which is read is not accurate.
Steps to reproduce
Code:
internal async Task TakeMeasurement()
{
if (_sensorState != SensorState.Initialized)
{
_logger.LogWarning($"{DateTimeOffset.Now}:BME680: Attempting to take measurement while sensor is not initialized!");
_measurement.SetMeasurement(Temperature.FromCelsius(-1), -1, -1);
return;
}
/* Force the sensor to take a measurement. */
_bme680.SetPowerMode(Bme680PowerMode.Forced);
var temperature = await _bme680.ReadTemperatureAsync();
var pressure = await _bme680.ReadPressureAsync();
var humidity = await _bme680.ReadHumidityAsync();
_measurement.SetMeasurement(temperature, pressure, humidity);
_logger.LogInformation($"{DateTimeOffset.Now}:BME680: reading");
_logger.LogInformation(
$"{temperature.Celsius:N2} \u00B0C | {pressure} hPa | {humidity:N2} %rH");
}
Expected behavior
I'd expect accurate data when trying to read from the sensor.
Actual behavior
The readings I get are wrong. The temp should be around 25 C

Versions used
Add following information:
Raspberry Pi 2015 armv7 running Raspbian Buster with desktop
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<UserSecretsId>dotnet-NucuCar.BME680Sensor-28FAAD8B-A31F-4BBE-9FF7-30F192D82D6E</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Iot.Device.Bindings" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.0.0" />
<PackageReference Include="System.Device.Gpio" Version="1.0.0" />
</ItemGroup>
I forgot to set the sampling.
bme680.SetHumiditySampling(Sampling.UltraLowPower);
bme680.SetTemperatureSampling(Sampling.LowPower);
bme680.SetPressureSampling(Sampling.UltraHighResolution);
It works now.
Most helpful comment
I forgot to set the sampling.
It works now.