mitra42 / frugal-iot

A platform to enable affordable sensor networks
https://drive.google.com/drive/folders/1VRrBSEATjN9i-Fx3X48nKeh_lJCg1sto?usp=sharing
1 stars 2 forks source link

Control Loops - what should they look like in a poor internet situation? #18

Open mitra42 opened 2 months ago

mitra42 commented 2 months ago

From a design perspective, there is an important question of what control loops should look like in Resource Constrained environments, where - in particular - the internet cannot be relied on to be stable.

Lets take a simple example - lets say you have a soil moisture sensor, and you have a server (cloud) -side control loop that says whenever moisture gets below X percent, turn the pump on, and when it gets above Y, turn the pump back off.

If the net goes down between the pump on, and pump off decision, you’ve got an empty tank, and a flooded crop.

There are a few ways to design around this.

  1. Where the node has both the sensor and the actuator, then put the control loop in the node. We can still adjust X and Y via the cloud, but the device should be able to operate autonomously once these are set. See - [ ] #26

  2. If the sensor and the actuator are separate devices, then we should rely on the local net, but not the internet for control, and there are two ways to do this.

  1. Instead of turning the pump “ON” add a parameter that says how long it should be “ON” for.
  2. Define a default state of the pump that it should always go to when it doesn’t receive a state update within a certain time-period.

I’m not particularly interested in which option is right for the trivial sensor/pump example, but I think each of these should be a supported strategy that is easy to configure.

We are a little way off from designing this - but I’m putting this out for discussion.