OpenAPI-XPanel
OpenAPI-XPanel shows all interfaces in a graphical panel: edit a JSON payload and publish a request, or subscribe to reports and view the decoded output. It is for manual debugging; for code, use the Python client library or the C++ client.
OpenAPI-XPanel is the xpanel/ directory of the example project Lixel_OpenAPI, next to python/ and cpp/. It uses the Python client library in python/ as a package dependency (from example.core import …), and its Qt binding is PySide6 only. All commands on this page run from the repository root.
Supported systems and runtime requirements
| Item | Requirement |
|---|---|
| OS | Ubuntu 20.04, 22.04, or 24.04 (x86_64). Linux only; there is no Windows version |
| Libraries | libxcb-cursor0 (needed by Qt 6.5 and newer for the X11 platform plugin) and the Qt runtime libraries below |
sudo apt install libxcb-cursor0 libxcb-icccm4 libxcb-keysyms1 libxcb-shape0 libxcb-randr0 \
libxkbcommon0 libxkbcommon-x11-0 libglib2.0-0 libgl1 libegl1 libfontconfig1 libdbus-1-3 \
libgssapi-krb5-2
The executable is built on Ubuntu 20.04 (glibc 2.31), so it also runs on the newer releases; the highest glibc symbol it uses is GLIBC_2.29. After installing the packages above on a new system, check that the program starts with --self-test (see "Build the executable" below). On a desktop installation most of these packages are already present, and apt skips them. Without libxcb-cursor0 the X11 platform plugin does not load and the program exits with code 134; QT_QPA_PLATFORM=offscreen still works.
Run from source
# Create xpanel/venv, install PySide6==6.6.3.1 and the client library (pip install -e python),
# and generate the protobuf module
./xpanel/build-venv.sh
# Run OpenAPI-XPanel (English UI by default; use --lang zh for Chinese)
source xpanel/venv/bin/activate
python xpanel/main.py
Running from source needs Python 3.8 to 3.12 (the range PySide6 6.6.3.1 supports) and the system packages above. PySide6 is pinned to 6.6.3.1 in xpanel/requirements.txt: it is the last release that supports Python 3.8, the system Python of Ubuntu 20.04, and its Linux wheels need glibc 2.28 or newer.
Command-line arguments of xpanel/main.py:
| Argument | Description |
|---|---|
--lang zh | Start with the Chinese UI (default: English). Also switchable live in the menu |
--self-test | Hidden check option: build the main window, print one XPANEL_SELF_TEST_OK ... line, exit with code 0 without showing a window. Used with QT_QPA_PLATFORM=offscreen to check a packaged executable on a new system |
The panel
From top to bottom, the main window has a menu bar, a connection bar, two panels side by side, and a status bar. The "Publish messages" panel on the left sends requests to the device; the "Subscribe messages" panel on the right receives responses and reports. Publishing only sends a request and does not block the UI.

The main window after start-up, not connected yet
Menu bar
- Settings → Language: switch between English and 中文 live, no restart needed.
- About → About: shows the program name, the version, and the website link. The version is injected when the executable is built; when run from source it shows
V0.0.0.

The About dialog. It shows the version injected at build time; when run from source it shows V0.0.0
Connection bar

The connection bar with MQTTS selected: the port changes to 8883 and Username and Password appear
| Control | Description |
|---|---|
| Host | Device address, default 192.168.55.1 |
| Port | Follows the protocol: 1883 for MQTT, 8883 for MQTTS |
| Protocol | MQTT or MQTTS, depending on the device model; see Connection & Authentication |
| Username / Password | Shown only when MQTTS is selected, empty by default; fill in the vendor-provided credentials. Hidden and cleared when switching back to MQTT |
| OpenAPI Key (optional) | Leave it empty for a device with an OpenAPI authorization; for a device that needs a key, enter the key provided by XGRIDS. See OpenAPI authorization and key |
| Connect / Disconnect | After a successful connection the button changes to Disconnect and the status bar shows Connected: host:port; a failed connection opens a "Connection failed" dialog |
Publish messages
- Topic: the dropdown is prefilled with all publishable request topics. Selecting a topic switches Message type to the matching request message.
- Interface description: below the topic, the panel describes the interface and tells you which response topic to subscribe to in the "Subscribe messages" panel.
- Load template: generates a default JSON for the current message type and fills in the header:
seq,stamp(current time in milliseconds),device_id(defaultopenapi-example, filled in by XPanel, not a device ID), andsession_id. When an OpenAPI Key is entered in the connection bar, it is also written intoheader.openapi_key; otherwise nothing is written. Only request messages have a template. - JSON editor: edit the template fields before publishing.
- Publish: encodes the JSON with the current topic and message type and sends it. On success,
Published: <topic>appears in green next to the button; errors such as not being connected or invalid JSON appear in red.
Subscribe messages
- Topic + Subscribe: subscribe to one topic.
- Subscribe all: subscribe to every response topic and report topic at once.
- Wildcard + Subscribe: subscribe with an MQTT wildcard, default
lixel/#, i.e. every topic that starts withlixel/. - Current subscriptions: the subscribed topics. Unsub selected removes the selected subscriptions, Unsub all removes all of them. The list is cleared on disconnect.
- Received messages: one line per message, in the form
[HH:MM:SS.mmm] <topic> (<size>B); the latest 2000 are kept. With Auto scroll checked, the list always shows the newest message. - View detail / Clear: select a message and click View detail, or double-click the line, to open its details; Clear empties the list of received messages.
Message details
The first line of the detail window is the message type (for example [DeviceInfoResponse]), followed by the decoded JSON. A decoded string field longer than 256 characters shows only its first 32 characters, followed by ...<omitted, n chars total>.

