Deploying The Solution

This guide provides step-by-step instructions to set up and deploy the LE Sparkplug Edge Node solution on your Litmus Edge device.
Before proceeding, ensure you have the following:
- Litmus Edge 3.16.x or later.
- MQTT Broker connection details (URL, username, password). The solution supports MQTT Protocol versions 3.1.0 and 3.1.1.
Download the LE Sparkplug Edge Node image (LE Sparkplug Edge Node vx.x.x) from the Central Portal website via the Download button.
- Log in to your Litmus Edge instance and navigate to Applications > Images.
- Click the Upload Image (+) icon, select Upload, choose the downloaded image file (le-sparkplug-x.x.x.tar.gz), and click Import. The image may take a few moments to appear in the list.
You can deploy the application using either a configuration file (recommended) or environment variables.
This method uses a JSON file to manage all configuration settings, making it easier to handle complex configurations like TLS.
- Download the configuration flow LE Sparkplug Edge Node - Flow from the download page.

- Update the config file with valid configuration values and trigger the flow to create the file. Next, see the Run the Docker Container section below.
For optional settings like enabling Primary Host support, Store and Forward, configuring TLS, or adjusting logging levels, add the corresponding fields to this JSON file. Refer to the Environment Variables documentation for all available fields and the TLS Certs guide for TLS setup.
Run the Docker Container:
Use the docker run command, mounting the directory containingconfig.json to /le-sparkplug/data/ inside the container. Replace <imgName>:<tagName> with the actual image name and tag you uploaded (e.g., us-docker.pkg.dev/litmus-customer-facing/litmus-solutions/le-sparkplug:1.4.4).
This method is an alternative if you prefer not to use a configuration file. Required settings are passed directly via -e flags.
Run the Docker Container: Provide the required configuration values using environment variables. Replace placeholders (<...>) and <imgName>:<tagName>.
docker run Example:
The MQTT_SERVERS value is a JSON string. Ensure proper escaping of quotes!
For optional settings, add more -e flags. Refer to the Environment Variables documentation for all available environment variables. To configure TLS, you need to embed the base64-encoded certificates within the MQTT_SERVERS JSON string. See the TLS Certs guide.
That's it! Your LE Sparkplug Edge Node application should now be running on your Litmus Edge device. 🎉
You can also run the LE Sparkplug Edge Node container on a separate machine (e.g., your laptop, a server) and connect it back to your Litmus Edge instance. This requires specific prerequisites and configuration adjustments.
Prerequisites for Running Externally:
- NATS Proxy Enabled: Ensure the NATS Proxy is enabled on your target Litmus Edge device. Navigate to System > Services > NATS Proxy in the Litmus Edge UI and enable it if necessary.
- API Account Token: You need an API Account Token. Follow the instructions in the Create an API Account guide to generate one. This token is used in the NATS_URL.
- Edge Hostname/IP: You need the hostname or IP address of your Litmus Edge device, accessible from the machine where you will run the container.
Configuration:
When running externally, you must provide two additional configuration parameters:
- edge_hostname (JSON) / EDGE_HOSTNAME (Env Var): The hostname or IP address of your Litmus Edge device.
- nats_url (JSON) / NATS_URL (Env Var): The connection string for the Litmus Edge NATS broker. Format: tls://admin:<Your API Account Token>@<EDGE_HOSTNAME>:4222
If the machine running the container is on the same local network as the Litmus Edge device and you encounter TLS certificate errors, try replacing tls:// with nats:// in the nats_url / NATS_URL. For example: nats://admin:<Your API Account Token>@<EDGE_HOSTNAME>:4222.
Deployment Examples for External Execution:
Update your config.json file:
Run the container, mounting the config file (ensure the container can access the path):
Adjust the volume path (/path/to/your/config/dir/) to the location of your config.json on the external machine.
/path/to/your/config/dir/ must contain a folder named config with the config file config.json
Run the container on your external machine with additional environment variables:
Add other optional -e flags as needed.
To verify that the container is running correctly, you can check the logs:
You should see logs indicating that the container is running and connected to the MQTT broker.