For developers

Calaos software stack

This chapter describes how Calaos works internally, component by component. It is aimed at developers, contributors and advanced users who want to understand how the pieces fit together, write a client, or port Calaos to new hardware.

Nothing in this chapter is needed to use Calaos. To install and configure your system, see Getting started and Calaos OS.

Overview

The whole installation revolves around a single process, calaos_server. It talks to the hardware, applies the rules and exposes an API. Every other component — graphical interfaces, wall screens, mobile applications — is a client of that API, with no direct access to the hardware.

graph TD subgraph clients[Clients] HOME[Calaos Home
local touchscreen] MOBILE[Calaos Mobile
iOS / Android] WEB[Calaos WebApp
browser] RUI[Remote UI
ESP32 wall screens] INST[Calaos Installer
configuration] end subgraph server[Server] SRV[calaos_server] RULES[Rules and
scenario engine] IO[Input / output drivers] end subgraph hw[Hardware and services] WAGO[Wago / KNX / GPIO] MQTT[MQTT / Zigbee] ONEWIRE[1-Wire / DMX / Hue] DB[(InfluxDB
history)] end HOME -->|JSON / WebSocket| SRV MOBILE -->|JSON / WebSocket| SRV WEB -->|JSON / WebSocket| SRV RUI -->|JSON / WebSocket| SRV INST -->|JSON / HTTP| SRV SRV --- RULES SRV --- IO IO --> WAGO IO --> MQTT IO --> ONEWIRE SRV --> DB

This architecture has one practical consequence: writing a new client requires touching nothing else. The API is the same for everyone, documented by the calaos_server code, and the existing clients are so many examples of it.

The components

ComponentRoleTechnologyRepository
Calaos ServerCore of the system: hardware, rules, APIC++ / libuvcalaos_base
Calaos HomeLocal touchscreen interfaceQt / QMLcalaos_mobile
Calaos MobileiOS and Android applicationsQt / QMLcalaos_mobile
Remote UIStandalone wall screensESP32-P4calaos_remote_ui
Calaos WebAppBrowser interfaceJavaScriptcalaos-web-app
Calaos DDNSRemote access and certificatesGocalaos_ddns
Configuration filesFormat and location of the configurationXMLcalaos_base

On top of these come the components that run the system itself: calaos-container, the daemon managing the containerised services, and calaos-os, the administration tool. They are described in Under the hood and The calaos-os tool.

Network ports

PortProtocolUse
5454TCPJSON API, over HTTP and WebSocket
4545UDPServer discovery on the local network
4646UDPListening for Wago PLCs
8000TCPcalaos-container administration API, on the loopback interface only

The API port can be changed with the port_api setting.

The API on port 8000 is the one Calaos Home uses to install the system, configure the network and confirm a rollback — see Calaos Home.

Licence

Calaos is free software, released under GPL v3 for most of its components. Contributions are welcome: every repository accepts pull requests, and discussions happen on the forum and in GitHub issues.

  • Calaos Server
  • The core of the system: hardware drivers, rules engine and JSON API.

  • Calaos Home
  • The local touchscreen interface, and how it drives the system.

  • Calaos Mobile
  • The iOS and Android applications, and the base they share with Calaos Home.

  • Calaos Remote UI
  • The wall screen firmware, and how to port it to new boards.

  • Calaos WebApp
  • The interface reachable from a browser.

  • Calaos DDNS
  • The dynamic DNS client, certificates and HAProxy routing.

  • Calaos Config
  • The configuration files: format, location and life cycle.