XGRIDSDocs
  • 简体中文
  • English
  • 繁體中文
  • 日本語
  • Deutsch
  • Español
  • Italiano
  • Français
  • Русский
  • Polski
  • Nederlands
  • 简体中文
  • English
  • 繁體中文
  • 日本語
  • Deutsch
  • Español
  • Italiano
  • Français
  • Русский
  • Polski
  • Nederlands
  • Lixel PortalCam Series

    • PortalCam P1

      • Product Overview
      • Basic Operation
      • Using the LCC Scan App
      • Maintenance and Care
      • FAQ
  • Lixel K Series

    • Lixel K1

      • Product Overview
      • Basic Operation
      • Device Activation and Connection
      • Scanning Workflow
      • Acquire Point Cloud Data with Absolute Coordinate
      • Map Fusion
      • Route Planning Suggestions for Typical Scenes
      • Precautions
      • FAQ
    • Lixel K2

      • Product Overview
      • Basic Operation
      • Device Activation and Connection
      • Scanning Workflow
      • Acquire Point Cloud Data with Absolute Coordinate
      • Map Fusion
      • Route Planning Suggestions for Typical Scenes
      • Precautions
      • FAQ
  • Lixel L Series

    • Lixel L2 Pro

      • Product Overview
      • Basic Operation
      • Device Activation and Connection
      • Scanning Workflow
      • Acquire Point Cloud Data with Absolute Coordinate
      • Measure Point
      • Appendix
      • FAQ
    • Lixel L3

      • Product Overview
      • Basic Device Functions
      • Device Activation and Connection
      • Data Capture
      • Capturing Absolute Coordinates
      • Appendix
      • FAQ
  • Robotics

    • Lixel OpenAPI

      • Overview
      • Connection & Authentication
      • Message Model & Codec
      • Interface Catalog
      • Real-time Data
      • Project File Access
      • Error Codes
      • Python

        • Quick Start
        • Client Wrapper & Tools
        • FAQ
      • C++

        • Quick Start
        • Client & Examples
        • FAQ
      • OpenAPI-XPanel
  • Accessories

    • Stick Light

      • Installation Guide
      • Basic Operation
      • FAQ
  • Lixel Studio

    • Version and Copyright
    • Installation and Activation
    • Software Interface
    • File Operations
    • Project Processing
    • Tools
    • 2D Drawing
    • Applications
    • Settings
    • Device Connection
    • FAQ
    • Usage Tips

      • Data Flow Overview
      • Software Licensing Guide
      • Understanding Scanner Accuracy Specifications
      • Point Cloud Registration Guide
  • Lixel CyberColor

    • LCC Studio

      • Getting Started
      • Version and Updates
      • Download and Installation
      • Interface Overview and Navigation
      • Before Reconstruction
      • Model Reconstruction
      • Single Model Reconstruction
      • Map Fusion
      • Aerial-Ground Fusion
      • Aerial Reconstruction
      • My Models
      • Other Features
      • Settings and Account
      • Converter
      • Publish to Third-Party Platforms
      • Video Reconstruction
      • FAQ
    • LCC Scene Editor

      • Version & Updates
      • Account & Login
      • Product Overview & Home
      • Editor Interface
      • Scene Navigation Modes
      • File
      • Settings
      • Edit Operations
      • Window
      • Global Toolbar
      • Assets & Properties
      • Left Toolbar
      • Viewpoints
      • Portal
      • Skybox
      • Annotations
      • Measurement
      • Flythrough
      • Scene Report
      • 3D Layout
      • Mini-Map
      • Preview Mode (Viewer)
      • Help
      • FAQ
      • Spawn Point
    • LCC Model Editor

      • Version and Updates
      • User Guide
      • Overview and Interface
      • File Operations
      • Selectors
      • Editing Operations
      • Measurement
      • Color Grading
      • Asset Management
      • Settings and Help
      • FAQ
    • Capture Guide

      • Overview
      • Capture Devices Overview
      • General Capture Principles
      • Indoor Scene Capture
      • Outdoor Scene Capture
      • Large-Scale Capture (Map Fusion)
      • Aerial-Ground Map Fusion Capture
      • Object Capture
      • People Capture
      • Video Reconstruction Capture
      • HD Enhancement
      • Control Points (Lixel P1)
      • FAQ and Troubleshooting
    • LCC Studio Linux

      • Product Overview
      • Architecture Guide
      • Installation and Deployment Guide
      • Container Startup Parameters Guide
      • CodeMeter Offline Licensing Deployment Guide
      • API Reference
      • Appendix - Developer Data Guide
      • Appendix - Error Code List
      • Single-Machine Multi-GPU Cluster Deployment QuickStart
    • Best Practices

      • Merging Multiple Large 3DGS Models
      • Aerial-Ground Map Fusion Workflow
      • Data Flow Overview
      • Software Licensing Guide
    • Version History
  • Plugin & SDK

    • Unreal

      • What's New
      • Introduction
      • Quick Start - Windows
      • Quick Start - Linux
      • Quick Start - Quest3
      • URL Data Loading (Pro)
      • Editions and Licensing
      • Rendering
      • Tiled Rasterization (Pro)
      • Visual Settings
      • Normals and Lighting
      • Scene Editing
      • Performance Parameters
      • Performance Guide
      • Third-party and Engine Plugin Integration
      • Proxy Mesh
      • Loading Animation
      • Collision
      • Navigation System Support
      • Single Layer Water Support
      • Localization
      • FAQ
      • Troubleshooting
      • Logging and Diagnostics
      • Contact Us
      • Best Practices

        • Relighting 3DGS with a LixelStudio Mesh
        • Per-camera Independent Rendering
      • API Reference

        • ALCCActorBase
        • ULCCComponentBase
        • ULCCComponent
        • ULCC2Component
        • SOG / SPZ / PLY Actors
        • ALCC2ProxyMesh
        • ALCCClippingVolume
        • ALCCSectionPlane
        • ALCCLoadVolume
        • ULCCUtilLibrary
        • Enums
        • Structs
      • Changelog

        • v3.6.0
        • v3.5.0
        • v3.4.0
        • v3.3.1
        • v3.0.0
        • v2.2.1
        • v1.0.0
        • v0.9.0
        • v0.8.0
        • v0.7.1
        • v0.6.1
        • v0.5.2
        • v0.4.1
        • v0.4.0
        • v0.3.0
        • v0.0.5
        • v0.0.4
        • v0.0.3
        • v0.0.2
        • v0.0.1
    • Unity

      • Unity SDK Introduction
      • Technical Features
      • Development Environment Requirements
      • PC Quick Start Guide
      • Project Settings Optimization Guide
      • Pico 4 Ultra Development Guide
      • Pico 4 Ultra PC Streaming Guide
      • Quest 3 Development Guide
      • Quest 3 PC Streaming Guide
      • Pico Space Pro Development Guide
      • Pico Space Pro Business Streaming Guide
      • OpenXR Development Guide
      • Pico 4 Ultra Business Streaming Guide
      • Glossary
      • FAQ
      • Contact Us
      • Feature Development Guide

        • Multi-Scene Mixed Rendering Development Guide
        • Shadow Receiving Development Guide
        • Real-Time Lighting Development Guide
        • Multi-Camera Rendering Development Guide
        • High-Resolution Image Rendering Development Guide
        • LCC and LCC2 Data Format Compatibility Development Guide
        • Loading Effect Development Guide
        • Mip Rendering Mode Switching Development Guide
        • Edge and Corner Snapping Development Guide
        • Projected Decal Development Guide
        • Video Projected Decal Development Guide
        • Highlight Development Guide
        • Real-Time Clipping Development Guide
        • Color Adjustment Development Guide
        • Getting Scene Mesh Data Development Guide
        • Editor Mode Development Guide
        • Render Performance Parameter Configuration Guide
        • Application and Data Co-packaging Development Guide
        • Collision System Development Guide
        • macOS Development Permission Issue Guide
        • iOS Device Compilation and Packaging Development Guide
      • API Reference

        • LCCManager
        • Renderer
        • Data Types
      • Changelog

        • v2.4.0
        • v2.3.0
        • v2.2.10
        • v2.2.0
        • v2.1.19
        • v2.0.14
    • Web

      • Introduction
      • Rendering Performance Optimization Guide
      • Graphics Configuration
      • WebGPU Development Guide
      • FAQ
      • API Reference

        • LCCObject::checkRenderNextFrame
        • LCCObject::clearRenderNextFrame
        • LCCObject::ecef2Prj
        • LCCObject::getBounds
        • LCCObject::getEnvInstancedMesh
        • LCCObject::getInstancedMesh
        • LCCObject::getLodInfos
        • LCCObject::getOriginPosition
        • LCCObject::getProjectionCoordinateSystemInfos
        • LCCObject::hasCollision
        • LCCObject::hasEnvironment
        • LCCObject::hasShcoef
        • LCCObject::intersectsCapsule
        • LCCObject::intersectsRayExt
        • LCCObject::intersectsRayFromOriginExt
        • LCCObject::intersectsSphere
        • LCCObject::lowerToBottom
        • LCCObject::prj2Ecef
        • LCCObject::raiseToTop
        • LCCObject::raycast
        • LCCObject::raycastFromOrigin
        • LCCObject::setAlpha
        • LCCObject::setClipBox
        • LCCObject::setClipPlane
        • LCCObject::setClipPrism
        • LCCObject::setEndLod
        • LCCObject::setLodAutoLevelUp
        • LCCObject::setMaxDistance
        • LCCObject::setMaxNodeSplats
        • LCCObject::setMaxSplats
        • LCCObject::setMinSplatSize
        • LCCObject::setMipFilter
        • LCCObject::setOriginPosition
        • LCCObject::setPointsColor
        • LCCObject::setRenderState
        • LCCObject::setRotation
        • LCCObject::setScale
        • LCCObject::setSemantic
        • LCCObject::setSemanticColor
        • LCCObject::setSmooth
        • LCCObject::setStartLod
        • LCCObject::setTranslation
        • LCCObject::setVisible
        • LCCObject::togglePointsDisplayMode
        • LCCObject::useEnvironment
        • LCCObject::useShcoef
        • LCCRender::clearIndexDB
        • LCCRender::dispose
        • LCCRender::load
        • LCCRender::setCamera
        • LCCRender::unload
        • LCCRender::update
      • Changelog

        • v0.6.6
        • v0.6.4
        • v0.6.3
        • v0.6.2
        • v0.6.1
        • v0.6.0
        • v0.5.5
        • v0.5.4
        • v0.5.3
        • v0.5.2
        • v0.5.1
        • v0.5.0
        • v0.4.1
        • v0.4.0
        • v0.3.1
        • v0.3.0
        • v0.2.0
  • API

    • Structured Spatial Modeling

      • Access Guide
      • Modeling Workflow
      • API Reference
      • Temporary Upload Credentials
      • Error Codes

