Easy IoT and Device Management for Non-C Coders

DZone 's Guide to

Easy IoT and Device Management for Non-C Coders

You will find learning Lua to be super easy if you have worked with other scripting languages — it's the language for children!

· IoT Zone ·
Free Resource

As hardware becomes faster, more powerful, and cheaper, C/C++ is no longer the only choice for embedded systems programming. The latest ESP32-WROVER enables advanced software solutions to execute on this tiny little chip, which can be purchased in bulk for as low as $3. Ready to use development boards can be purchased for as low as $8, and you can download and compile the code below if you have an ESP-WROVER board.

This hands-on project lets you design some very cool IoT home projects without requiring any C code experience.

You can now build an advanced Edge Controller and/or IoT Gateway by using nothing but an easy to learn a scripting language and a low-cost ESP32. The benefit of using a scripting language instead of  C/C++ is that C projects often run into issues such as buffer overflows, memory leaks, and other memory corruption errors. With a scripting language, you avoid these problems, particularly in larger projects where many computer programmers with varying skills are involved.

You may also like: Get Connected: It's as Easy as IoT

A scripting language abstracts out the details for the underlying micro-controller hardware. Instead of worrying about the bits and the bytes, a developer simply accesses methods of a peripheral object to control the hardware. Hardware control is done via a so-called "binding to the C code" and hardware. The abstraction of the hardware layer allows developers to focus on the application specifics rather than on the workings of the low-lying hardware.

I like to introduce you to Lua, a super easy to learn scripting language. Lua is a beginner-friendly coding language and is promoted as the first programming language for children. You will find learning Lua to be super easy if you have worked with other scripting languages.

Lua + IoT Batteries

I also like to introduce you to the Barracuda App Server, an advanced and compact multi-protocol stack specifically designed for making it easy and secure to design IoT solutions. Think about the Barracuda App Server as adding advanced IoT batteries to Lua.

You do not need C code experience when building and working with the Barracuda App Server for ESP32. A set of easy to follow instructions shows how to compile and upload the firmware to an ESP32.

The following video gives a quick introduction on how to compile and use the included Barracuda App Server for ESP32.

See the Barracuda App Server ESP32 GitHub repository for how to get started.

A Final Note for Hardcore C Coders (Embedded Programmers)

If you are a C coder reluctant to consider using a high-level language such as Lua in an embedded device, consider the following:

One of the great benefits I have learned from the Lua founders and by reading the Lua book is simply: Use Lua for what it is good at. 

It's not one way or the other. Things are not set in stone!

Unlike how many other non-C languages are used for embedded, such as Java, Lua developers, in general, do not try to solve everything using Lua. I think this design pattern is the main reason why Lua has been so successful in the gaming industry, where Lua is used extensively. Modern embedded systems tend to be very complicated, especially when IoT and cloud connectivity is added.

These non-real-time components are much easier and safer to design in a high-level language, assuming the language comes with IoT support. With the Barracuda App Server as an example, a C coder could do all the real-time components in C code and use Lua to control these C components. I think it is important to realize that Lua and other high-level languages do not exclude C coding; Lua should only be used as a tool for simplifying higher-level design.

Further Reading

Top 11 Cloud Platforms for the Internet of Things (IoT)

Home Automation Using IoT

12 IoT Platforms for Building IoT Projects

c, c++, internet of things, iot, iot accelerator marketplace, iot batteries, lua

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}