Jump to content

AI REDGIO 5.0 Open Hardware Platform v2

The second version of the AI REDGIO 5.0 Open Hardware Platform (v2)

Image 1: Photo by Alexandre Debiève on Unsplash

Asset Description

The Open Hardware Platform for Embedded Artificial Intelligence and AI-at-the-Edge represents a significant advancement in technology and artificial intelligence (AI). This platform is based on open hardware, which allows users and developers to modify and enhance hardware according to their specific needs. The Open Hardware Platform for Embedded AI and AI-at-the-Edge have a wide range of applications; it can be used in autonomous drones for image processing and real-time decision-making, in personal assistance devices for voice recognition and real-time interaction, or industrial sensors for monitoring and independent decision making.

Open Hardware Project

This project demonstrates how to configure an ESP32 to load a TensorFlow Lite model and use it to perform predictions based on data received via MQTT. Configuration and input data are sent to the ESP32 using HTTP and MQTT, respectively. This project provides a solid foundation for using the ESP32 as a prediction device based on machine learning, suitable for applications in the Internet of Things (IoT).

Features

The project demonstrates the following:

  1. ESP32 connectivity through WiFi
  2. TensorFlow Lite Model uploading
  3. ESP32 connectivity to MQTT broker
  4. Data exchange between the ESP32 and the MQTT Broker

Everything is embedded in the ESP32, thus behaving like an Edge Node.

Technologies Used

Technology Description
ESP32 A low-cost microcontroller with WiFi and Bluetooth connectivity.
TensorFlow Lite A machine learning library for resource-constrained devices.
ArduinoJson A library for handling JSON data on Arduino devices.
PubSubClient A library for handling MQTT connectivity.
ESPAsyncWebServer A library for handling asynchronous web servers on the ESP32.

System Requirements

Hardware

1. ESP32
2. WiFi connection

Software

1. Arduino IDE
2. Arduino Libraries:

  • WiFiManager
  • ESPAsyncWebServer
  • AsyncTCP
  • TensorFlowLite_ESP32
  • ArduinoJson
  • PubSubClient

Flow

From a high level, the actions tha take place within the provided code are the following:

Image Caption
Image Caption
Image 2: High level flow of actions

1. WiFi Connection:

  • The ESP32 connects to the WiFi network using the provided credentials.

2. Web Server Configuration:

  • The web server handles HTTP requests for uploading the model and receiving the JSON configuration

3. TensorFlow Lite Model Upload:

  • The model is uploaded via the /uploadModel endpoint.
  • The model is stored in a buffer and initialized for use in predictions.

4. MQTT Configuration:

  • Configuration is received via the /configure endpoint.
  • The MQTT broker details, input and output topics, and input and output parameters are configured.

5. MQTT Broker Connection:

  • The ESP32 connects to the MQTT broker using the provided details.
  • Subscribes to the specified input topic.

6. MQTT Message Handling:

  • Incoming messages on the input topic are processed to extract input parameters.
  • The model is invoked to perform the prediction.
  • Prediction results are published to the output topic


Instructions

  • Instructions on the various steps of the process (installation of libraries, WiFI configuration, model uploading through API, MQTT connectivity) are available here
  • The code can be found here


*Note: Key Points and Limitations

  1. Maximum Memory:
    1. The ESP32 has a memory limit. The available memory for models depends on the model's complexity and other libraries' usage. Typically, models should not exceed 300KB.
  2. Error Handling:
    1. The code handles errors such as model loading failure, invalid configuration, and memory issues.
  3. Scalability:
    1. The system is designed to be flexible and scalable, allowing different models and parameters to be configured via JSON.

External Resources

  • Documentation and code for the Open Hardware Platform v2 available in Github
  • Created by Libelium (HOPU)

Relevant Categories