Connection & Authentication

A Lixel device runs a built-in MQTT broker and RTSP service. Real-time control and the real-time point cloud go over MQTT; the real-time video goes over RTSP. The device supports both wired and wireless networking with other devices: wired over a USB cable, wireless over Wi-Fi.

Connection parameters

Each product model supports only one of the connection protocols (not both):

ProtocolPortUsernamePasswordProduct model
MQTT1883——K1 / L2PRO
MQTTS8883Provided by the vendorProvided by the vendorAll models other than K1 / L2PRO, e.g. K2, L3, H1, F1, Porcam
  • MQTT version: V3.1.1
  • Wired networking uses the fixed IP 192.168.55.1; for wireless networking the IP is obtained over Bluetooth.
  • In Quick Connect mode the device IP is fixed at 192.168.56.1.

Note: MQTTS uses TLS; when MQTTS is selected, pass the vendor-provided username and password. Certificate verification depends on the client:

  • The Python client and OpenAPI-XPanel do not verify the device certificate. The client cannot confirm it is really talking to the device; a man-in-the-middle on the same network can impersonate the device and read the MQTT username and password, the openapi_key if one is set, and all the data.
  • The C++ client verifies the device certificate by default. The K2 and L3 device certificate is issued by the CA certificate certs/lixel_mqtts_ca.crt in the example project; connect with --ca-file certs/lixel_mqtts_ca.crt --no-verify-hostname. See C++ · TLS certificate checks.

