atin's picture
IoT gateway

Selecting right IoT Gateway for your IoT application

An Internet of Things (IoT) gateway is a physical device or software application that serves as the point of connection between the IoT application server and end devices. All data moving to and from the IoT application server goes through the IoT Gateway. IoT Gateway are the most important part of your IoT infrastructure choosing one wisely is most important for success of your project. You can choose from the following two IoT architecture:

A. Each end device has inbuilt IoT Gateway functionality - example an AMR energy meter. This approach is useful when the device is self contained and does not require any external sensors or devices to be connected to it. It requires a custom device to be developed and only makes sense when volumes are high.

B. Each end device connect to a central IoT Gateway - example multiple energy meter connecting via a RS485 bus to a central IoT Gateway. This approach is useful when you need to integrate external sensors and devices. You can leverage off the shelf components, reducing both time and cost of the project.

iot gateway

 

The IoT Gateway serves two important functions in an IoT application:

  1. Provides secure upstream WAN and downstream LAN connectivity
  2. Host and run the edge embedded application

 

1. Provides secure upstream Internet and downstream LAN connectivity

This function of an IoT Gateway is similar to a router:

  • The IoT Gateway provides single point  Internet connectivity and packet routing between the downstream devices and IoT application server by using WiFi, GSM, or some other type of internet connectivity. This layer uses TCP/IP for communication.
  • The IoT Gateway creates a LAN (Local Area Network) using that the downstream devices like sensors, actuators etc. can connect to the IoT Gateway. The LAN could be a wired, wireless, mesh or P2P. The local area network created may or may not be TCP/IP driven.
  • Acts like a firewall and provides secure data connectivity between the following two legs of data communication:
    • End device to IoT Gateway
    • IoT Gateway to IoT application server

2. Host and run the edge embedded application

The IoT Gateway has an inbuilt microcontroller or microprocessor that provides an application environment. The edge application runs within this application environment. Few of the functions the edge application is responsible for are as follows:

  1. Authentication & Authorization -Provide secure connectivity
  2. Messaging and communication protocol implementation
  3. Provisioning of IoT Gateway or end devices on the central IoT application
  4. Device Management - OTA, Config, Diagnostics etc.
  5. Data acquisition and  local storage
  6. Local discrete or scheduled logic control

Architecture of an IoT Gateway Device

 

Hardware Architecture

 

Hardware Architecture

 

Embedded Software Architecture

Hardware Architecture

IoT Gateway Selection

  1. The right procedure to select the IoT Gateway is to first list your requirements as follows:
    1. IO & Interface requirements e.g.
      1. 1 x RS232
      2. 1 x RS485
    2. Network requirement e.g.
      1. 1 x GPRS
      2. 1 x Ethernet
      3. 1 x Zigbee
    3. Development environment e.g. C or Python
    4. Memory requirements to run your edge IoT application
    5. Flash required
    6. Power rating
    7. Certifications- CE, RoHS etc
  2. Once you have listed the above you can look for IoT Gateways available in the market that meet your requirements.

 

IoT Gateway Mandatory Features

With our experience for running thousands of IoT Gateways across multiple applications, we have created a mandatory feature list that would help you select a IoT Gateway that would make your solutions robust, secure and reduce total ownership cost:

  1. Memory for Data Logging - IoT relies on the internet as the main communication channel between the IoT devices and the IoT application server. The IoT edge application running on the IoT Gateway would usually be acquiring data from end devices and pushing it to the IoT application server. In the case when internet on the IoT Gateway is down it should have enough memory to store at least a few days of data and even more in case of difficult to reach sites or sites with poor network connectivity. This will prevent any data loss in absence of internet to upload it to the server.
  2. HW watchdog external to the Microcontroller - This feature will save you many site visits when you’re IoT Gateway, hangs or becomes unresponsive. Most microcontrollers have an internal watchdog but this would only restart the microcontroller in case of edge application hanging. In case the microcontroller itself hangs, e.g. microcontroller becoming unresponsive in cases of an external noise on one of the interfaces, the external watchdog will still do the job of restarting the microcontroller.
  3. Isolation on all external interfaces i.e. Digital, Power, or Analog - This would prevent external electrical noise from reaching the microcontroller and leading to it becoming unresponsive. It also offers the additional advantage of providing electrical isolation of digital signals, allowing for higher signal levels, reducing component damage, avoiding ground loops, and allowing for safer interfacing to external devices. You can read more about it here http://www.ti.com/lit/wp/slyy112/slyy112.pdf.
  4. LED Indications - LED indications are good for fast troubleshooting on site. E.g. a GSM network LED can help diagnose connectivity issues without the device being connected to a computer for further troubleshooting. A Rx/Tx LED on the RS232 or RS 485 port can help diagnose communication issues. This is usually very useful feature for your field team for troubleshooting issues in the field.
  5. RTC (Real Time Clock) - Most IoT application rely on data being accurately stamped. Most IoT Gateways that do not have an RTC clock rely on the network time to timestamp the data. This approach has a serious problem in case the device reboots and there is no network to update the current time. In this case, the data would be time-stamped wrongly. An RTC allows accurate time stamping of data even if a reboot occurs in absence of network time source.
  6. Time synchronization via NTP, GSM, or GPS - The RTC clock would slowly drift and would slowly develop a clock error. One needs to synchronize the RTC with an accurate time source via NTP or GPS or GSM network. The IoT Gateway should support RTC synchronization from one of these sources. If you require very accurate timestamps choose IoT Gateway that has a GPS inbuilt into it.
  7. OTA (Over The Air) programming and firmware upgrade - Imagine you had to go to the Microsoft store for every update to your windows software, what a waste of time and money. Similarly, without OTA feature on your IoT Gateway, you will have to go out to the device site, connect it to your computer, and reprogram it. This would cost you a lot of money and make any IoT project unviable.
  8. Remote Reboot - We all would have experienced that at times the only option to resolve an issue with electronic system is to reboot the system. This feature can help you recover from faults, which have no other solution.
  9. Remote Diagnostics - An IoT Gateway that sends diagnostics data to the application server helps you identify issues more effectively. This can reduce a lot of time and money spent on troubleshooting issues. E.g. GSM network strength diagnostic information can help troubleshoot sites with GSM network issues.
  10. TLS, SSL and Client side X509 Certificate Support - The TCP stack used in the IoT Gateway should support TLS and client-side certificate to secure connection between the IoT Gateway and the IoT application server.
  11. TPM for certificate storage and identity management - If you have devices that are installed in a location where anyone can physically access them you run a chance of device credentials stored directly on the device (in the application code or a configuration file) being stolen. Devices equipped with TPM store device credentials in a dedicated TPM device. Credentials stored in TPM cannot be read or duplicated even if someone has physical access to the device. However, this is not a mandatory feature on our list but can add an added layer of protection for IoT applications requiring high security level.
  12. Open Application Environment - The IoT Gateway application framework should be open to developers to develop an application on top of it so that the IoT Gateway does not lock you to a cloud or IoT application vendor. You can anytime replace the application with any other edge application to support the new IoT application service provider.

The above 12 features can save you a lot of money and time in the end. Choose the IoT Gateway wisely as it is one of the most important piece of the IoT infrastructure. It would typically constitute 10% of the total IoT project cost. Wrong selection of the IoT Gateway can lead to failure and huge support costs in the long run.

IoT Project Capital Cost Breakdown