I have a question, maybe someone has some advice for me.
I am working on my home automation system with a Raspberry Pi3 and Windows 10 IOT Core.
As UI I use a UWP app on which I want to display the temperature & humidity.
private async void GetHumidity()
{
try
{
var humidity = await bme280Sensor.ReadHumidity();
txtHumidity.Text = double.Parse(humidity.ToString().Split('.')[0]).ToString() + "%";
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
Debug.WriteLine(ex.StackTrace);
}
}
private async void GetTemp()
{
try
{
var temp = await bme280Sensor.ReadTemperature();
txtTemp.Text = double.Parse(temp.ToString().Split('.')[0]).ToString() + "°C";
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
Debug.WriteLine(ex.StackTrace);
}
}
This works fine, but if I take the Pi from power (plug pull) and then restart, the humidity is twice or more higher.
When I then restart my UWP app via the IOT Device Manager in the browser, the correct values are displayed again.