How Embedded Programming is changing due to IoT?

Introduction

The famous saying “Change is the only constant” means everything should go through changes. This applies more to the technology world is changes frequently. Something not digital or not meeting the expectations of this generation is not appreciated. Technologies should keep up or change to meet the demands of this digital world. Internet of Things (IoT) is rapidly digitizing everything, where embedded systems technologies plays a very key role. As IoT is transforming the world, Embedded Systems and programming them is changing too! Let us talk about top-3 changes that is happening right in front of us in the world of Embedded Systems.

Change#1: JavaScript everywhere

For years together Embedded System developers have been using C or C++ as the primary programming language. Invented in 1970s, C programming language is a structured, procedural language with great set of features to deal with hardware (ex: memory management). Apart from this C offers the best optimized machine code, which is suitable for resource constrained Embedded Systems. In the similar lines C++ offered some of the key Object Oriented Programming (OOP) features which helped to write re-usable Embedded Systems code.

How Embedded Programming is changing due to IoT?

This is going through a major change as JavaScript is emerging as one of the alternative for C and C++, when it comes to Embedded Systems programming. Initially JavaScript was used for creating web pages by bringing in interactivity with users (ex: forms). Later JavaScript started foraying into IoT development because of two main reasons:

  • JavaScript Standard Object Notation (JSON): This is a data interchange format, smooth for humans to read and write and also for the machines to parse and generate.
  • Invention of Node.js: It is a JavaScript runtime environment, which played a decisive role in the building phase of web servers or backend programming in JavaScript by using Google’s super-fast V8 JavaScript engine.

Recently an excellent JavaScript framework is getting introduced in form of Cylon.js which is created for new age requirements given by IoT. Using Cylon.js one can very easily program an Embedded System with very less lines of code. Apart from that it offers following benefits:

  • Event Handling: It is one of the features of JavaScript where the devices address various events and responds to those particular events. As IoT is heavily driven by asynchronous events, JavaScript handles them by allowing various devices to respond to one particular event. By doing this it saves battery power as well.
  • Memory Management: JavaScript owns a garbage collector. The garbage collector has an automated process of freeing the memory. This helps the developers to concentrate more on the important tasks assigned to them!
  • Tools and Libraries and plugins: Thereare multiple tools, libraries and rich frameworks that JavaScript offers. Specific to IoT it has refined frameworks and engines like Cylon.js, IoT.js, JerryScript and Duktape which are particularly designed for resource constrained devices. There are various other libraries such as Underscore, Lodash and Async that are part of JavaScript now. These makes programming easier and faster.
  • JavaScript is OpenSource: This is another decisive factor that makes JavaScript an apt programming language for IoT. The open source characteristic of JavaScript makes it possible for programmers to make effective contributions to various JavaScript projects. This triggers the creativity and brings in innovations to IoT enabled hardware, software and network solutions.

Taking in all these factors into consideration JavaScript Everywhere is becoming a reality by going beyond web application programming.

Change#2: The “Things” OS

After programming language, the next change is coming in form of Embedded Operating System. In traditional embedded systems developers need to put lot of efforts to bring up OS in the target hardware. This include board bring-up, customizing course code, porting an existing application etc. They had choices between bare metal OS (RTOS) and OpenSource Linux.

The growth of IoT is leading to a lot of changes in Embedded OS. Major players are heavily investing in open source based highly customizable and easy to use IoT OS – Amazon Free RTOS, Android Things, Arm Mbed and Mongoose OS are some of the examples. An IoT OS is an operating system that is designed to perform within the boundaries that are particular to IoT devices, along with the restrictions on memory, size, power and processing scope. IoT operating system area category of embedded OS but by interpretation are designed to enable data transfer over the internet.

These OS have pre built in features that are essential for IoT along with easy to customize tools and mechanisms.

  • Security: End-to-End security mechanisms to ensure data is transferred safely
  • Device protocols: Inbuilt support for a range of protocols to connect with devices and cloud
  • Libraries support: Reusable components to make development faster
  • Firmware Upgrade: Support for OTA in a secure manner to keep the device updated

All the above mentioned factors make the development faster and easier, which was not very evident in case of traditional Embedded Systems development. From customizing vanilla OpenSource Linux, the Embedded OS development has gone through sea of changes thanks to IoT.

Change#3: Network and Protocols

The traditional Embedded Systems was not having a mandatory need of networking and protocols. It was only required if the device has to connect with a network. In case of IoT networking and connectivity is a mandatory need. Hence traditional embedded systems developer need to transition into IoT by giving more serious look into networking part. This is another change caused in Embedded Systems thanks to IoT.

Here are the key networking aspects:

ItemDetails
REST APIsRepresentational State Transfer is an architectural approach for developing web services. This is used as a mechanism to transfer data between IoT gateways and cloud by binding Embedded and web technologies together
JSON JSON is JavaScript Object Notation, which consist of name value pairs. This is used to represent the data that need to get exchanged between Embedded and Web world
IoT protocolsREST APIs and JSON operate at data level. At lower level it requires lightweight, web-scale protocols that can seamlessly connect gateways with IoT cloud. Here developers are provided with options such as HTTP, CoAP, MQTT, XMPP etc.
WebsocketsWeb socket is a computer communication protocol giving full duplex interaction channels over a single TCP connection. Web socket protocol facilitates communication between a web browser and a web server with lower overheads, which makes is suitable for IoT.

Between IoT devices and gateway much more protocol choices are available. From IoT devices to cloud choices are limited. So choosing the right set of protocol for IoT device is one of the most important change that embedded system developer need to adapt.

Conclusion

Embedded systems development has come a long way. Right from single function devices to today’s super smart ones. From a developer’s point of view, it had quite a lot of challenges / barriers. Thanks to IoT it is going through sea of changes. Going forward developers will have more easier way to program the Embedded devices thanks to introduction of new JavaScript frameworks, Things OS by major players and adapting to networking standards and technologies.

About

Emertxe is India’s pioneer institute in Embedded Systems, Linux and IoT training, Since 2003. Our Embedded training vertical has generated huge pool of Industry ready embedded engineers. For freshers we offer placement oriented embedded course with attractive scholarships. For working professionals weekend options are available with embedded systems trainings and advanced workshops. Practical approach, applied learning, result oriented approach makes our trainings unique. Embedded systems course – For Freshers Embedded IoT Courses – For Freshers and Professionals Weekend embedded courses and workshops – For professionals Emertxe’s flagship training centre in Bangalore, offers one of the most exhaustive suites of Embedded systems and IoT technology courses available in India. Along with embedded systems, Emertxe offers training in specialized courses in Qt QML application programming, Qt for Embedded, Embedded android system development, Yocto for custom embedded Linux development, Advanced Linux device drivers courses, Software engineering courses as individual verticals. We offer short term and long term trainings in each technology areas, catering to various segments. We are here – To take you beyond!

View all posts by

Leave a Reply

Your email address will not be published. Required fields are marked *