7 things to keep in mind while building software for the consumer IoT domain
Whether you’re a tech person or not, I am sure you’ve come across the term IoT. IoT has gained a lot of popularity in the past decade or so owing to the dawn of ‘smart’ appliances. Be it home lighting or tiffin boxes, everything today has a smart edge.
The emergence of IoT is an integral part of the fabled Industry 4.0 revolution!
Before we can explore best practices for building software for IoT, let us begin by understanding what IoT is.
Internet of things (IoT) is any device (or group of devices) with sensors, that can connect to the internet and to a software (backend infrastructure) which will collect, exchange, & analyze data; derive inferences out of it and give some intelligence to the users/business.
In short, IoT devices are incomplete without an active connection with the internet or other communication networks and a software interface to control/manage the device and store & analyze the data collected from the IoT sensors.
Applications of IoT:
IoT has applications in many areas including Healthcare, Logistics, Agriculture, Hospitality, Smart Energy, Smart Cities, Automobile, and Supply chain management.
Be it your latest smart watch, or a swanky mood lighting system, the IoT revolution is everywhere.
IoT sensors in vehicle fleets are helping track fleet status in real-time while smart grids have revolutionized electricity delivery.
IoT sensors in medical devices are also helping save lives by monitoring patient’s condition in real-time and alerting doctors when attention is needed.
There is practically no area that IoT hasn’t touched!
One such vital area of IoT application is Consumer IoT. Consumer IoT means nothing but consumer devices (like watches, lights, tiffins etc.) connecting to the infrastructure and giving users the control to operate these smart devices via a software interface.
We, at IncubXperts have extensively been building software solutions for the consumer IoT domain.
Ranging from a mobile app which ensures that a hot meal is always ready for you to a gamified mobile solution which is helping wood stove users in North America to reduce the environmental impact of their stove.
We have built these solutions on an IoT platform using MQTT or HTTP communication along with an IoT board to communicate with the server.
7 Things to keep in mind while building software for the consumer IoT domain:
Based on our experience, here are 7 things to keep in mind before building software for consumer IoT:
Given that IoT devices are connected to the internet, it makes/leaves them vulnerable to malware or malicious activity. Which makes it paramount to have a provision for the security of the IoT device(s).
Security To do’s for IoT software:
- Make sure that the device is always secured, and only authorized components can communicate with the device. As IoT devices are mostly to be found on home or industry Wi-Fi networks, the IoT device are connected to the internet and can become a target of a malware or malicious activity.
- Secure the device and make sure that only authorized & authenticated devices can communicate with IoT
- Leverage platforms like Azure IoT or AWS IoT having inbuilt secure provisioning mechanism. The device gets provisioned using these mechanisms which are secure and only allow certificate sign-in payloads to be sent
2. Having a provision to update the device on the fly
Here’s what we suggest:
- To overcome such an issue, it makes sense to have an OTA (Over the air) provisioning mechanism in place. Just like our mobile phones receive the latest updates, OTA will enable IoT devices to receive instant updates.
- As a smarter alternative to writing own firmware from scratch, a ready to ready to use solution like Mongoose OS or ready to use platforms like Raspberry pi (a full-fledged OS) should be used.
- In case you’re dealing with smaller devices like ESP32 or ESP8266- these micro boards have a provision of receiving OTA updates when you use operating systems like Mongoose design or setup mechanism to receive OTA from your servers.
If your product finds its rightful place in the market, the sales will skyrocket, and you will soon have millions of devices connecting to your server architecture! It is always a good idea to be ready for such a scenario, as you don’t know when your product will go viral!
Therefore, it’s vital to have scalability designed in the overall infrastructure design.
So even when there is a peak load, base load, or a spiky load (e.g.-For IoT enabled Christmas lights maybe needed only during the Christmas season)—in such cases your infrastructure should be capable to handle the load.
4. High Availability
All IoT devices which are deployed in the field are totally dependent on your backend infrastructure. So, if there is no server listening to them or controlling them—these devices become orphaned & cannot be used as you can’t communicate with the devices.
So, it’s very important that your server-side infrastructure is highly available (and it never goes down).
Designing a highly available infrastructure is a key to ensure high availability.
5. Adding an offline capability to the firmware
When you’re designing a solution for an IoT based platform, it is important to be mindful of scenarios wherein internet connection is not available to the devices.
E.g.- If the IoT device is on a vehicle which is travelling through patchy areas where there is no network connectivity.
So, in such scenarios when you’re designing the firmware and selecting the technology stack for the firmware, make sure that it can collect data even when it isn’t connected to the internet.
How does offline sync work?
Some cloud platforms like Azure IoT or AWS IoT provide shadow images of a device. Suppose you send a command to an IoT device in a vehicle which is not in range. But as soon as the vehicle receives network connectivity, it will get the required information, hold it in a queue, then receive and process it further.
In the same way, data collected when the device is offline is stored in the device database and then sent to the server.
This is an important aspect to consider in situations when your device has no connectivity, and you still want to collect the data.
6. Storing and Analyzing Data
IoT devices generate a lot of data. For instance, say you’re dealing with an industrial device sending data like temperature levels continuously to the server, and you’re required to keep all this data stored for a long time.
So, it’s very important to consider how you capture & store this data and make sure that the data is stored in such a way that it can be used for analysis & various BI reporting—then machine learning models can also be implemented on top of this data.
This seems easy when you have a single device to manage, but how should one go about managing a continuous data stream from thousands of IoT devices?
- Provision enough storage: Looking at the magnitude & volume of data, it’s imperative that you provision enough storage considering its performance parameters while capturing and storing the data. This is especially important because over time this data is going to huge by volume, and certain parameters need to be precomputed as you get the data, store it, and use it for analysis.
- Think Serverless: A serverless architecture is preferred for such scenarios so that whenever there are spikes, your cloud infrastructure can handle it seamlessly.
- Consider an Event-driven architecture: In an even-driven architecture whenever there is an event in the field, your device sends the data to the server, and your server processes it. i.e., server activity spikes are driven by a specific event taking place in the field.
Typically, serverless technologies like Azure functions & AWS Lambda will help you design your architecture to handle voluminous data and activity spikes in an optimum way.
7. Choice of Technology
Given below are some recommendations to equip you with the right technology stack for building software for IoT:
- Firmware: From an IoT standpoint, the firmware on your device, typically the OSS can be written using Python or Cross compilers like ESP8266 platforms.
- Server side: On the server side, you will receive events from the firmware into some sort of queue (like MQTT). Technologies like C#, Node.js, Python or similar server-side event driven technologies which can handle your data with ease should be the ideal choice.
- Data: Data should be typically stored in NoSQL DBs to account for a potential change in data structures. Databases like MongoDB, Firebase real-time database, or Cosmos DB should be utilized to store the initial data (i.e., the initial data captured from the devices). Apart from that, the precomputed data that will be used for analysis should be stored in relational databases like Matrix.
- For interfaces- if it’s an enterprise UI, it could have a web interface designed in Angular or similar technologies. If it’s a mobile app, where users must interact with the devices, then Flutter or native development should be considered.
- Incorporating other technologies: If you’re designing skills like Amazon Alexa skills or Google home skills, those should be developed into the respective API platforms & your server-side technology will help them communicate with the devices.
- Analytical tools – Once IoT solution starts getting adopted, users will keep using it in diverse ways. Knowing how users use IoT systems and improve user experience with generated data is a key to adoption. It will be especially important to analyze and draw meaningful inferences from the generated data. BI tools and Machine learning models can be used to get most out of this data.
A game changing technology like IoT is here to stay and grow
If building an app to pair up with your IoT product is something on your chart, make sure that your application development partner understands and incorporates all the best practices.
We at IncubXperts have gained considerable expertise in building solutions for the consumer IoT domain.
Take a look at our case stories to know more.