Xedge32 Introduction

Xedge32 is Xedge with a peripheral Lua API designed for the ESP32. Xedge is a Lua REPL designed for edge devices and powered by an advanced IoT toolkit.

Xedge32

Think of Xedge32 as an enhanced version of Xedge, featuring an additional peripheral south bridge specifically engineered for the ESP32.

Tip

If you’re new to this technology, start with our Xedge32 introduction.

Xedge32 significantly accelerates the development of IoT devices, combining a comprehensive ready-to-use IoT north bridge API with the ESP32 peripheral, aka south bridge API. This approach, which does not require C coding, streamlines working with device components such as sensors. The added advantage of using the ESP32, a cost-effective solution, makes it easy to retrofit existing products with IoT capabilities. By streamlining development and testing stages, Xedge32 dramatically reduces the time it takes to bring secure IoT-enabled sensor products to market. All these benefits make Xedge32 an exceptionally user-friendly and efficient choice for IoT device development.

Xedge32 leverages the high-level Lua language. Lua’s learning curve is considerably less steep than other computer languages, making it an invaluable tool in high-paced development environments, including creating secure IoT-enabled device products. If you’re new to Lua, be sure to check out the Online Interactive Lua Tutorials for an easy and accessible way to learn the language.

Xedge vs. Xedge32

This documentation exclusively covers Xedge32 specific features, the ESP32 peripheral Lua API, and how to use Xedge on the ESP32. If you are looking for documentation on network-related and other APIs provided by the Barracuda App Server development foundation, please refer to the Barracuda App Server API and the generic Xedge documentation.

Xedge32 APIs

  1. The ESP32 peripheral APIs found here (Xedge32 specific API)

  2. Xedge documentation (generic API)

  3. Barracuda App Server’s Lua API

  4. IoT Protocols

API Key Points:

  1. Xedge32’s ESP32 LUA API offers a selected range of the ESP-IDF C peripheral APIs adapted for Lua.

  2. Out of the box, Xedge32 grants access only to the Lua APIs from the Barracuda App Server. For full access to the C APIs, developers need to compile and extend Xedge32, an option for those with C experience.

Interrupts

The ESP32 Lua API is designed to take advantage of interrupt-driven events, and it is highly recommended to use the interrupt-driven (callback) API when it is available. While it is possible to poll for data using a timer, it is not the recommended approach for APIs that provide event-driven data reading.

Automatic collection of HW resources

Lua includes a garbage collector that reclaims memory when no more references exist to the object. The ESP32 API takes advantage of this by creating Lua objects for the ESP32 peripheral hardware. When using an LSP page as a REPL, the objects no longer have any references once the page has been executed. This construction can be made to automatically reclaim hardware resources that are no longer in use, simplifying the hot reloading of the new code.

For example, you can modify an LSP page containing Lua code and refresh the page to compile the new code. This allows you to quickly make changes and test them without worrying about manually releasing the hardware resources since the garbage collector takes care of it automatically. See the GPIO examples for how this can be done.

Xedge ESP32

Contents:

Indices and tables