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 with the guide, make sure you have the following prerequisites:
- Litmus Edge API Token. Please follow the Create an API Token instructions to obtain the API token. (Optional with Litmus Edge Manger v2.9.x and later)
- MQTT Broker connection credentials. The solution supports MQTT Protocol versions 3.1.0 and 3.1.1.
There are two methods to deploy the solution.
- Download the LE Sparkplug Edge Node image from the Central Portal website by clicking on the Download button and selecting the appropriate version (LE Sparkplug Edge Node vx.x.x).
- Log in to your Litmus Edge and navigate to Applications > Images.
- Click the Upload Image (+) icon, select Upload, and then select the downloaded image (le-sparkplug-x-x-x.tar.gz), and click Import. It may take a while for the image to appear.
- Use the docker run command to run the application, providing the required environment variables. For example:
Additionally, the following optional fields can be included in each MQTT Server Object to configure TLS settings for the server:
- ca_cert: Base64-encoded string representing the CA certificate that should be used to verify the MQTT server's certificate.
- client_cert: Base64-encoded string representing the client certificate that should be presented to the MQTT server during the TLS handshake.
- client_key: Base64-encoded string representing the private key that should be used with the client certificate.
- skip_cert_verify: Boolean indicating whether certificate verification should be skipped during TLS handshake. If this field is set to true, the MQTT client will not verify the server's certificate, and the connection will be vulnerable to man-in-the-middle attacks. This field should only be set to true for testing and debugging purposes.
If any of the optional fields are included in an MQTT Server Object, the MQTT client will use them to configure TLS settings for that server. If any of the fields are missing or invalid, the MQTT client will use default settings. Please follow the instructions in TLS Certs to encode the certifications in base64 strings.
For example:
Please refer to the Environment Variables used by the application.
Alternatively, create a JSON configuration file with the provided flow (RECOMMENDED).
- Download the flow from the downloading page by clicking on LE Sparkplug Edge Node - Flow
Here's an example of a JSON configuration file:
- Use the docker run command to run the application, mounting the configuration file's directory. For example:
- Download the catalog JSON file by clicking on Litmus Edge Manager - App from the downloading page:
- Import the LE Sparkplug Edge Node application to your catalog by using the catalog JSON file. Refer to the instructions on Marketplace: Catalogs and Applications for more details.
- Download the Litmus Solutions Registry from the downloading page:
- Deploy the application to your Litmus Edge device by following the instructions in Deploy an Application to Edge Devices or by using the Marketplace in Litmus Edge, as explained in Deploy a Marketplace Application.
Note: Before deploying the application, make sure to Provision a connection between the edge device and Litmus Edge Manager.
That's it! Your LE Sparkplug Edge Node application should now be running on your Litmus Edge device. 🎉