Professional Documents
Culture Documents
PROGRAMMING
INTRODUCTION
Programming for IoT is usually a polyglot (multiple languages) effort since the Internet-of-Things (IoT)
is a system of inter-related computing devices that are provided with unique identifiers and the ability to
transfer data over a network. The choice of programming-language depends on the capability and
purpose of the device. IoT encompasses a variety of devices including edge devices, gateways, and cloud
servers.The most popular languages in IoT are Java, C, C++, Python, Javascript, Node.js, Assembler,
PHP, C#, Lua, R, Go, Ruby, Swift and Rust in descending order of popularity. This is from a 2017
online survey co-sponsored by Eclipse IoT Working Group, IEEE IoT, AGILE IoT and IoT Council in
which 713 individuals participated.
Other languages include Parasail, Microsoft P, Eclipse Mita, Kotlin, Dart, MicroPython, and B#.
• Edge Devices - These are constrained-resource embedded systems. For very small devices
(higher constraints), Assembly and C are the languages of choice. A better processor and
more computing power on the device enables one to use C, Python, Node.js, Java. The
focus is to minimize instruction count, and maximize execution speed and resource
management.
• Gateways - Gateways manage communication and do analysis of data from many devices
through several different buses. More languages can be run on these devices because of their
increased computing power, including C, C++, Java, Python, and Node.js.
• Cloud - With the nearly unlimited computing capability that's available, frameworks
like Apache Hadoop and HiveQL can compute and process large IOT datasets. Statistical
computing and visualization can be done using languages like R or Julia.
The features to consider when evaluating IoT programming frameworks
• Scalability - Programming frameworks that support diverse programming patterns that are able to
perform load-balancing dynamically.
• Concurrency - Real-time communication between millions of devices and applications mean
millions of concurrent connections. Thread locking is not efficient in such situations.
• Coordination - Programming language support for explicitly (control driven) or implicitly (data
driven) orchestrating the role of computing elements.
• Heterogeneity - Programming framework gives guidance on how computations are mapped to the
computing elements.
• Fault tolerance - Applications should be able to gracefully go from online to offline state as
networks partition and heal their connections.
• Light footprint - In terms of runtime overhead and in terms of programming effort the framework
should be light.
• Support for latency and sensitivity - In geographically distributed applications, pushing all
computations to the cloud is not ideal. The programming framework has to handle these
requirements dynamically.
I.O.T. GATEWAY
Gateway provides a bridge between different communication technologies which means we can say
that a Gateway acts as a medium to open up connections between the cloud and
controller(sensors/devices) in Internet of Things (IoT). With the help of gateways, it is possible to
establish device-to-device or device-to-cloud communication. A gateway can be a typical hardware
device or software program. It enables a connection between the sensor network and the Internet along
with enabling IoT communication, it also performs many other tasks such as this IoT gateway
performs protocol translation, aggregating all data, local processing, and filtering of data before
sending it to the cloud, locally storing data and autonomously controlling devices based on some
inputted data, providing additional device security. The below figure shows how IoT Gateways
establish communication between sensors and the cloud (Data System).
As IoT devices work with low power consumption(Battery power) in other words they are energy
constrained so if they will directly communicate to cloud/internet it won’t be effective in terms of
power. So they communicate with Gateway first using short range wireless transmission
modes/network like ZigBee, Bluetooth, etc as they consume less power or they can also be connected
using long range like Cellular and WiFi etc. Then Gateway links them to Internet/ cloud by converting
data into a standard protocol like MQTT. using ethernet, WiFi/cellular or satellite connection. And in
mostly Gateway is Mains powered unlike sensor nodes which are battery powered. In practice there
are multiple Gateway devices.
Let’s think about a simple IoT gateway, then our smartphone comes into picture as it can
also work as a basic IoT gateway when we use multiple radio technologies like WiFi,
Bluetooth, Cellular network of smart phone to work on any IoT project in sending and
receiving data at that time this also acts as a basic IoT Gateway.
Working of IoT Gateway :
IoT Gateways are key element of IoT infrastructure as Gateways establish connection for communication
and also performs other task as described above. So IoT Gateway is one of most essential thing when we
start think about an IoT ecosystem.
IoT infrastructure can be divided into four architectural layers. These include:
• Sensor Layer: At the sensor layer, devices collect data for future processing. IoT devices operate at
this layer.
• Network or Data Acquisition Layer: At this layer, data is aggregated from multiple sources and
securely transmitted to processing systems. Data acquisition systems (DAS) are responsible for
aggregating and converting data to a desired format. IoT gateways operate at this level to provide
secure connectivity between IoT devices and processing infrastructure.
• Data Pre-processing Layer: At this layer, IoT sensor data undergoes pre-processing and basic data
analytics to reduce data volume before it is transmitted on to cloud-based infrastructure. IoT edge
devices operate at this layer.
• Cloud Analysis or Application Layer: Cloud-based infrastructure performs in-depth data analytics
and provides applications and users with access to data and analytic results. Data storage or
warehousing may also occur at this layer.
Advantages of Gateway
Protocol translation: IoT devices typically use different communication protocols, and a gateway can
translate between these protocols to enable communication between different types of devices.
Data aggregation: A gateway can collect data from multiple IoT devices and aggregate it into a single
stream for easier analysis and management.
Edge computing: Gateways can perform edge computing tasks such as data processing, analytics, and
machine learning, enabling faster and more efficient decision-making.
Security: Gateways can act as a secure access point for IoT devices, providing a layer of protection
against cyber threats.
Scalability: Gateways can support a large number of IoT devices and can be easily scaled up or down to
meet changing needs.
Improved reliability: Gateways can help to improve the reliability of IoT devices by managing network
connectivity and providing a backup mechanism in case of network failure.
Cost-effective: Gateways can be a cost-effective way to manage and control a large number of IoT
devices, reducing the need for expensive infrastructure and IT resources.
What does an IoT gateway do?
An IoT gateway acts as a network router, routing data between IoT devices and the cloud. Early on,
most gateway devices only sent traffic in one direction: from the IoT device to the cloud. Now it's
common for gateway devices to handle both inbound and outbound traffic. Outbound traffic streams are
used to send IoT data to the cloud, while inbound traffic is used for device management tasks, such as
updating firmware. Some IoT gateways do more than just route traffic, they can also preprocess data
locally at the edge before sending it to the cloud. In doing so, the device might deduplicate, summarize
or aggregate data as a way of reducing the volume of data that must be forwarded to the cloud. This can
improve response times and reduce network transmission costs.
IOT EDGE COMPUTING
INTRODUCTION
Edge computing takes place at or near the physical location of either the user or the source of the data. By
placing computing services closer to these locations, users benefit from faster, more reliable services with
better user experiences, while companies benefit by being better able to support latency-sensitive
applications, identify trends, and offer better products and services.
Edge computing is one way that a company can use and distribute a common pool of resources across a
large number of locations to help scale centralized infrastructure to meet the needs of increasing numbers
of devices and data.
How are IoT and edge related?
IoT benefits from having compute power closer to where a physical device or data source actually exists.
In order for the data produced by IoT devices to react faster or mitigate issues, it needs to be analyzed at
the edge, rather than traveling back to a central site before that analysis can take place.
Edge computing is a local source of processing and storage for the data and computing needs of IoT
devices. Here are some of the benefits of using IoT and edge together:
• Reduced latency of communication between IoT devices and the central IT networks.
• Faster response times and increased operational efficiency.
• Improved network bandwidth.
• Continued systems operation offline when a network connection is lost.
• Local data processing, aggregation, and rapid decision making via analytics algorithms and machine
learning.
• An IoT gateway can send data from the edge back to the cloud or centralized datacenter, or to the edge
systems to be processed locally.
The Goal Of IoT Edge
Just as edge computing aims to bring resources and data storage closer to the sources themselves in order
to improve response time, latency, and other issues, IoT Edge aims to achieve similar goals. IoT devices
inherently encompass a significant amount of data that can interrupt user experience and security. IoT
Edge computing processes its data closer to the origin source to reduce any friction or latency within the
cloud.
Edge devices are computing systems deployed near the location of the user or device that uses them. This
geographic proximity minimizes the network latency between the edge device and its user, enabling it to
provide faster and more reliable services.
IoT edge devices are intended to provide additional computing power for resource-constrained IoT
devices. IoT devices can collect and transmit data to IoT edge systems and rapidly receive results without
needing to perform calculations themselves.
Components of the IOT edge system