Results Database Server

A subforum dedicated to topics around the NAS.
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Results Database Server

Post by hamishmb »

Looks good. I'll get on with implementing it shortly. I've realised there's one question I've forgotten to ask:

Looking at the control tables for each pi/site, what site-wide requests do we want? The only one I put in the spec was "Reboot", but I was thinking we might also want "Manual", "Shutdown" and "Update" (which could download a software update file from a pre-defined location on the NAS box).

Thoughts?
Hamish
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Results Database Server

Post by TerryJC »

hamishmb wrote: 07/05/2020, 12:12Looking at the control tables for each pi/site, what site-wide requests do we want? The only one I put in the spec was "Reboot", but I was thinking we might also want "Manual", "Shutdown" and "Update" (which could download a software update file from a pre-defined location on the NAS box).
I definitely think we want 'Shutdown' and 'Update'. The former to make it easy to get the Pis to a state where we can safely remove the power and the latter so we don't have to go around logging into each Pi with SSH to copy the updated files across one at a time.

However, I'm not sure what you mean by 'Manual'.
Terry
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Results Database Server

Post by hamishmb »

"Manual" would be so the staff can assume control of the Pi and tell it to ignore requests from other Pis - eg to not start a pump even if a control table says so, unless the staff GUI is requesting it.
Hamish
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Results Database Server

Post by TerryJC »

hamishmb wrote: 07/05/2020, 12:32 "Manual" would be so the staff can assume control of the Pi and tell it to ignore requests from other Pis - eg to not start a pump even if a control table says so, unless the staff GUI is requesting it.
So 'Manual' wouldn't be site-wide; it would be on a per device basis? Or would you see it as making every device manual while the Staff member did what he needed to do?
Terry
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Results Database Server

Post by hamishmb »

On a per-device basis, but yes, we could just make every device manual practically speaking. If just one device was behaving oddly, making it more granular might help us control the issue though.

Argh, I've just noticed a problem. In our control tables we're just using the site ID (eg SUMP, G4) for these requests, but for gate valves the site ID is the same as the device ID (eg V4:V4)...

How about we just use the string "COMPUTER" for this instead? Was going to suggest "RASPI", but we might reboot the NAS box this way too.
Hamish
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Results Database Server

Post by TerryJC »

hamishmb wrote: 07/05/2020, 12:56 On a per-device basis, but yes, we could just make every device manual practically speaking. If just one device was behaving oddly, making it more granular might help us control the issue though.

Argh, I've just noticed a problem. In our control tables we're just using the site ID (eg SUMP, G4) for these requests, but for gate valves the site ID is the same as the device ID (eg V4:V4)...

How about we just use the string "COMPUTER" for this instead? Was going to suggest "RASPI", but we might reboot the NAS box this way too.
Well, V4:V4 is the computer and the valve, since Gate Valves only have one function. For other devices, then the ID would be G4:M0, so that works too. Or doesn't it?
Terry
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Results Database Server

Post by hamishmb »

Yes, but here the problem:

If we're asking the sump pi to reboot, we'd change the line in the control table with the device ID "SUMP".

But for valve pi V4, the same thing would be changing the line in the control table with ID "V4", which is also the name of the device V4 (the gate valve itself). Do you see what I mean?
Hamish
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Results Database Server

Post by TerryJC »

Hmmm. I recall that we had to call the valve V4:V4 for some reason.

In any case, the only commands associated with V4 - the Valve would be an integer (not necessarily with the '%' symbol), whereas for the Pi itself, Manual would invoke reboot, shutdown and update which are all strings. Could we do it that way, or isn't it worth it?

In the end, it doesn't really matter, but it would be nice if the device IDs (Pis and valves, sensors etc) could be consistent across the board. Maybe instead of jumping through convoluted loops could we find some way where the computing device in config.py is identified, rather than it being implied by the Site or Valve name.
Terry
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Results Database Server

Post by hamishmb »

Yeah, I'll do that instead and call them eg "VALVE4:V4" instead, would make more sense.

Clarification: change config.py so system ID is eg VALVE4, and device ID remains as V4. The valves should then look at lot more like the other pis in terms of structure in config.py - more consistent.
Hamish
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Results Database Server

Post by TerryJC »

That will do it.
Terry
Post Reply