Aniston NexusDocs
Open Aniston Nexus

LoRaWAN and connecting devices

Connect your ChirpStack network server, manage LoRaWAN gateways and devices, and copy connection settings for any device.

Tenant administrators find two pages under Devices & health in the side menu. They appear when the organization has water monitoring or any other module with devices (BMS, Smart Campus).

  • LoRaWAN (Gateways, Devices, Settings): your ChirpStack v4 network server, from the Aniston Nexus UI.
  • Connect a device: settings you can copy for MQTT, HTTP, CoAP, the gateway (Modbus, BACnet) and LoRaWAN.

LoRaWAN settings

Open LoRaWAN > Settings once:

FieldWhat to enter
API URLThe ChirpStack REST API (chirpstack-rest-api, usually http://chirpstack-rest-api:8090), not the web UI
API tokenAn API key of your ChirpStack tenant (ChirpStack: Tenant > API keys). Write-only: leave it empty to keep the saved one. secret:NAME uses the tenant secret store
ChirpStack tenant ID, applicationWhere gateways and devices go. The application list fills in once the URL and token work
Region / frequency planIndia: IN865
Default ChirpStack device profilePreselected in "Add LoRaWAN device"
MQTT integrationThe broker ChirpStack publishes uplinks to, its user and password, and the uplink and gateway statistics topics (ChirpStack v4: application/+/device/+/event/up and in865/gateway/+/event/stats)
Device profile mappingsPer ChirpStack device profile: the Aniston Nexus device profile of new devices and how decoded keys become telemetry keys, one per line, e.g. distance=levelRawMm. key= with nothing on the right drops the key

Empty fields use the server's defaults (the WATER_LORA_* settings of nexus-services), shown in grey. Test connection checks the tenant, application, device profiles and gateways in ChirpStack and whether the uplink bridge is connected to the broker. Reset to defaults removes the organization's values.

The uplink bridge (one per server, WATER_LORA_ENABLED=true) works for the server's own organization and uses its saved broker, topics and key mappings within 30 seconds of a save. Onboarding works with the bridge off.

ChirpStack must be reachable from nexus-services. A host on a private network (the Docker network, the campus LAN) is called only when it is the host of the server's default API URL or listed in WATER_LORA_APIALLOWEDHOSTS (default chirpstack,chirpstack-rest-api).

Gateways

LoRaWAN > Gateways lists the ChirpStack gateways with their state (online, offline, never seen), the time of their last message and their location. Add gateway takes the gateway ID (EUI, 16 hex digits), name, description and location, adds it to ChirpStack and, unless you switch it off, creates a LoRa Gateway device in Aniston Nexus with gatewayId set, so gateway health and the Gateway Offline alarm work.

Adding devices

LoRaWAN > Devices > Add LoRaWAN device asks for:

  1. Device: DevEUI, name (empty: LoRa-<DevEUI>), label, description.
  2. Activation: OTAA (JoinEUI/AppEUI and AppKey; NwkKey only for LoRaWAN 1.1) or ABP (DevAddr, NwkSKey, AppSKey). Keys go to ChirpStack only. Switch off "Register the device in ChirpStack" when it is already there.
  3. Profile and place: ChirpStack device profile, Aniston Nexus device profile (Water Level Unit, Water Meter, Energy Meter, ...), the tank or asset and the link type (MonitoredBy for tank → level unit).

The device is registered in ChirpStack, created in Aniston Nexus with sensorId = DevEUI and linked to the asset. If a step fails, what was already created is removed, so you can correct the input and try again.

Import CSV does the same for many devices (at most 500 per file). Download the CSV template; the columns are name, devEui, joinEui, appKey, activation (OTAA or ABP), devAddr, nwkSKey, appSKey, chirpstackProfile (ID or name), nexusProfile, asset (ID or name), label, description. Comma or semicolon separated. The result lists every line with "Created" or the reason it failed.

Connect a device

Connect a device shows, for the chosen device, its access token and the exact commands to send telemetry:

TransportSettings
MQTTHost, port 1883 (8883 with TLS), user name = access token, topic v1/devices/me/telemetry
HTTPPOST /api/v1/<access token>/telemetry on this server
CoAPcoap://<host>:5683/api/v1/<access token>/telemetry
Modbus / BACnetThrough the gateway: a gateway device, a connector on the Gateways page, and the gateway's MQTT API
LoRaWANThe LoRaWAN pages above

Send readings with their own time, {"ts": <epoch ms>, "values": {...}}, so buffered data is stored in order. Open it for a device from the LoRaWAN wizard ("Connect a device") or with /connect-device?deviceId=<id>.