Adding Espressif ESP32 to the Golioth Bluetooth-to-Cloud Service

Oh my, we almost forgot about Espressif! I’m so often using the ESP32 family for WiFi-enabled projects that I haven’t yet added it to the Golioth Bluetooth IoT fleet. That’s the goal today, connecting an ESP32-S3 up to the Internet via Bluetooth (instead of WiFi).

Connecting any Bluetooth device to an IoT fleet is made easy by the Bluetooth-to-Cloud capabilities of Golioth. For this approach, we use a Gateway to bridge between the resource-constrained BLE devices to the cloud. The Bluetooth devices themselves just advertise a characteristic that indicates they are using the Pouch protocol.  This delivers bi-directional access to a huge number of devices that are usually considered to be connectionless.

Using the ESP32 with Zephyr

Today we’re using Zephyr because that’s what’s currently supported in the Golioth Bluetooth fleet examples. However, Pouch is designed to work cross-platform so with a bit of implementation work this is also possible for ESP-IDF.

Black development board on a wooden desktop with a blue LED illuminated.Espressif maintains support for the ESP32 family in Zephyr, so building for this ESP32-S3 is trivial when you already have Zephyr installed on your development computer. I found that all I needed to do was add hal_espressif to my allow-list and run a west command to fetch the binary blobs.

Building Golioth’s Bluetooth-to-Cloud Example

To add the ESP32-S3 to my IoT fleet I followed the instructions from the Golioth Bluetooth-to-Cloud private access repository. The example application uses a west manifest with an allow-list to limit the number of libraries that are cloned during initialization. I updated this file to include the Espressif HAL library.

# Copyright (c) 2025 Golioth, Inc.
# SPDX-License-Identifier: Apache-2.0

manifest:
  version: 0.8

  projects:
    - name: zephyr
      revision: v4.1.0
      url: https://github.com/zephyrproject-rtos/zephyr
      west-commands: scripts/west-commands.yml
      import:
        path-prefix: deps
        name-allowlist:
          - zephyr
          - cmsis
          - hal_expressif
          - hal_nordic
          - mbedtls
          - mcuboot
          - segger
          - tfm-mcuboot
          - trusted-firmware-m
          - zcbor

Don’t forget to update after making changes to your manifest. Now is also a great time to ensure you have the binary blobs on hand.

west update
west blobs fetch hal_espressif

By default, the sample application allows you to change the state of an LED attached to the board by issuing settings commands from the cloud. However, the ESP32-S3 doesn’t have an on-board LED. Without one, the sample code will fail to build. So I connected an LED (and current limiting resistor) between GPIO14 and Ground. Add an overlay file to map this additional hardware in the devicetree.

/ {
    leds {
        compatible = "gpio-leds";

        led0: led_0 {
            gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
        };
  };

    aliases {
        led0 = &led0;
    };
};

Now we can build and flash the application. Note that I’ve replaced the REPLACEME text with the Device ID from the Golioth console.

west build -p -b esp32s3_devkitc/esp32s3/procpu pouch/examples/ble_gatt -- -DCONFIG_EXAMPLE_DEVICE_ID=\"REPLACEME\"
west flash

As I mentioned, I already have a gateway device running. If you have not yet done so, follow steps 1 and 2 from the getting started guide. After a few seconds, the device will start advertising and sending data up to the cloud!

Topology map showing an esp32s3_devkitc connecting to a Golioth BLE gateway.Explore both Uplink and Downlink

The example code sends simulated sensor data from the device to the cloud. From the Golioth web console, we can use the LightDB Stream tab to view the “sensor” readings received on the cloud.

I didn’t actually connect a hardware sensor up to the device, so we’re only going to receive 22C for every reading as long as this device is powered on. However, as covered in the previous step, I did add an LED to this board.

We can use the Golioth Settings service to change the state of this LED from the Cloud. Settings can changed at the Project or Device level. Here I’ve edited the device-specific setting and a few seconds later the LED lights up!

Golioth web console showing the Settings page with an LED true/false option.The Internet is for Bluetooth Too!

Your fleet of BLE devices can easily gain bi-directional access to the Internet using Golioth’s Bluetooth-to-Cloud service. Just add a gateway that can be used by all devices within range and you’ve immediately unlocked a world of functionality.

Mike Szczys
Mike Szczys
Mike is a Firmware Engineer at Golioth. His deep love of microcontrollers began in the early 2000s, growing from the desire to make more of the BEAM robotics he was building. During his 12 years at Hackaday (eight of them as Editor in Chief), he had a front-row seat for the growth of the industry, and was active in developing a number of custom electronic conference badges. When he's not reading data sheets he's busy as an orchestra musician in Madison, Wisconsin.

Post Comments

No comments yet! Start the discussion at forum.golioth.io

More from this author

Related posts

spot_img

Latest posts

Creating an off-grid, solar powered Bluetooth-to-Cloud gateway

What happens when you're ready to utilize Bluetooth-to-Cloud, but are far from a power point and network connection and want to ensure your Bluetooth nodes' data still shows up on the cloud? Utilize the power of the sun!

Adding SiLabs EFR32BG27 to the Golioth Bluetooth-to-Cloud Service

If there's one thing we love doing, it's adding new chips to an IoT fleet. The Golioth Bluetooth-to-Cloud service is so hot right now...

Expanding Golioth Location with Gateway-Based Positioning

Less than two weeks after Golioth Location general availability, we have expanded the service to support gateway-based positioning, making it possible to obtain the location of devices that do not have GNSS, cellular, or Wi-Fi capabilities.

Want to stay up to date with the latest news?

Subscribe to our newsletter and get updates every 2 weeks. Follow the latest blogs and industry trends.