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