MQTTX is a cross-platform MQTT 5.0 client tool developed by EMQ, available as a desktop application (Electron + Vue), a web application (Vue), and a command-line interface (Node.js). It allows users to connect to MQTT brokers, publish and subscribe to topics, inspect messages, and manage connections with support for MQTT 5.0 features, TLS, WebSocket, and various payload formats (JSON, Base64, Hex, CBOR, MsgPack, Protobuf, Avro). It also includes an AI Copilot for MQTT assistance, a dashboard with real-time widgets, and scripting capabilities for payload transformation. The desktop app uses Electron with Vue 2, Element UI, TypeORM with SQLite for persistence, and MQTT.js for MQTT protocol. The web app shares many Vue components but uses lowdb/LocalStorage. The CLI is a separate Node.js package with its own test suite. The codebase is organized into shared utilities, database services, Vue components, and AI integration modules. Key entry points include src/background.ts (Electron main process), src/main.ts (render process), cli/bin/index.js (CLI), and web/src/main.ts (web app). Data flows involve MQTT connection lifecycle, message buffering via RxJS, payload conversion pipelines, and database persistence for messages, subscriptions, and settings. External dependencies include MQTT.js for MQTT protocol, TypeORM for database ORM, Electron for desktop, Vue 2 and Element UI for UI, Monaco Editor for code editing, ECharts for charts, and various AI SDKs (OpenAI, Anthropic, etc.) for the Copilot feature. The project also includes custom patches for third-party libraries (Monaco clipboard, MCP SDK, Azure SDK). The CLI depends on commander, chalk, and @faker-js/faker for simulation. While primarily an application, MQTTX includes data-oriented features such as message history querying with SQL recursive CTEs, topic tree persistence, data export/import in multiple formats, and IoT data simulation scenarios. These elements serve the application's debugging and testing purpose but demonstrate data engineering patterns.
This repository provides embedded firmware for the ESP8266 that bridges Chinese solar inverters (Voltronic/Axpert, PIP, EASUN, Deye, Anenji, Must PV/PH18) to MQTT and a local web interface. It communicates with inverters via RS232 serial (using proprietary ASCII protocols like PI30, PI18) or RS485 Modbus RTU, parses real-time status (grid, battery, PV, loads, faults), and publishes structured JSON to configurable MQTT topics including Home Assistant auto-discovery. The firmware also hosts a full web-based configuration portal with captive portal for WiFi setup, OTA updates, a live JSON endpoint, and LED status indication. Architecturally, it is a monolithic embedded application written in C++ for the PlatformIO build system. Key entry points are `src/main.cpp` (setup/loop), the web server endpoints, MQTT callbacks, and the serial/Modbus polling loop. The code is organized into a serial protocol handler (`PI_Serial`), an abstract Modbus device layer (`modbus_device`) with concrete implementations, a settings manager using EEPROM with versioning and fallback, and a chunked HTML serving mechanism to avoid heap fragmentation on memory-constrained ESP8266 devices. Notable strengths include the modular Modbus device interface that allows adding new inverter models by subclassing and providing register tables, and the auto-detection logic that probes protocols in sequence. The web UI is built with Bootstrap and jQuery loaded from CDN, and the project actively supports Home Assistant integration and multiple hardware configurations (Wemos D1 Mini, ESP-01, WiFi dongle). While the code is well-structured for an embedded project, it relies on dynamic `String` objects and large JSON documents on a limited memory platform, which could cause heap fragmentation over long periods. The license (CC BY-NC-ND 4.0) restricts commercial use and derivative works, limiting community contributions.