We talked about:
- How using a site-wide global reading interval would be a simple solution, but would be inefficient.
- At first I thought this wasn't a big problem.
- Now I see that we'd have lots of duplicate readings on the NAS box and this would make the data harder to crunch.
- We'd also have to purge the database of old readings more frequently - not something we want to do often.
- How using a local reading interval for each pi would work better, but be more complex.
- ^ We outlined a number of ways of dealing with this:
- Storing the reading intervals in the database alongside the readings.
- This would work, but be high latency and cause more CPU load on the NAS box - not ideal.
- Could also cause large time drift when polling for intervals if the NAS box responds slowly/is busy.
- Improving the sockets code to add a "message bus" type feature.
- This would allow the NAS box (or any other device) to forward messages between any of the pis connected to it.
- This would be quicker, cause less system and network load, and use less storage space on the NAS box.
- I (Hamish) also think I could implement this without too much difficulty - it seems like a good solution.
- It essentially allows peer to peer comms (as far as the pis are concerned) without the complexity of many sockets directly connecting the pis.
- But note that this does make the NAS box a single point of failure(!)
- Storing the reading intervals in the database alongside the readings.
- We do not want a global reading interval for the reasons outlined above.
- To give the message bus idea with the sockets a go first, to see how workable the idea is for sending reading intervals between Pis.
- Failing that, modify the database spec and update the code to use an extra column in the readings tables to store the interval there instead.