Is Multi-Tenant supported by the architecture

I thought I understood, but have recently confused myself. Does the server stack support multi-tenant?

By this I mean: I have one server stack (i.e. mqtt broker, lora server, lora app server) that serves multiple clients each with their own distinct (non-overlapping completely geographically independent) gateways?

When going through the configuration I assumed that this was:

–Organization per tenant with each tenant able to add Gateways (GW’s geographically distinct no shared traffic)
–Same server profile (i.e. all GW’s connecting to same single Network Server)
–Same application (i.e. it’s one type of IoT application across multiple customers)
–Same Device profiles (i.e. it’s one device type for multiple customers)
–Add devices to single app server

For each customer I have a single back office application instance pulling/pushing data off the network stack.

This doesn’t seem feasible if my application pulls stuff based on the application topic as the application is the same for both customers. Is there a way to pull down devices by organization? Should I be using profiles differently.

As I said I think I’ve walked myself into a state of confusion and would appreciate somebody straighten me out on this basic configuration concept and whether it’s easily supported or not. Thanks.

1 Like

Please note that when you’re dealing with multiple geographically distinct locations, you’re probably also dealing with multiple LoRaWAN regions. For each region you need to configure a LoRa Server instance (US, EU, IN, CN, …). These regions are specified by the LoRaWAN Regional Parameters specification.

See for example: https://forum.loraserver.io/t/setting-up-multiple-lora-server-instances-duplicate-routing-profile-error/960

These different LoRa Server instances can still be managed by a single LoRa App Server instance. For this you add each LoRa Server instance under “network-servers”. To assign an organization access to one or multiple network-servers, you create one or multiple service-profiles.

You might want to configure a MQTT prefix per region for LoRa Gateway Bridge and LoRa Server, e.g. for EU you might want to configure the following:

uplink_topic_template="eu-863-870/gateway/{{ .MAC }}/rx"
downlink_topic_template="eu-863-870/gateway/{{ .MAC }}/tx"
stats_topic_template="eu-863-870/gateway/{{ .MAC }}/stats"
ack_topic_template="eu-863-870/gateway/{{ .MAC }}/ack"

Then you configure the same eu-863-870 prefix in your LoRa Server configuration.

To restrict the MQTT data published by LoRa App Server, you need to look into authorization by your MQTT broker (this is out-of-scope of LoRa App Server, but it can be integrated as the used password hash is compatible with various tools available). For Mosquitto you might be interested in: https://forum.loraserver.io/t/restrict-mqtt-broker/748

2 Likes

help me so much, thank!

@brocaar

What if I have a device that supports multiband (868, 915), i will create 2 network server, 2 databases, 2 lora-gateway, 2 mqtt topics, 1 appserver (with 2 service profiles, 2 device profiles, 2 applications). So far this is good, But the problem comes is, when adding same device to each application. The app server cannot accept device with same deveui configured on different applications. I keep getting device exist error.

That leaves me with no choice except to seperate app server one each for 868 and 915. Could you suggest if that’s the only way to configure one device for two bands on 1 app server.

Thank you for your time.

You’re right. This is currently not supported.

@brocaar

i have two appserver configured one per region (eu / us), It could get the whole flow working. But the issue is the when sensor is sending on one region, I am seeing that sensor data on both app server ‘live device frames’ logs. I have made sure that each loraserver is pointing to the correct app server by configuring in it toml file.

We see device frames because in the background it is subscribing to mqtt topics right ? ie uplink_topic_template=“application/{{ .ApplicationID }}/device/{{ .DevEUI }}/rx”

So, If I want to configure a MQTT prefix per region for LoRa app server, how should I configure the MQTT topics. Could you please point me.

Thanks,
Regards,
Revathi