Hands-On Xedge32 Tutorials

Xedge32 is a rapid development environment tailored for the ESP32 microcontroller. It offers a seamless bridge between the Lua programming language and the extensive features of the ESP32, simplifying the IoT development process. Xedge32 is specifically designed for professionals, offering a robust and user-friendly platform that unlocks the full potential of the ESP32 for advanced IoT projects. Start by reading the Xedge32 introduction and dive into our tutorials below to kickstart your journey with Xedge32.

Besides purchasing an ESP32, we highly recommend acquiring a starter kit for an optimal hands-on experience with our tutorials. This kit should encompass essential components such as a Breadboard, Jumper Wires, Resistors, LEDs, and more.

New to Lua?
Check out our Online Interactive Lua Tutorials for a gentle introduction.

No ESP32?
You can run many of these tutorials on Windows and Linux using the ESP32 simulator. See Running the Examples on Windows and Linux for details.

Your First Xedge32 Project

An Introduction to Device Management with Lua: As you learned in the Xedge32 introduction, this development environment streamlines IoT projects by seamlessly connecting Lua to the ESP32's extensive features. By enabling all device-specific code to be written in the user-friendly Lua language, Xedge32 makes the development process simpler and faster. In this first tutorial, we'll walk you through a basic example that blinks an LED.

Read the Tutorial: Your First Xedge32 Project

Your First IoT Project

This tutorial introduces developers to the components required to design a complete IoT project. It focuses on using the Barracuda App Server to set up a managed IoT server on-premises or online. The tutorial includes practical examples of configuring hardware like LEDs and buttons on ESP32 boards and integrating them with IoT applications. By the end, readers gain an understanding of managing an on-premises and online IoT server and the intricacies of hardware-software interaction.

Read the Tutorial: Your First IoT Project

IoT Foundation

The tutorial includes code that can be used as a base for a complete IoT solution. It details collecting data from an ESP32, recording it to a database, and displaying it on a web page. The tutorial also demonstrates transitioning the setup from on-premises to an online server. It highlights the use of ChatGPT as a development aid in the early design stages.

Read the Tutorial: ESP32 IoT Foundation

How to Send Emails Using Lua

Xedge32 includes easy-to-use SMTP configuration options and functions for sending emails.

Read the Tutorial: How to Send Emails Using Lua

Logging for Testing and Production Mode

This tutorial explores the essentials of logging for testing and production environments. It uses various logging methods for data during testing and debugging and for deployed production-ready products.

Read the Tutorial: Logging for Testing and Production Mode

Streaming ESP32-CAM Images to Multiple Browsers using WebSockets and SMQ

Learn how to broadcast real-time CAM images from an ESP32 to multiple web browsers using WebSockets. This tutorial will cover the setup and configuration of your ESP32-CAM and the integration of these powerful technologies to achieve efficient, simultaneous streaming across multiple browsers.

Read the Tutorial: Streaming ESP32-CAM Images to Multiple Browsers using WebSockets and SMQ

Streaming ESP32-CAM Images to Multiple Browsers via MQTT

In this tutorial, you'll learn how to publish images from an ESP32-CAM board to multiple browsers using MQTT (Message Queuing Telemetry Transport). This setup will enable you to create a platform that functions similarly to a live video stream, viewable by unlimited users.

Read the Tutorial: Streaming ESP32-CAM Images to Multiple Browsers via MQTT

Build Your Own Privacy-Focused Camera Doorbell

Discover how to build a privacy-focused camera doorbell using an ESP32 cam. This tutorial guides you through setting up email notifications with easy steps, offering a secure way to monitor your doorstep without compromising privacy.

Read the Tutorial: Build Your Own Privacy-Focused Camera Doorbell

Building a Weather Station with ESP32, MySQL, and Grafana

This tutorial provides a hands-on practical guide on securely connecting the ESP32 microcontroller directly to a MySQL database instance. You'll learn how to establish and maintain a persistent connection to the database and continuously insert data directly from the ESP32. Once the data is stored in the online database, it can easily be visualized using Grafana, as detailed in the final section of this tutorial.

Read the Tutorial: Building a Weather Station with ESP32, MySQL, and Grafana

Connecting the ESP32 to Ethernet

The ESP32 microcontroller extends beyond Wi-Fi, offering Ethernet support crucial for stable environments like factories. The Xedge32 solution makes integrating the W5500 Ethernet chip with ESP32 straightforward. This article guides you through activating Ethernet on the ESP32 and wiring the W5500 chip

Read the Tutorial: Connecting the ESP32 to Ethernet

ESP32 WebDAV Server

WebDAV, an HTTP(S) protocol extension, transforms a web server into a standard network drive, facilitating seamless file sharing across various devices. With WebDAV, users can easily map or mount a drive without the need for additional software installations. This tutorial shows how to create a WebDAV server.

