ESP32-S3-CAM Send Images to ThingsBoard 📷

 

In this project, we will send images from an ESP32-S3-CAM to ThingsBoard Cloud using MQTT.

The ESP32 captures a photo, converts it to Base64, and sends it to ThingsBoard as telemetry.

🔗 Get ThingsBoard

Create your ThingsBoard account here:

ThingsBoard: https://thingsboard.io?fpr=pigirltech

This link supports my work through the ThingsBoard affiliate program.

💻 Get the Complete Code

The complete ESP32-S3-CAM code is available on GitHub:

GitHub: https://github.com/AishwaryaKabadi/ESP32-S3-CAM-Projects

🧩 What You Need

  • ESP32-S3-CAM

  • USB cable

  • Wi-Fi connection

  • ThingsBoard Cloud account

  • Arduino IDE

🔄 How It Works

ESP32-S3-CAM
     ↓
Capture JPEG Image
     ↓
Convert to Base64
     ↓
MQTT
     ↓
ThingsBoard Cloud
     ↓
camera_image Telemetry
     ↓
Dashboard

1. Create a Device in ThingsBoard

Log in to ThingsBoard Cloud.

Go to:

Entities → Devices → Add new device

Create a device, for example:

Device Name: ESP32-S3-CAM

Open the device and copy its Access Token.

2. Configure MQTT

Use:

Host: mqtt.thingsboard.cloud
Port: 1883
Username: YOUR_ACCESS_TOKEN

Telemetry topic:

v1/devices/me/telemetry

3. Capture the Image

The ESP32-S3-CAM captures a JPEG image and converts it to Base64.

The image is sent using the telemetry key:

camera_image

Example:

{
  "camera_image": "BASE64_IMAGE_DATA"
}

4. Send the Image to ThingsBoard

The ESP32 connects to ThingsBoard using MQTT and publishes the Base64 image.

The complete working code is available here:

GitHub: https://github.com/AishwaryaKabadi/ESP32-S3-CAM-Projects

5. Display the Image

Create a ThingsBoard dashboard and add a widget that can decode the Base64 image.

Use:

camera_image

as the telemetry key.

The result is an ESP32-S3-CAM image displayed directly in your ThingsBoard dashboard.

⚠️ Important

Camera images are much larger than normal sensor telemetry.

For better performance:

  • Use a smaller image resolution

  • Use JPEG compression

  • Don't send images continuously

  • Send an image only when required

For example:

FRAMESIZE_QQVGA

is a good starting point.

🎯 Final Result

ESP32-S3-CAM
      ↓
   JPEG Image
      ↓
    Base64
      ↓
     MQTT
      ↓
ThingsBoard Cloud
      ↓
   Dashboard

You can now send ESP32-S3-CAM images to ThingsBoard and combine camera data with your IoT telemetry.

🔗 Links

ThingsBoard:
https://thingsboard.io?fpr=pigirltech

Complete Code – GitHub:
https://github.com/AishwaryaKabadi/ESP32-S3-CAM-Projects

ThingsBoard MQTT Documentation:
https://thingsboard.io/docs/reference/mqtt-api/getting-connected/

ThingsBoard Telemetry Documentation:
https://thingsboard.io/docs/paas/reference/mqtt-api/telemetry/

Post a Comment

My Instagram

Made with ❤ by Pi-girl | Copyright © 2020 Pi-girl