Azure Service Bus integration

The next LoRa App Server release will contain support for Azure Service Bus integration. This will make it possible to let LoRa App Server publish events to a Service Bus topic or queue, to which other applications or Azure services can subscribe.

The configuration will be:

  # Azure Service-Bus integration.
  [application_server.integration.azure_service_bus]
  # Connection string.
  #
  # The connection string can be found / created in the Azure console under
  # Settings -> Shared access policies. The policy must contain Manage & Send.
  connection_string=""

  # Publish mode.
  #
  # Select either "topic", or "queue".
  publish_mode=""

  # Publish name.
  #
  # The name of the topic or queue.
  publish_name=""

If you’re interested to test this out, this feature has been merged into the master branch :slight_smile: Looking forward to your feedback!

3 Likes

Hi @brocaar,

Would you kindly please clarify this post. Is LoRa App Server and ChirpStack Application Server the same thing? If so is this config supposed to be set in the chirpstack-application-server.toml? I would like to try it out and I will absolutely feedback, as soon as I am clear how this is implemented.

Regards

I have some feedback on how far I have gone with the Chirpstack Azure Service Bus integration. Let me point out early on, that the entire ChirpStack is still a learning curve for me so please bear with, however I wish to provide as much detail as possible.

My setup:
I have two Elsys sensors, a Temp & Humidity sensor and then a Movement sensor connecting to a Mikrotik Lora 8 kit. This Lora 8 kit has a preinstalled UDP packet forwarder to any public or private LoRa servers. Both sensors are on a Timebase of 90 seconds.

Then I’ve got a ubuntu 18.04 host running ChirpStack Network Server, ChirpStack Application Server and ChirpStack Gateway all on that single virtual machine.

I am able to see uplink device data via the ChirpStack App from both the Motion sensor.
image

and the Temp and Humidity sensor.

Azure Service Bus integration.
For this I have edited two of the ChirpStack config files i.e. chirpstack-network-server.toml & chirpstack-gateway-bridge.toml

Here is my chirpstack-network-server.toml edits

# Azure IoT Hub backend.

# Azure IoT Hub backend.
#
# Use this backend when the ChirpStack Gateway Bridge is configured to connect
# to the Azure IoT Hub MQTT broker.
[network_server.gateway.backend.azure_iot_hub]

# Events connection string.
#
# This connection string must point to the Service Bus Queue to which the
# IoT Hub is forwarding the (uplink) gateway events.
events_connection_string="{my service bus queue connection string}"

# Commands connection string.
#
# This connection string must point to the IoT Hub and is used by ChirpStack Network Server
# for sending commands to the gateways.
commands_connection_string="{my IoT hub connection string}"

Here is my chirpstack-gateway-bridge.toml edits

# Azure IoT Hub
#
# This setting will preset uplink and downlink topics that will only
# work with Azure IoT Hub service.
[integration.mqtt.auth.azure_iot_hub]

# Device connection string (symmetric key authentication).
#
# This connection string can be retrieved from the Azure IoT Hub device
# details when using the symmetric key authentication type.
device_connection_string="{device connection string}"

# Token expiration (symmetric key authentication).
#
# ChirpStack Gateway Bridge will generate a SAS token with the given expiration.
# After the token has expired, it will generate a new one and trigger a
# re-connect (only for symmetric key authentication).
sas_token_expiration="24h0m0s"

# Device ID (X.509 authentication).
#
# This will be automatically set when a device connection string is given.
# It must be set for X.509 authentication.
device_id=""

# IoT Hub hostname (X.509 authentication).
#
# This will be automatically set when a device connection string is given.
# It must be set for X.509 authentication.
# Example: iot-hub-name.azure-devices.net
hostname=""

# Client certificates (X.509 authentication).
#
# Configure the tls_cert (certificate file) and tls_key (private-key file)
# when the device is configured with X.509 authentication.
tls_cert=""
tls_key=""

Now does it all work?
I am not sure whether I have this set up correctly or not but I can see Incoming Requests on the Azure Service Bus metrics in the overview. Strangely though, the requests appear on Azure metrics only when I am running the Lora App in my browser. Super odd. When I logout, there are no requests to the Azure service bus.

image

Telemetry
I can simulate telemetry messages with Python code and send them to my device on Azure IoT hub but I don’t yet know how to get my uplink data on LoRa App to be ingested by Azure IoT hub. This workflow is not yet clear to me at present. If anyone has any pointers, I could find it useful.

Regards

Hi @brocaar

Reviewing the latest version of ChirpStack, I could not locate the configuration lines you mentioned for inputting the Azure Service Bus credentials, such as the connection string, publish mode, and publish name. It seems that the setup process might have changed since then.

As this integration is crucial for our project, I would greatly appreciate it if you could help me with the updated steps or provide any additional resources on how to achieve this integration of Azure Service bus with the current version of ChirpStack.

Allow me to explain my setup in detail. Presently, I have installed ChirpStack Gateway OS on my Raspberry Pi, complemented by the SX1302 RPi HAT. The Gateway OS has been deployed with the full image.

In relation to this setup, I have a few queries:

  1. Upon launching ChirpStack OS, I gain access to two web interfaces. One interface facilitates the configuration of the gateway concentrator and the setup of the Wi-Fi network, along with other gateway-specific settings. The other web interface serves the purpose of managing gateways, applications, and devices. I presume that the first web interface is tailored to the ChirpStack Gateway OS, while the second web interface is linked to the ChirpStack Network Server.And also applicaion and network server are merged,right? Kindly correct me if my assumption is erroneous.

I greatly appreciate your assistance in resolving these doubts and helping me gain a clearer understanding of my ChirpStack setup.

Looking forward to your guidance and eager to explore this feature!

Best regards,
Abhithlal C

Please see the Service Bus integration in the web-interface :slight_smile:

Thank you for the response,

I tried to locate the Service Bus integration in the web interface as you suggested, but unfortunately, I couldn’t find it.
These are the images of my web interfaces:


If possible, could you kindly provide more details or specific steps on how to access the Service Bus integration in the web interface? This additional information would be greatly appreciated and could help me find the feature successfully.

Discovered the service bus integration and all supported integrations, navigate to the ChirpStack web interface under “Tenants” → “Applications” → “Integration”.
I used the chirpstack Gateway OS - full image → version of ChirpStack gateway OS being used.-here