For production, use the C++ client with the CA check on.

USB connection

Devices running Linux, Windows, or Android share the network with the Lixel device over RNDIS; iOS devices use USB Tethering.

  Lixel device (192.168.55.1)                     other device
      +---------+                                    +---------+
      |   USB   | <----- RNDIS / USB Tethering ----> |   USB   |
      +---------+                                    +---------+

Wi-Fi connection

The device supports three wireless modes:

  • Normal mode: another device acts as the hotspot.
  • Quick Connect mode: the Lixel device acts as the hotspot.
  • Bridge mode: a router is used.

All modes require network provisioning over Bluetooth first. The device accepts a Bluetooth connection to configure Wi-Fi so it can join a given network.

The device's Bluetooth name has 10 characters: most models use the fixed prefix XGR- plus the last 6 digits of the SN, e.g. XGR-A12345; some ODM models use a different prefix (e.g. PCAM). Follow the name you actually scan.

      Lixel device                                 other device
      +---------+                                      +---------+
      |   BT    | <----- Bluetooth (provisioning) --> |   BT    |
      |  WiFi   | <----- WiFi (data) ---------------> |  WiFi   |
      +---------+                                      +---------+

Provisioning flow

The BLE provisioning flow between the device and the client: the client, as the master, searches for and connects to the device (the slave); after connecting, the device first sends its current Wi-Fi status; if Wi-Fi is not connected, the client sends the Wi-Fi info (SSID and password) and the device joins the target network.

        Lixel device                                    client
  +----------------------+                     +----------------------+
  |   BLE slave mode     |                     |   BLE master mode    |
  +----------+-----------+                     +----------+-----------+
             |                                            |
             v            <---- connecting ---->          v
  +----------------------+                     +----------------------+
  |   send WiFi status   | ------------------> |   get WiFi status    |
  +----------+-----------+                     +----+------------+----+
             |                                      |            |
             |                        WiFi not      |            | WiFi
             |                        connected      |            | connected
             |   <------ send WiFi info ----------- |            |
             v                                      v            v
  +----------------------+                     +----------------------+
  |   connect to WiFi    |                     |         end          |
  +----------------------+                     +----------------------+

