In the following video tutorial, we show how the Barracuda App Server can be used to rapidly and interactively develop control logic in an embedded FreeRTOS system without having to compile or upload new firmware during the development process.
From a device perspective, IoT typically means acting as a network client. This tutorial focuses on using Lua and the Barracuda App Server network libraries for simplifying the design of an IoT device client. The web server component is used for the initial development, then later disabled in the final product since only the network client libraries are needed.
What is an IoT device?
An IoT device is simply a network enabled client that sends and/or receives data from an online cloud server. The data transmitted can be anything including sensor data and control messages. IoT device protocols include HTTP, MQTT, WebSockets, SMQ, OPC-UA and so on.
The real benefit with Lua comes when mixing real time modules implemented in C code with control logic designed in Lua. The dynamic nature of Lua enables the developers to interactively test control code in an embedded device without having to build and upload new firmware.
In the video below, we will look into how Lua can significantly speed up the interactive development time of an IoT enabled headless device. A headless device simply means it has no graphical user interface, neither onboard or remotely via web. However, we will use a web based IDE and the Barracuda App Server running on the microcontroller during the interactive development process to speed up the development time. When the development is complete, the web based IDE will be removed and the final IoT application implemented in Lua will be embedded as a ZIP file inside the firmware image.
The video below shows the complete development process from rapid interactive development to creating the final firmware release. The video starts by providing an introduction to the available tools and documentation.
We use an ESP32 in the video tutorial below, but Lua can run on most embedded systems. You can follow along the video tutorial with your own ESP32 if you install the Barracuda App Server for ESP32.
Download video example code from GitHub. Use the SharkSSL IDE for easy firmware flashing.
The online service "If This Then That" (IFTTT) introduced in the above video is a great tool for DIY projects. However, if you're looking to create a professional IoT client, check out the MQTT Sparkplug Enabled Weather Station example. This ready-to-run example offers a valuable opportunity to explore the capabilities and benefits of using Lua and MQTT Sparkplug in embedded devices. You can use the design patterns you learned in the above video when creating any type of IoT client, including MQTT clients.
The C/C++ programming languages dominate embedded systems programming, but developers often run into issues such as buffer overflows, memory leaks, and other memory corruption errors. With Lua you avoid these problems, particularly in larger projects where many computer programmers with varying skills are involved.
Lua abstracts out the details for the underlying microcontroller 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 Lua binding. The abstraction of the hardware layer allows developers to focus on the application specifics rather than on the workings of the low-lying hardware.
New to Lua?
Get a quick introduction to Lua by following our Online Interactive Lua Tutorials
No matter what your background or project goals, we're here to help you find the perfect solution! Are you a maker looking for the right tools? A startup trying to get off the ground? A large business seeking new software solutions? We've got you covered.
If you have any questions or just aren't sure which product is right for you, don't hesitate to reach out. Our team is dedicated to helping you overcome your hardware/software challenges and find the best solution for your needs. Let us know how we can help - we'd love to lend a hand!
Expedite your IoT and edge computing development with the "Barracuda App Server Network Library", a compact client/server multi-protocol stack and toolkit with an efficient integrated scripting engine. Includes Industrial Protocols, MQTT client, SMQ broker, WebSocket client & server, REST, AJAX, XML, and more. The Barracuda App Server is a programmable, secure, and intelligent IoT toolkit that fits a wide range of hardware options.
SharkSSL is the smallest, fastest, and best performing embedded TLS stack with optimized ciphers made by Real Time Logic. SharkSSL includes many secure IoT protocols.
SMQ lets developers quickly and inexpensively deliver world-class management functionality for their products. SMQ is an enterprise ready IoT protocol that enables easier control and management of products on a massive scale.
SharkMQTT is a super small secure MQTT client with integrated TLS stack. SharkMQTT easily fits in tiny microcontrollers.
An easy to use OPC UA stack that enables bridging of OPC-UA enabled industrial products with cloud services, IT, and HTML5 user interfaces.
Use our user programmable Edge-Controller as a tool to accelerate development of the next generation industrial edge products and to facilitate rapid IoT and IIoT development.
Learn how to use the Barracuda App Server as your On-Premises IoT Foundation.
The compact Web Server C library is included in the Barracuda App Server protocol suite but can also be used standalone.
The tiny Minnow Server enables modern web server user interfaces to be used as the graphical front end for tiny microcontrollers. Make sure to check out the reference design and the Minnow Server design guide.
Why use FTP when you can use your device as a secure network drive.
PikeHTTP is a compact and secure HTTP client C library that greatly simplifies the design of HTTP/REST style apps in C or C++.
The embedded WebSocket C library lets developers design tiny and secure IoT applications based on the WebSocket protocol.
Send alarms and other notifications from any microcontroller powered product.
The RayCrypto engine is an extremely small and fast embedded crypto library designed specifically for embedded resource-constrained devices.
Real Time Logic's SharkTrust™ service is an automatic Public Key Infrastructure (PKI) solution for products containing an Embedded Web Server.
The Modbus client enables bridging of Modbus enabled industrial products with modern IoT devices and HTML5 powered HMIs.