Protocol Gateways


Protocol Gateways are responsible for running the gateway logic, analyzing and generating model/product/device data or updating device data after receiving the corresponding data specified by the device protocol. The generated data will be in the EnOS Management Console and the subsequent updating of the device data can be done using protocols such as MQTT.


You can create, view, edit, delete, and start/stop the protocol gateways. You can also export protocol gateway details in JSON and use it to import a new protcol gateway with the same configuration.

Before You Start

  • You need to be assigned the Device Management Administrator policy. If you are not assigned, contact your OU administrator. For more information about policies in EnOS, see Policies, Roles, and Permissions.

  • Ensure that you have created the required Network Module and Device Protocol.

  • Ensure that you have applied for the Protocol Gateway Resource at EnOS Console Management > Resource Management > Resource List. For more information about requesting resources, see Resource Management on EnOS.

Managing Protocol Gateways

Creating Protocol Gateways

  1. Log in to the EnOS Management Console, go to Device Onboarding > Protocol Gateways > Private Gateways, and you will see the list of protocol gateways that have been created.

  2. Click New Protocol Gateway.

  3. You can create a protocol gateway from scratch or create it based on template. To view the list of available templates and their details, go to Protocol Gateways > Public Gateways. For more information, see System-Defined Templates.

    • Create from Scratch: Proceed to the next step.

    • Create from Template: Select a template from the Template drop-down and proceed to the next step. Type, Network Module, and Protocol Route will be auto-filled based on the selected template.

  4. Fill in the information as per the below.

    • Name: Enter a name for the protocol gateway. You can click the Internationalization icon btn_internationalization to enter customized names for different locales.

    • Type: Select the network module type.

    • Network Module: Select the network module. The choice of network module will determine the protocol connection method. For more information on how to establish a connection using MQTT/Websocket protocol, see Establishing Connection Using MQTT/WebSocket Protocols.

    • Protocol Route: Click + URL to map a URL route to a device protocol. Enter the route starting with “/”, and select the device protocol to map it with. The maximum number of routes that you can add is 5.


      The choice of the device protocol will determine the data processing method. By mapping protocols to different routes, the same protocol gateway will be able to handle different requests.

      • For example, for HTTP protocol, mapping “/createDevice” and “/updateModel” routes to the corresponding device protocols for creating a device and updating a model enables the creating of device and updating of model when sending a POST request to http://URL/createDevice and http://URL/updateModel respectively.

      • For MQTT/WebSocket, the routes are the topics. For example, the subscribe topic for “/createDevice” would be /createDevice_reply and the publish topic would be /createDevice.


      For more information on how to generate the URL for different protocols, see Generating URL.


    • Authenticate Token: Toggle on the switch for token authentication for added security. If toggled on, there is a need to add the token information in the header for HTTP and in the client ID for MQTT/WebSocket during connection. For more information on how to generate the token and how to use it, see Generating and Using the Token.

    • Access Key and Secret Key: The access key and secret key of the application that you have registered in Application Registration. The keys are used for permission-related verifications, such as checking whether an application has the permission to create a device or update a model.

    • Description: Enter a description for the device protocol.


    ../../_images/protocol_gateway_create.png


  5. Click OK to create the protocol gateway, and it will appear in the list of private gateways with a system generated ID.

Viewing Protocol Gateways

  1. The list of created protocol gateways is displayed in Device Onboarding > Protocol Gateway, where the time the gateways are created, their IDs, names, respective notwork modules, and status (Starting, Started, Not Started, Stopped, Failed) are shown.

  2. Locate the protocol gateway you wish to view from the list and click the View icon btn_view.

  3. The details of the protocol gateway will be displayed in the pop-up-window.

Editing Protocol Gateways

  1. In Device Onboarding > Protocol Gateway, locate the protocol gateway you wish to edit from the list and click the Edit icon btn_edit. Note that protocol gateways with a Started or Starting status cannot be edited.

  2. All fields can be edited, except for Protocol ID.

  3. After editing, click OK to save the changes.

Exporting Protocol Gateways

You can export the details of the protocol gateway in JSON, after which you can either use it as it is or edit it and then import it as a new protocol gateway.

  1. In Device Onboarding > Protocol Gateway, locate the protocol gateway you wish to download from the list and click the Download icon btn_download.

  2. Save the JSON file.

Importing Protocol Gateways

You can import protocol gateways using a JSON file. For the required details, refer to the downloaded file in Exporting Protocol Gateway Details.

  1. In Device Onboarding > Protocol Gateway, click Import.

  2. You can either drag and drop a JSON file in the pop-up window or click it to select a JSON file to upload.

  3. Click OK to import the protocol gateway.

Deleting Protocol Gateways

  1. In Device Onboarding > Protocol Gateway, locate the protocol gateway you wish to delete from the list and click the Delete icon btn_delete.

  2. Deleted protocol gateways cannot be recovered. To delete the protocol gateway, click the Delete button in the pop-up window.

Allocating Runtime Resource

The default runtime resource allocated for each protocol gateway is 1. You can change the allocation if required.

  1. In Device Onboarding > Protocol Gateway, locate the protocol gateway you wish to allocate resource for from the list.

  2. Click … > Allocate Resource. Note that the allocation cannot be changed while the Status of the protocol gateway is Starting or Started.

  3. Edit the Single Instance Resource accordingly.

    • Single Instance Resource: Represents the computing resources consumed by each protocol gateway in CU. It is recommended to allocate more resources for complicated device protocol logic as that requires more resources for computing. The maximum computing resource for a single instance is 8 CU.

    • Total Runtime Resource: The total amount of Protocol Gateway resource applied for your OU.

    • Remaining Resource: The remaining resources you can use.

  4. Click OK to save the changes.

Starting and Stopping Protocol Gateways

  1. In Device Onboarding > Protocol Gateway, locate the protocol gateway you wish to start or stop from the list and click … > Start Gateway or … > Stop Gateway.

  2. The status column will reflect the changes accordingly.

  3. After starting the protocol gateway, requests can be sent through the network protocol defined in the network module.

Note

It takes about 3 to 5 minutes after clicking Start Gateway to change to an Started status. Refresh the page to reflect the changes.