OpenAPI authorization and key

openapi_key is an optional field of the request header. A device that holds an active OpenAPI authorization (state active) needs no key: leave openapi_key empty (the default) and the client sends none. The authorization is granted by XGRIDS; this SDK cannot grant or install it. The authorization state can be read from the heartbeat, and the authorization code and the remaining recording minutes with openapi_license; see Interface Catalog · Query the OpenAPI authorization.

Other devices still need a valid key: a device that is not authorized, one whose authorization is used up, and one still on the earlier key-based scheme (the scheme of 1.x). A valid key is accepted by every kind of device, so the same program can talk to all of them; set the key only for a device that needs it.

How the device handles a request

For each request the device decides in this order:

  1. The header carries a valid openapi_key, and on a device that checks device_id the device_id matches: the request is executed as in 1.x. It is not metered and does not depend on the authorization state.
  2. The header carries a valid openapi_key, but the device_id does not match: error.code is EC_ProtoError and error.desc is device auth error.
  3. The header carries no openapi_key, or a wrong one (a wrong key is treated like no key): the authorization state of the device decides, as in the table below.
DeviceWithout a key (or with a wrong key)With a valid key
Authorized (active)ExecutedExecuted (not metered)
Authorization used up (expired)EC_ProtoError, desc is openapi license exhaustedExecuted
Supports authorization but not authorized (none)EC_ProtoError, desc is openapi auth errorExecuted
Earlier key-based scheme (the heartbeat has no Features)EC_ProtoError, desc is openapi auth errorExecuted

EC_ProtoError is 0x32040001. In every error case above the device still replies, the response carries no business data, and request() returns normally without a timeout. The heartbeat is a report you subscribe to and does not depend on the key.

All 13 request/response interfaces in the Interface Catalog other than openapi_license behave this way, device_info included. The Lixel L2Pro has no data_unpack topic and does not respond to it, with or without a key, so on a Lixel L2Pro the interfaces that work without a key are the other 12.

openapi_license does not check the key: it can be queried in every authorization state, with or without a key, and with a wrong one, and it is not metered. A device on the earlier key-based scheme has no such topic, and a request to it times out.

Telling which kind of device it is

Subscribe to the heartbeat (lixel/application/report/heartbeat) and look at two fields:

  • Features contains "openapi_license": the firmware supports OpenAPI authorization. OpenapiLicenseState is then none, active, or expired. The field is left out while the device cannot read its own authorization state.
  • The heartbeat has no Features, or Features does not contain "openapi_license": a device on the earlier key-based scheme.

ProtocolVersion is "3.0.0" on both kinds of device and cannot tell them apart. For the field descriptions, see Interface Catalog · Status monitoring.

Metering

Only a recording started without a key is metered:

  • A recording started by a modeling request (AC_START) without a key uses up recording minutes of the authorization. A recording started with a valid key uses none.
  • Only the time the device spends scanning is counted. Timing starts when the device state becomes scanning (EC_ScanModeling) and ends when it becomes stopping (EC_ScanStopping). The start phase after AC_START (starting scan, usually ten to twenty seconds) and the stop phase after AC_STOP (stopping scan and returning to standby) are not counted. A recording that ends without reaching scanning is not metered.
  • Each full 60 seconds uses 1 minute, and the part of less than 60 seconds left when the recording ends uses 1 more minute. For example, a recording that stays in scanning for 150 seconds uses 3 minutes.
  • When the minutes run out, the device stops that recording through the normal stop procedure, the data already recorded is saved as usual, and the authorization state becomes expired. From then on a request without a key is answered with openapi license exhausted, while a request with a valid key still works.
  • A permanent authorization never runs out.
  • Query the remaining recording minutes with openapi_license; they decrease in real time while recording. See Interface Catalog · Query the OpenAPI authorization.

