Get Started With IoT Cloud Development

The purpose of this article is to streamline the topics which are needed to become an IoT cloud developer. There are two parts of cloud development with respect to IoT.
First, there are some cloud-managed API's that the public cloud (AWS, AZURE) provides to cater to some basic IoT use-case like bi-directional communication with the device and device provisioning, etc.
Secondly, in some IoT products at the top of these cloud-managed APIs, you might need some custom APIs to cater to your business needs which could be developed in any programming language at the top of these cloud services.

Cloud IoT Service

As we have different cloud vendors AWS, Azure, GCD  all of these vendors offer IoT offerings but we will be discussing Azure in this blog. Azure provides matured IoT services to take your business to the next level with the ease of customization and scalability.
So the first challenge we face in the IoT product is to connect our device with the outside world so it can communicate back and forth with some control unit to perform some smart actions.

Azure IoT hub

Azure IoT Hub is a service that allows a bi-directional communication with the device, which means you can send messages from device to cloud and cloud to device in a seamless manner, To get started with it you just have to register your device on IoT hub and it will give you a connection string with which you can open a communication channel from your device to cloud.
The IoT hub provides a different mode of communication, which are the following:
  1. HTTPS
    This mode of communication is not recommended as it is pulled base mechanism so the device will pull messages from the IoT hub after some fixed interval of time.

  2. MQTT
    It is an efficient way of communication the messages are pushed immediately to the device and communication is seamless but the message at the device level could not be rejected so there could be some synchronization issues.

  3. AMQT
    This is the most robust mechanism larger payload could be handled. In this mode of communication, you can reject, accept and abandon the message in the case of abandoning the IoT hub will send the message again.
Other than this the IoT hub also provides the direct method call option so we can directly invoke a method of the firmware on the device it is for the long message or configuring a device.

Azure DPS

Azure device provisioning service as it is evident from the name of the service is meant to provision the device on the IoT hub, so when we are developing an IoT solution we are dealing with millions of devices and we can’t provision each device manually into our system for this use case the Azure DPS provides a systematic approach.
Azure DPS provides an automated way of provisioning device on IoT hub to provision the device on the IoT hub we first need to authenticate it the Azure DPS. There are multiples ways to authenticate the device some are:
  • Symmetric Key
  • Certificate
  • TPM (Trusted platform module )
So the device will have either a symmetric key or certificate which will be added in it during manufacturing so the DPS will authenticate the key and provision the instance of the device on IoT hub and will send back connection string to the device so it can start communication.

Stream Analytics

The most important part of any IoT solution is to take the meaning out of the information that is being generated from the device and make some smart decision on the basis of it, so the message we are getting from IoT hub is we can route it to the stream analytics which will process each message.