Read the Tutorial: ESP32 WebDAV Server

Designing Your First Professional Embedded Web Interface

This article provides insights into designing a professional embedded web interface. It covers the importance of a well-designed interface, the challenges faced during the design process, and the solutions to overcome these challenges.

Read the Tutorial: Designing Your First Professional Embedded Web Interface

Your First Embedded Single Page Application

This tutorial introduces you to the concept of embedded single-page applications (SPA). It explains the benefits of SPAs, how they differ from traditional multi-page applications, and how to get started with building your first embedded SPA.

Read the Tutorial: Your First Embedded Single Page Application

How to connect ESP32 to AWS IoT Core Using MQTT

This guide provides a step-by-step tutorial on connecting an ESP32 device to AWS IoT Core using MQTT. By following this tutorial, you'll be able to send and receive messages between your ESP32 device and AWS IoT Core using the MQTT protocol.

Read the Tutorial: How to connect ESP32 to AWS IoT Core Using MQTT

Using the NetIO (Network File System) Client

The NetIO network client is a great tool to use when developing a larger Lua application or when developing a Lua Module.

Read the Tutorial: Using the NetIO

Additional ESP32 Examples on GitHub

Not all of the examples available on GitHub come with extensive tutorials like the ones presented above. For those eager to delve deeper and explore further, here is a list of additional ESP32 examples you can find on GitHub:

  • Cam Images Over WebSockets (wscam.lsp):
    Discover how to efficiently transmit camera images over WebSockets. This example manages active client connections, process messages, and dispatch images in real-time.
  • Servo Motor Control (servo.lsp):
    Gain insights into servo motors' operation and control using the ESP32. This example explains the pulse width modulation (PWM) technique for servo positioning and provides a function for PWM duty cycle calculations based on desired angles.
  • Web-based Servo Motor Control (uiservo.lsp):
    Experience a hands-on demonstration of controlling a servo motor through a web-based user interface. Using a ready-to-use slider JavaScript library, this example showcases real-time servo position control and synchronization across multiple browser windows using the SMQ protocol.
  • Audio Processing (pcmplayer.lsp):
    Delve into audio processing on the ESP32 with an example showing how to sample a microphone or any other sound source and send the sampled data to the browser. We use a JavaScript PCM Player library to play the sampled data in the browser.
  • BME280 Sensor Integration (bme280.xlua):
    Learn how to integrate the BME280 environmental sensor with the ESP32. This Lua script provides a step-by-step guide on setting up the sensor, reading temperature, humidity, and pressure values, and handling potential errors.

Other GitHub Repositories

  • ESP32 Weather Station:
    The ESP32 Weather Station App is a Lua-based application designed to collect and manage weather data using a BME280 sensor. It interfaces with the sensor via I2C to collect temperature, humidity, and pressure data, storing this information in a local time series database.

Additional External Tutorials



Updating the firmware

Running the Examples on Windows and Linux

If you're intrigued by the possibilities explored in the above tutorials but don't have an ESP32 or prefer working on a desktop environment, there's an equally compelling avenue for you. The Mako Server is the larger counterpart to Xedge32, based on the same Barracuda App Server library. It offers a seamless experience for running your Lua-based projects on Windows and Linux platforms.

Preparing Your Environment

To get started, we will download and set up the Mako Server on your system. Below, we outline the steps and the necessary PowerShell commands for Windows users. Linux users can follow along with analogous commands, replacing PowerShell specifics with their Linux counterparts.

  1. Download Mako Server:
    wget https://makoserver.net/download/mako.windows.x86.exe -O install.exe
    This command fetches the Mako Server executable for Windows and saves it as install.exe.
  2. Install Mako Server:
    The above executes the self-extracting ZIP file you just downloaded, which unpacks the Mako Server in the MakoServer sub-directory. The installer also starts the Mako server. Exit this console window as we later instruct the Mako Server to load the required components.
  3. Clone the BAS Resources:
    git clone https://github.com/RealTimeLogic/BAS-Resources
    Uses git to clone the repository containing resources necessary for building Xedge for the Mako Server.
  4. Navigate to Build Directory and run XedgeMako:
    cd .\BAS-Resources\build\
    Changes the current directory to the build directory inside the cloned BAS-Resources, then runs the XedgeMako.cmd script to build xedge.zip.
  5. Clone the Example Code:
    cd ..\..
    git clone https://github.com/RealTimeLogic/LSP-Examples
    Clones the repository containing Lua examples.
  6. Run the Mako Server and instruct it to load the ESP32 simulator and the Xedge IDE:
     MakoServer\mako.exe -l::LSP-Examples\ESP32\simulator -l::BAS-Resources\build\Xedge.zip
  7. When the Mako Server is running, navigate to http://localhost:portno, where the port number used by the server is printed in the console.
  8. Use the Xedge IDE for the Mako Server and follow the tutorials.