Monitoring and controlling KORUZA deployments SL

In order to support easy control and monitoring of KORUZA deployments on OpenWrt devices we have developed a simple architecture that enables multiple processes to communicate with the KORUZA device over the serial port at the same time.

The developed solution allows for the router to communicate with a serial device, for example an interactive shell for direct user control with real-time feedback, as well as simultaneous data collection for logging or use by the nodewatcher system. All this can be used in many applications, from sensor data collection to robot control, from device power management electronics to home automation.

The hub of the system is a control daemon that handles serial communication with the device and exposes this via a UNIX socket to which other processes can connect and issue commands. In order to ensure that multiple processes can issue commands at the same time, the control daemon implements a simple FIFO queue and also incorporates detection of response timeouts which can automatically reset the device before sending the next command.

For control, currently a simple manual control client application is implemented that supports issuing commands when specific keys are pressed (the key bindings are specified in a configuration file). The monitoring part is realized through a collector daemon that periodically polls the device and logs readings from all sensors in addition to providing a nodewatcher-compatible output that is used to remotely monitor the deployment.

This simple system is a simple but general architecture for serial communication from multiple processes and we plan to extend it with other features in the future.