Rajkumar
Rajkumar

Reputation: 345

Gateways in Hono

I am in the process of evaluating HONO for IOT stack. We have scenarios where an intermediary device would send telemetry data for other devices. Communication through an Intermediary device is referred as a Gateway in Hono. I have found how to send messages through Gateways.

I am not sure on the following queries.

  1. How to register the Gateway? Should it be registered as an ordinary device or anything else should eb done?
  2. How would Hono verify if the message is indeed sent from the device whose device ID is specified? Any option to authenticate the real sender of the message?

Upvotes: 0

Views: 134

Answers (1)

Kai Hudalla
Kai Hudalla

Reputation: 861

  1. Yes, a gateway needs to be registered as a normal device with its own device ID and credentials.
  2. In order for a gateway to be allowed to publish data on behalf of another device, that other device needs to have its via registration property be set to include the gateway's device ID. Example: your gateway device has ID GW1 and you have a device with ID DEV1. Then the registration information for the device should look like this:
    {
      "via": [ "DEV1" ],
      ...
    }
    
    When the gateway then connects to the adapter and is successfully authenticated, it can publish data on behalf of another device by means of indicating the device ID in the URI, topic, address as described by the user guides of the adapters. The adapters then verify, if the gateway ID is listed in the device's registration information's via property and if not, rejects the data. The adapter thus delegates authentication of the device to the gateway.

Upvotes: 1

Related Questions