Aniston NexusDocs
Open Aniston Nexus

Devices and protocols

Model devices and assets with profiles, provision them, secure MQTT with TLS, update firmware and troubleshoot connections.

Devices, assets and profiles

A device sends data (a sensor, a meter, a PLC tag group, a gateway). An asset groups devices or represents something that does not talk itself (a building, a tank, a pump house). Both have a profile:

  • The device profile sets the transport (default, MQTT, CoAP, LwM2M, SNMP), the payload type (JSON or Protobuf), the rule chain and queue its messages go to, provisioning, and the default dashboard.
  • The asset profile sets the rule chain, queue and default dashboard of its assets.

Name profiles after the kind of equipment (Water Level Unit, Energy Meter); the Aniston Nexus dashboards and alarm rules find devices by profile, so a correct profile is what makes a new device show up everywhere.

Entity views expose part of a device (selected keys, a time window) to a customer without sharing the device.

Device APIs

Every device authenticates with an access token (default), an X.509 certificate, or MQTT basic credentials (client id / user name / password). The APIs are listed on Device APIs.

ProtocolPort (local)Notes
MQTT1883, TLS 8883 when enabledv1/devices/me/telemetry, .../attributes, RPC on v1/devices/me/rpc/...
HTTP8080 (behind the TLS proxy in production)POST /api/v1/<token>/telemetry
CoAP5683/udpcoap://host/api/v1/<token>/telemetry
LwM2M5685/udpObject models are uploaded as resources; see the LwM2M device profile
SNMPpolling from the serverConfigured in the SNMP device profile

Provisioning

Devices can create themselves on first contact ("device provisioning" in the device profile): the firmware sends a provision key and secret and receives its credentials. Use one provision secret per profile and keep it out of shared files; the Database/ exporter replaces such values with placeholders.

To create many devices at once, use Devices > + > Import devices with a CSV file, or a script against the REST API (the seed_*.py tools in solutions/ are examples that are safe to re-run).

MQTT over TLS

Enable the MQTT SSL listener in nexus.yml (transport.mqtt.ssl.*, environment MQTT_SSL_ENABLED=true, key store or PEM files), publish port 8883, and give devices the CA certificate. A restart of the backend is needed. X.509 device authentication uses the device certificate's public key as the device credential.

CoAP over DTLS uses the same idea (COAP_DTLS_ENABLED); access-token or X.509 credentials both work.

Firmware updates (OTA)

Upload firmware or software packages under Advanced features > OTA updates and assign them to a device profile or device. Devices learn about a new package through shared attributes (fw_title, fw_version, fw_url …) and report their state in telemetry (fw_state).

Troubleshooting

SymptomCheck
MQTT connection refused (code 5)Wrong access token; tokens are case-sensitive; the device may have been deleted
Connected but no telemetryTopic must be exactly v1/devices/me/telemetry; payload must be a JSON object or array of {ts, values}
Data arrives but no dashboard shows itDevice has the wrong profile, or the dashboard alias filters on another profile/name
Values stored as textThe payload sends numbers as strings ("24.5"); fix the firmware or convert in the rule chain
Old timestampsDevice sends ts in seconds; Aniston Nexus expects milliseconds since the epoch