Azure IoT hub
  • 01 Sep 2023
  • Contributors
  • Dark
    Light
  • PDF

Azure IoT hub

  • Dark
    Light
  • PDF

Article Summary

Azure IoT hub

With our Neuron integration "Azure IoT hub" we can send data to an Azure IoT hub. Sensor data will then be forwarded from Neuron to Azure IoT hub every time a new sample is received by the Neuron cloud.

azure.png

Type: Choose "Azure IoT hub" as type.
Name: First give the integration a name. This will not be used by Azure.
Primary Connection String: Then you need to insert the Azure IoT hub primary connection string.

Primary Connection String should look like this

HostName={YourIoTHubName}.azure-devices.net;DeviceId={YourNodeDeviceName};SharedAccessKey={YourSharedAccessKey}

If you already have a Azure IoT hub and a device you can find the connection string in Azure cloud shell with these commands: (Replace the placeholders "YourIoTHubName" and "YourNodeDeviceName")
az extension add --name azure-cli-iot-ext
az iot hub device-identity connection-string show --hub-name {YourIoTHubName} --device-id {YourNodeDeviceName} --output table

Create IoT hub and register a device

If you need to create an IoT hub or register a device first, follow this quickstart from Microsoft.

System: Choose which system to connect to azure.

Several systems

If you need to connect several systems to Azure IoT hub you can just create several integrations.

All sensors: Choose which sensors to integrate with this Azure IoT hub or leave blank to integrate all sensors in system.

Data format

{
  "values": [25.0, 50.0],
  "rssi": -80,
  "time": 1648768543,
  "si": ["°C", "%RH"],
  "pv": 1,
  "type": 1,
  "rawValues": [2500, 5000],
  "sn": "20004321",
  "gatewaySn": "XYZ789",
  "alias": "Sensor1"
}

Explanation

values: an array of n numbers representing the measured values. In this example, it represents temperature in Celsius and relative humidity as a percentage. Position of values matches position of units in the si array.
rawValues: an array of n numbers representing the sensor data before it is parsed and formatted.
rssi: a number representing the received signal strength indicator (RSSI) of the wireless signal.
time: a number representing the timestamp of the measurement, Unix time.
si: an array of n strings representing the units of the measured values (e.g., "°C" for temperature and "%RH" for relative humidity).
pv: a integer representing the primary unit measured by the sensor.
type: a number representing the type of sensor.
sn: a string representing the serial number of the sensor.
gatewaySn: a string representing the serial number of the gateway through which the sensor is communicating.
alias: a string representing a user-defined alias for the sensor.

Security

Data from neuronsensors integrations are sendt from ip address: 35.198.157.9 make sure this is not blocked in your firewall

Disabled integrations

Integrations are disabled automatically after 100 errors. This counter is reduced every successful request, and incremented every error.


What's Next