The project splits into a number of separate components:
- A WiFi-connected Sensor Module that periodically sends environmental information, including two temperature readings, humidity, luminosity and barometric pressure. This module can also respond to commands received (such as a remote restart).
- A WiFi-connected Actuator Module that responds to control messages to determine the position of the vents. This module has two local buttons and a rain sensor, as there are certain functions that the module must be able to carry out autonomously, without relying on a cloud service.
- A message broker. The modules communicate using MQTT, a lightweight telemetry protocol. They send messages to, and receive messages from, a message broker in 'the Cloud'. Other software components of the solution integrate with this message broker, so that they can receive messages from, and send messages to, this central point.
- A mobile App to allow user control and monitoring. This will be a Xamarin App, as it allows for a native cross-platform implementation and capitalises on my existing .NET skills.
There may also be a website for control and monitoring away from a suitable mobile device.
Security is a concern. Whilst I have no issue with someone being able to monitor the environmental data, I don't want anyone to be able to inject spurious data into the system or gain direct control over the vents. To that end, each message is signed. Ideally, I'd like to encrypt the whole message, but that's quite a heavyweight task for these tiny microcontrollers. For now, an MD5 hash using a shared secret will have to do.
Code and Eagle files are at https://github.com/smorgo/VentController