ANU-Rocketry / control-panel

Control panel for ANU Rocketry's liquid rocket engine testing platform
3 stars 0 forks source link

Better UPS status #3

Closed OliverBalfour closed 1 year ago

OliverBalfour commented 2 years ago

We've got a universal power supply (UPS) that our RPi etc plugs into so that if the generator power cuts, we can still run on battery long enough to solve the problem.

We have an indicator on the frontend to warn operators when it's running on battery charge and might cut out soon. At the moment it just prints a Python enum and looks like this:

image

What we really want is

This isn't a rigid set of requirements, but any solution to this ticket should make status changes more obvious

The snackbar when power is lost should probably warn the operator to depressurise the system safely before the UPS battery runs out

Glubs9 commented 2 years ago

Do you have a mechanism already set up for testing different UPS statuses? like something on the dev server?

OliverBalfour commented 2 years ago

Ohh, good point! We don't have this, no!

So there's a command we use, apcaccess status, and we grep the output for the right string. This means if you plug your computer into a UPS with a USB-B cable it'll work (ie take the UPS and USB A to B cables from the green box in Ian Ross, plug USB A into your laptop, USB B into the side of the UPS, plug UPS into the wall, don't bother powering anything with the UPS power points), so you might have to test this on campus and find a way into that room. I'm happy to help with this when I'm out of isolation.

You could also do some preliminary work by temporarily hardcoding src/server.py to return something of your choosing in get_UPS_status.

Glubs9 commented 2 years ago

when do you get out of isolation?

OliverBalfour commented 2 years ago

Thursday

Glubs9 commented 2 years ago

do you mind if I use this library for snackbars? https://mui.com/material-ui/react-snackbar/ It looks fairly good

if not, it doesn't seem that hard to make custom

OliverBalfour commented 2 years ago

yep that's okay