Wirepas Services Tutorial¶
This step-by-step guide walks you through deploying the Wirepas stack to a fleet of edge devices using Orchestra.
Video Tutorial¶
Before You Begin¶
Make sure you have the following:
Active Orchestra Subscription: For details, see How to Get Orchestra.
Edge Devices Onboarded: Add your devices to Orchestra Manager (see How to add a Device) and ensure they run Orchestra Daemon (orchestrad) version 1.4.13 or higher (see Updating Orchestra Daemon).
Docker Engine Installed: Each edge device needs Docker Engine. Get it here: Install Docker Engine
Docker Compose File Prepared: Save the following YAML configuration as
docker-compose.yml
. We’ll use it shortly.
docker-compose.yml
version: "3.7"
volumes:
dbus-volume:
driver: local
services:
dbus-service:
image: wirepas/gateway_dbus_service:v1.4.5
container_name: dbus-service
restart: always
volumes:
- dbus-volume:/var/run/dbus
logging:
driver: journald
transport-wbs-service:
image: wirepas/gateway_transport_service:v1.4.5
container_name: transport-wbs-service
environment:
WM_GW_ID: --will-be-overridden--
WM_GW_MODEL: --will-be-overridden--
WM_GW_VERSION: --will-be-overridden--
WM_SERVICES_MQTT_HOSTNAME: --will-be-overridden--
WM_SERVICES_MQTT_PORT: --will-be-overridden--
WM_SERVICES_MQTT_USERNAME: --will-be-overridden--
WM_SERVICES_MQTT_PASSWORD: --will-be-overridden--
restart: always
depends_on:
- dbus-service
volumes:
- dbus-volume:/var/run/dbus
logging:
driver: journald
sink-service:
image: wirepas/gateway_sink_service:v1.4.5
container_name: sink-service
restart: always
privileged: true
depends_on:
- dbus-service
environment:
WM_GW_SINK_BAUDRATE: 125000
WM_GW_SINK_ID: 1
WM_GW_SINK_UART_PORT: --will-be-overridden--
volumes:
- dbus-volume:/var/run/dbus
logging:
driver: journald
- Gather Variables: You’ll need values for these variables during the deployment process.
WM_SERVICES_MQTT_USERNAME
WM_SERVICES_MQTT_PASSWORD
WM_SERVICES_MQTT_HOSTNAME
WM_SERVICES_MQTT_PORT
WM_GW_MODEL
WM_GW_VERSION
WM_GW_ID
Deployment Steps¶
We’ll divide the deployment into several key stages.
Step 1: Create a New Fleet¶
Fleets group your devices for easier management. Here’s how to set one up:
Open Orchestra Manager: Navigate to Orchestra Manager in your web browser.
Go to Fleets: Use the sidebar and click on “Fleets.”
Add a New Fleet: Click the “Add” button in the top-right corner.
Configure the Fleet: Give your fleet a descriptive name and select the target devices for your Wirepas deployment.
Once created, your fleet will be visible:
Step 2: Create a Composition¶
Think of a composition as the blueprint for your application.
Step 3: Create the First Composition Version¶
Each composition can have multiple versions, allowing you to manage updates effectively.
Step 4: Attach Composition to the Fleet¶
Now, let’s link your composition to the target fleet of devices.
Step 5: Setting Variables at the Composition Level¶
Variables provide customization for your deployment.
- Variable Scopes in Orchestra: Understand the hierarchy:
Device: Unique to a single device.
Fleet: Applies to all devices within a fleet.
Composition: Specific to an application composition.
Global: Universal settings across all devices and compositions.
- Inheritance: Variables inherit values from broader scopes:
Global > Composition > Fleet > Device (More specific settings override broader ones).
Add Composition Variables:
Go to the “Variables” tab of your composition.
Click “Add” to introduce a new variable.
Start with
WM_SERVICES_MQTT_HOSTNAME
– provide your actual hostname as the value.Repeat the process to add these variables, providing their values:
WM_SERVICES_MQTT_USERNAME
WM_SERVICES_MQTT_PASSWORD
WM_SERVICES_MQTT_PORT
Step 6: Fleet-Level Variables¶
For environmental variables common to all devices in the fleet:
Step 7: Device-Level Variables¶
If needed, set individual device variables:
Go to Device Variables: Navigate to a device within your fleet and access its “Variables” tab.
Confirm Inheritance: Check if the variables from the fleet and composition levels are correctly inherited.
Add Gateway ID: Add the
WM_GW_ID
variable, specific to this device.Add another device-level variable:
WM_GW_SINK_UART_PORT
for example value can be/dev/tty/ACM0
.Repeat for Other Devices: Assign a unique
WM_GW_ID
to each device in your fleet.
Step 8: Release Your Composition¶
Time to deploy!
Checking Deployment Success¶
Go to Device Details: On your fleet’s “Compositions” tab, click a device’s ID to see its details.
Open Terminal: In the device details, go to the “Terminal” tab and start a new terminal session.
List Containers: Run the command
docker ps
to view active containers. This confirms successful deployment.
Next steps¶
Next, you can Configuring Sink via CLI on Gateway.
Need Help?¶
Reach out through our Customer Portal if you encounter any issues.