Decoded DeviceInfoResponse (sample data)
The heartbeat is JSON text and is shown as is. A device that supports OpenAPI authorization includes Features, OpenapiLicenseState, and OpenapiLicenseText in its heartbeat, which tell whether it needs a key; see Telling which kind of device it is.

Heartbeat details: OpenapiLicenseState is active, so this device needs no key
Sending a request and reading the response
Taking the device info query as an example:
- Enter the host, choose the protocol for your device model, and click Connect.
- In the "Subscribe messages" panel, choose the topic
lixel/application/response/device_infoand click Subscribe. Subscribe all or the wildcardlixel/#also works. - In the "Publish messages" panel, choose the topic
lixel/application/request/device_infoand click Load template. - Click Publish;
Published: lixel/application/request/device_infoappears next to the button. - In Received messages, find the
lixel/application/response/device_infoline and double-click it to see the decoded response.

After subscribing to the heartbeat, the device status, and the device_info response, a device_info request is published and its response received (the host shown is an example address)
Note: responses and reports are all viewed in the "Subscribe messages" panel. Subscribe to the response topic before publishing a request, or the response is not shown.
Build the executable
./xpanel/build.sh V2.0.0 # the version is optional, default V0.0.0
# Output: xpanel/dist/OpenAPI-XPanel, plus LICENSE.txt and THIRD-PARTY-NOTICES.txt next to it
build.sh needs Docker and network access. It builds inside the image xpanel-build-focal:latest (Ubuntu 20.04, system Python 3.8, Nuitka, PySide6 6.6.3.1) and builds that image from xpanel/Dockerfile when it does not exist. If archive.ubuntu.com is not reachable from your network, set XPANEL_APT_MIRROR (for example XPANEL_APT_MIRROR=<your apt mirror>/ubuntu ./xpanel/build.sh V2.0.0); it is used only when the image is built. The script works on a staging copy of xpanel/, python/, proto/, and LICENSE.txt: the version and build time are written into the copy, and the protobuf module is generated inside the container, so no source file in the checkout is changed. build.sh fails if LICENSE.txt or THIRD-PARTY-NOTICES.txt is missing.
To check the result on a clean system:
QT_QPA_PLATFORM=offscreen xpanel/dist/OpenAPI-XPanel --self-test
Localization
All user-visible text of the panel supports multiple languages. The UI is English by default and can be switched live from the "Settings → Language" menu, or specified at startup with --lang <code>. The Chinese translation is xpanel/openapi_xpanel/i18n/openapi_zh.ts, compiled to .qm. The interface descriptions shown in the Publish panel come from python/example/core/api_catalog.py, so their text in the .ts file must match it character by character. Edit the .ts by hand, because lupdate rewrites the whole file, then compile it (needs the system Qt tool lrelease):
bash xpanel/openapi_xpanel/i18n/build_i18n.sh release # compile .ts -> .qm
To add a language: copy the .ts and translate it, compile it with lrelease, and register it in the source constant LANGUAGES (xpanel/openapi_xpanel/gui/control_panel.py); it then appears in the menu.
Directory structure
xpanel/
├── main.py # entry point
├── openapi_xpanel/ # XPanel package (internal, not a public API)
│ ├── _build_info.py # APP_VERSION / APP_BUILD_TIME, stamped by build.sh in its staging copy
│ ├── gui/ # control / publish / subscribe panels
│ └── i18n/ # translations (.ts / .qm) + build_i18n.sh
├── assets/ # application icon
├── fonts.conf # font configuration, packaged with the executable
├── requirements.txt # PySide6==6.6.3.1
├── Dockerfile # build image (Ubuntu 20.04)
├── build.sh # Nuitka packaging in Docker
├── build-venv.sh # create the local development environment
└── THIRD-PARTY-NOTICES.txt # notices shipped with the executable