Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPU temp occasionally report a very wrong value #808

Open
ctacke opened this issue Jan 8, 2025 · 1 comment
Open

CPU temp occasionally report a very wrong value #808

ctacke opened this issue Jan 8, 2025 · 1 comment
Assignees
Labels

Comments

@ctacke
Copy link
Contributor

ctacke commented Jan 8, 2025

Reading the F7 CPU temp occasionally gives a very high/low temp. We should sanity check this in the managed code if the native code is giving us invalid data.

image

@ctacke ctacke self-assigned this Jan 8, 2025
@doingnz
Copy link

doingnz commented Jan 10, 2025

I have added the following sanity check in HealthRepoter.cs. Is there a "NaN" value that would be better inplace of hard limits?

    private (string name, Func<object?> function)[] DefaultMetrics =
    {
        new ("health.cpu_temp_celsius", () =>
        {
            var temp = Resolver.Device.PlatformOS.GetCpuTemperature().Celsius;
            return temp < -10 ? -10 : temp > 85 ? 85 : temp;
        }),
        new ("health.memory_used", () => GC.GetTotalMemory(false)),
        new ("health.disk_space_used", () => Resolver.Device.PlatformOS.GetPrimaryDiskSpaceInUse().Bytes),
        new ("info.os_version", () => Resolver.Device.Information.OSVersion),
        new ("up_time", () => Resolver.Services.Get<IReliabilityService>()?.UpTime ?? null),
    };
    ```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants