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

Feature/self tests #40

Merged
merged 7 commits into from
Aug 19, 2020
Merged

Feature/self tests #40

merged 7 commits into from
Aug 19, 2020

Conversation

ryan-summers
Copy link
Member

@ryan-summers ryan-summers commented Aug 19, 2020

This PR adds in a number of self-tests to booster's I2C devices that run at startup.

Tests include:

  • Check fan RPM at 100%, 10%, and 0% duty cycle
  • Verify alarm threshold levels are not exceeded
  • Configure alarm limits before channels enumerate
  • Test functionality of the I2C mux when selecting channels
  • read the EUI-48 identifier.

@jordens The downside of testing fan RPMs on boot is that we need a pretty significant settling time on the fans, which results in a longer boot time. We could likely simplify the fan tests to speed it up if desired.

This closes #38

Copy link
Member

@jordens jordens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

// If 5 fans (the count mounted on the chassis) spun up to a nominal high speed RPM, 5-6
// fans were at a nominal low RPM, and 6 fans were not spinning when powered down, fans are
// operating nominally.
(fans_spun_high == 5) && (fans_spun_low >= 6) && (fans_powered_down == 6)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading the comment:

Suggested change
(fans_spun_high == 5) && (fans_spun_low >= 6) && (fans_powered_down == 6)
(fans_spun_high == 5) && (fans_spun_low >= 5) && (fans_powered_down == 6)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated it such that low spinup requires a non-zero RPM and have slightly reworked this logic.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO verifying that the 1.0 duty cycle having high RPM and then going back to 0.1 duty (and later with feedback) would be enough.

let fans_powered_down =
dead_rpms
.iter()
.fold(0, |count, rpms| if *rpms == 0 { count + 1 } else { count });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that just:

Suggested change
.fold(0, |count, rpms| if *rpms == 0 { count + 1 } else { count });
.filter(|rpms| *rpms == 0).count();

For the two others below as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I knew there had to be a better way. Thanks for pointing to filter(). I'm still getting used to rust iterators.

tca9548/src/lib.rs Show resolved Hide resolved
@ryan-summers ryan-summers requested a review from jordens August 19, 2020 15:29
@jordens
Copy link
Member

jordens commented Aug 19, 2020

Agreed on the boot delay. If this becomes annoying during development just bypass it for now.

@ryan-summers ryan-summers merged commit 28ab885 into develop Aug 19, 2020
@ryan-summers ryan-summers deleted the feature/self-tests branch August 19, 2020 17:48
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.

Implement power-up self-test for I2C devices
2 participants