Overview
EVerest uses MQTT (Message Queuing Telemetry Transport) as its message bus for all inter-module communication. This lightweight publish-subscribe protocol provides loose coupling, reliability, and easy debugging.All module communication - commands, variables, and errors - flows through MQTT topics. This makes the entire system observable and debuggable.
Why MQTT?
MQTT was chosen for several key reasons:Decoupling
Modules don’t need direct references to each other
Observability
All communication can be monitored in real-time
Persistence
Messages can be retained for state recovery
QoS Levels
Configurable delivery guarantees (at most once, at least once, exactly once)
MQTT Broker Setup
EVerest requires an MQTT broker. The most common choice is Mosquitto:Local Broker (Default)
Unix Socket Connection
For better performance on local systems:External MQTT Broker
For distributed deployments:Topic Structure
EVerest uses a hierarchical topic structure with a configurable prefix (default:everest).
Topic Hierarchy
{prefix}- Namespace prefix (default:everest){module_id}- Module instance name from config{impl_id}- Implementation ID for the interface{type}- Message type:cmd,var, orerror{name}- Command/variable/error name
Topic Examples
Communication Patterns
EVerest uses three primary patterns for module communication:1. Commands (Request-Response)
Commands are synchronous RPC-style calls from one module to another.How Commands Work
Command Message Format
Request Topic:Error Types
Command responses can include these error events:MessageParsingFailed
MessageParsingFailed
JSON parsing error - malformed message
SchemaValidationFailed
SchemaValidationFailed
Message doesn’t match interface schema
HandlerException
HandlerException
Exception thrown in command handler
Timeout
Timeout
Command execution exceeded timeout
NotReady
NotReady
Module not ready to process commands
Shutdown
Shutdown
System is shutting down
Example: Calling a Command in C++
2. Variables (Publish-Subscribe)
Variables are asynchronous state publications that modules subscribe to.How Variables Work
Variable Message Format
Topic:Example: Publishing a Variable in C++
Example: Subscribing to a Variable in C++
3. Errors
Errors are published when modules detect fault conditions.Error Message Format
Topic:Error Lifecycle
Errors have states:- Active - Error condition is present
- ClearedByModule - Module detected condition cleared
- ClearedByReboot - Cleared by system restart
Example: Raising an Error in C++
QoS (Quality of Service) Levels
EVerest uses different MQTT QoS levels based on message criticality:QoS 0 - At Most Once
QoS 0 - At Most Once
Use for: High-frequency telemetry variablesBehavior: Fire and forget, no acknowledgmentExample: Power meter measurements published every 100ms
QoS 1 - At Least Once
QoS 1 - At Least Once
Use for: Commands and important state changesBehavior: Acknowledged delivery, may receive duplicatesExample: Authorization responses, session events
QoS 2 - Exactly Once
QoS 2 - Exactly Once
Use for: Critical commands and financial transactionsBehavior: Guaranteed single delivery (highest overhead)Example: Signed meter values, transaction records
Retained Messages
Some topics use MQTT’s retained message feature:- New subscribers immediately get last known state
- State survives module restarts
- Useful for “ready” flags and configuration
External MQTT Access
You can monitor and interact with EVerest using any MQTT client:Using mosquitto_sub
Using mosquitto_pub
Using MQTT Explorer (GUI)
MQTT Explorer is a graphical tool for exploring MQTT topics:- Download from: https://mqtt-explorer.com/
- Connect to broker (localhost:1883)
- Expand
everesttopic tree - View real-time message flow
everest/
└── modules/
├── evse_manager/
│ └── impl/
│ └── evse/
│ ├── var/
│ │ ├── session_event
│ │ ├── ready
│ │ └── limits
│ └── cmd/
│ ├── enable_disable
│ └── stop_transaction
└── yeti_driver/
└── …Topic Prefix Configuration
The topic prefix can be customized to run multiple EVerest instances:Message Flow Example
Here’s a complete flow of a charging session start:Debugging with MQTT
MQTT transparency makes debugging easier:Real-time Monitoring
Message Recording
Message Replay
Messages can be replayed for testing:Performance Considerations
Unix Sockets
Use Unix sockets for 30-50% better latency vs TCP
QoS Selection
Use QoS 0 for high-frequency telemetry to reduce overhead
Message Size
Keep messages compact - large payloads impact performance
Retained Messages
Limit retained messages to essential state only
Security
For production deployments: Example Mosquitto configuration:Next Steps
Architecture
Understand how messaging fits into the overall architecture
Modules
Learn which modules publish what messages
Interfaces
See what commands and variables each interface defines
Configuration
Configure MQTT broker settings