Table of Contents
| Module | Repository | README | License |
|---|---|---|---|
| Project overview | |||
| Cloudflare | |||
| Server | |||
| Microcontroller (ESP32) | |||
| Client |
This repository is part of the Easy Homelab Server Switch project. If you are exploring it for the first time, start with the Project Overview README repository which explains the architecture and interaction between all components.
The client MQTT agent is organized into small modules, each responsible for a specific part of the system.
- The entry point of the Kivy application.
- Orchestrates the application.
- Defines the central dictionary for broker settings, credentials, and MQTT topics.
- Provides validation to ensure all critical parameters are present before the system attempts to start.
- Manages the secure TLS connection to the MQTT broker.
- Subscribes to
TOPIC_STATEandTOPIC_ESP32_STATEand triggers local actions based on incoming remote commands. - Publishes commands on
TOPIC_CONTROL.
- Performs network validation, method depends on the OS.
- Manages the CA certificates required for secure MQTT and Cloudflare communication.
- Ensures secure storage and retrieval of certificates data within the application's data directory.
- Enables remote server access via SSH if the client is in the same local subnet.
- Defines shared constants used across the application.
- Provides multi-language support for all UI labels and log messages.
- Manages the Kivy-based graphical interface.
- Records application activity and errors to both the console and a local file for debugging.
- Resolves and creates the application data directory.
The system is configured via the config.py file using environment variables.
| Category | Variable | Description |
|---|---|---|
| --- | LANG | Language in "xy" format |
| MQTT_CONFIG | ip | The IP address of the cloud cluster in MQTT broker. |
| port | The secure MQTT port (default: 8883 for TLS) | |
| user | Username used for authenticating with the broker. | |
| pass | Password used for authenticating with the broker. | |
| TOPICS | Check here | and here |
| SSH_CONFIG | user | User you want to log in via SSH |
| ip | Local IP of the server | |
| subnet_prefix | Local internet prefix (default: 24) | |
| --- | MQTT_CA_CERTIFICATE | ISRG Root X1 certificate for validating the MQTT broker connection. |
The Buildozer is configured via the buildozer.spec file using environment variables.
| Variable | Example |
|---|---|
title |
Server |
package.name |
server |
package.domain |
org.server |
Make sure those settings match exactly.
| Variable | Value |
|---|---|
requirements |
python3,kivy,paho-mqtt,pyjnius |
android.permissions |
INTERNET, WRITE_EXTERNAL_STORAGE, ACCESS_NETWORK_STATE |