Requesting an OpenAPI Key

For a device that needs a key, the OpenAPI Key is distributed by XGRIDS and cannot be generated by yourself. To obtain one:

  1. Request it through the XGRIDS business or technical support channel, stating the device model and intended use.
  2. XGRIDS checks and issues a key string.
  3. Fill it into the connection configuration; no extra activation step is needed.

Note: the key is bound to a specific device / authorization. Keep it safe; do not hard-code it into a public repository or share it with third parties.

Using it in code

Set ClientOptions.openapi_key only when a key is needed. When it is set, request() / publish() fill it into the header automatically; when it is not set, nothing is written.

from example.core import ClientOptions, OpenApiClient

# A device that holds an active OpenAPI authorization: no key
with OpenApiClient(ClientOptions(host="192.168.55.1")) as client:
    ...

# A device on the earlier key-based scheme, or one whose authorization is missing or used up: set the key
opts = ClientOptions(host="192.168.55.1", openapi_key="<provided by XGRIDS>")
with OpenApiClient(opts) as client:
    ...  # header.openapi_key is filled automatically

The C++ client works the same way with ClientOptions::openapi_key; see the C++ Quick Start.

Upgrading from 1.x

Programs written for 1.x need no change: a request with a valid key is handled exactly as in 1.x and is not metered. To go without a key, the device must already hold an OpenAPI authorization; then stop passing a key (remove openapi_key= or --key).

Header fields

The first field of every request/response/report message is usually a Header:

FieldTypeDescription
sequint32Frame sequence number
stampsint64Frame timestamp. Device-reported frames are in microseconds, with the Unix epoch as the time base
scalersint64Scale factor (used by point cloud, etc.)
device_idstringDevice ID (generated by the device)
session_idstringSession ID (generated by the request/report side)
openapi_keystringAPI key, optional. Not needed by a device with an active OpenAPI authorization; see OpenAPI authorization and key

The corresponding proto definition:

message Header {
    uint32 seq = 1;                  // frame sequence number
    sint64 stamp = 2;                // frame timestamp
    sint64 scaler = 3;               // scale factor (positive: magnify, negative: shrink, 0: disable scaling)
    string device_id = 4;            // device ID (generated by the device)
    string session_id = 5;           // session ID (generated by the request/report side)
    optional string openapi_key = 6; // API key, optional (not needed by a device with an active OpenAPI authorization)
}

Appendix: low-level provisioning interface

Note: this section is only for reference when you implement Bluetooth provisioning yourself (without an existing app). In most cases provisioning is done with the bundled tool or app, and you do not need these low-level definitions.

Provisioning reads and writes characteristics over the BLE GATT service. Android and iOS use different UUIDs:

/* Android GATT Characteristic Types */
#define UUID_GATT 0x1801
#define GATT_CHARAC_WIFI_INFO_SET 0x2AB0
#define GATT_CHARAC_WIFI_STATUS_GET 0x2AB1

/* iOS GATT Characteristic Types */
#define IOS_UUID_GATT 0x7F00
#define IOS_GATT_CHARAC_WIFI_INFO_SET 0x7F01
#define IOS_GATT_CHARAC_WIFI_STATUS_GET 0x7F02

The data structures for writing the Wi-Fi config and reading the Wi-Fi status:

#pragma pack(1)
/***********************************************************
 * WiFi status information (device -> Android)
 * ssid_len : 0 means WiFi is disconnected
 * ssid     : WiFi access point name
 * ip_len   : 0 means WiFi has no assigned IP
 * ip       : WiFi IP address
 * auth_mode: Not used yet
 * wifi_mode: 0 - STA mode  1 - AP mode (Quick Connect mode) 255 - ignore WiFi mode
 **********************************************************/
typedef struct wifi_info_s {
    uint8 ssid_len;
    uint8 ssid[32];
    uint8 passwd_len;
    uint8 passwd[64];
    uint8 auth_mode;
    uint8 wifi_mode;        // 0: Normal mode 1: Quick Connect mode 255: Only configure country code
    uint8 country_code[2];  // Country code (ISO2)
} wifi_info_t;

typedef struct wifi_status_s {
    uint8 ssid_len;
    uint8 ssid[32];
    uint8 ip_len;
    uint8 ip[16];
    uint8 connect_state;    // 0 - Not connected 1 - Connected successfully 2 - Connecting 3 - Device scanning
    uint8 wifi_mode;        // 0: Normal mode 1: Quick Connect mode
    uint8 country_code[2];  // Country code (ISO2)
} wifi_status_t;
#pragma pack()