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

write a huntsman.pocs.utils.nps module for toggling plug power via the nps #593

Open
3 tasks
fergusL opened this issue Mar 22, 2023 · 0 comments
Open
3 tasks
Labels
enhancement observatory safety Relates to the safety of personnel or hardware state machine

Comments

@fergusL
Copy link
Contributor

fergusL commented Mar 22, 2023

We need a utils module that will allow pocs to control power to devices via the nps. This module will contain an nps class and an enum class that maps the various nps power plug numbers to the name of the device eg plug B3 maps to Jetson DC power and perhaps another for plug state. The nps class can then be used to toggle a plug state to be on, off or boot (reboot the plug):

pocs.nps(plug.jetson, status.off)

The nps class should also have a method for retrieving nps status, including "alarms" such as the "LOST VOLTAGE (LINE INPUT)" alarm which indicates if mains power has been lost and that the unit is running on the UPS.

An example of a python script utilising the WTI RESTful api to reboot a plug is given here . The documentation for the WTI RESTful api can be found here.

Once this nps class has been implemented, it should be used to power on the jetsons once the start up horizon is reached (see here) and to turn off the jetson power in the morning after flats (see here).

An additional corner case to consider is the scenario where pocs is started when it is already dark. In that case another clause that checks the jetson plug status, toggles it on if it is off and waits for the jetson camera servers to be ready would be required.

A summarised form of the nps status should also be recorded in the pocs logs (incorporated into the safety check?). This is will allow the observatory to shut itself down if mains power is lost. It also will allow the slack alert script to notify us on slack if mains power is lost (see #557)

  • Create huntsman.pocs.utils.nps module containing an nps class that will allow us to toggle plug status (on/off/boot) and query the nps for status
  • use this nps object to power jetsons on or off in the relevant huntsman states
  • incorporate nps status in huntsman pocs safety checks and set pocs to shutdown observatory if mains power is lost
@fergusL fergusL added enhancement safety Relates to the safety of personnel or hardware state machine observatory labels Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement observatory safety Relates to the safety of personnel or hardware state machine
Projects
None yet
Development

No branches or pull requests

1 participant