Ultrasonic Radar icon Ultrasonic Radar Ultrasonic on a servo sweeps 180°; radar shows distances and obstacles, integrates with movement panels for automatic avoidance, scriptable GetPing Try it →

Esp32plus Firmware

ESP32Plus for Synthiam ARC enables ESP32 robot control with audio streaming, ESP32-CAM passthrough, PCA9685 16-servo I2C control and UART expansion.

Compatible Hardware

Esp32 by Espressif
Control ESP32 boards with Synthiam ARC: EZB-like firmware for GPIO, PWM/servos, serial, WiFi modes, safe pins, wiring and power tips.
Wi-Fi
Servos Varies
Camera
Audio
UART Varies
I2C
ADC Varies
Digital Varies

Description

Firmware that turns an ESP32 development board into a Synthiam ARC-compatible EZB device. Once flashed, ARC discovers the board over WiFi and controls it using the standard EZB protocol.

Features

  • EZB protocol server over WiFi (TCP port 23)
  • Camera / UART data passthrough server (TCP port 24)
  • Auto-discovery via EZB Scan UDP broadcast - appears in ARC's connection dialog automatically
  • I2C master bus for reading and writing I2C devices from ARC
  • UART expansion port (ARC UART #0) for sending and receiving serial data from ARC
  • Onboard audio playback using the ESP32's built-in DAC via I2S DMA
  • Access Point or WiFi Client mode (single #define toggle)
  • Multi-task FreeRTOS architecture for stable, concurrent TCP, UART, audio, and discovery
  • Connect / disconnect audio chimes so you hear when ARC attaches

Hardware

Any original ESP32 development board (ESP32-WROOM, ESP32-DevKitC, etc.) will work.

Important: This firmware uses the ESP32's built-in DAC via I2S. That peripheral only exists on the original ESP32. It is not supported on ESP32-S2, S3, C3, C6, or H2. Using one of those variants will halt the firmware with a fatal error at boot.

Pin Assignments

Function GPIO Notes
Serial1 RX (camera passthrough) GPIO 12 Data from camera / external serial device
Serial1 TX (camera passthrough) GPIO 13
Serial2 RX (ARC UART #0) GPIO 16 ARC UART.Read() / UART.Write()
Serial2 TX (ARC UART #0) GPIO 17
I2C SDA GPIO 14 ARC I2C.Write() / I2C.Read()
I2C SCL GPIO 15
Audio DAC Out GPIO 25 + GPIO 26 Mono audio, both pins carry the same signal
USB Serial (debug) - 115200 baud

Installation

1. Install the Arduino IDE

Download and install the Arduino IDE.

2. Install the ESP32 board package

  1. Open File Preferences.
  2. Add this URL to Additional Board Manager URLs:
    https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
    
  3. Open Tools Board Boards Manager, search for esp32, and install ESP32 by Espressif Systems.

This firmware was developed and tested against ESP32 by Espressif Systems version 3.3.7.

3. Open the sketch

Open EZ-ESP32Plus.ino in the Arduino IDE.

4. Configure WiFi mode

Near the top of the sketch, pick one of the two WiFi modes.

Access Point mode (ESP32 creates its own network - easiest for first use):

#define AP_MODE

#define WIFI_AP_SSID "GetOffMyLawn"
#define WIFI_AP_PWD  ""

Leave AP_MODE defined and set the SSID and password you want the ESP32 to broadcast. Leave the password blank for an open network.

Client mode (ESP32 joins your existing WiFi network):

// #define AP_MODE

#define WIFI_CLIENT_SSID "My Network"
#define WIFI_CLIENT_PWD  "My Password"

Comment out #define AP_MODE and fill in your network credentials.

5. Set the device name

#define DEVICE_NAME "ESP32Plus"

This name is broadcast over UDP so ARC's EZB Scan can show the board in its connection dialog. Change it if you have more than one board on the same network.

6. Select board and upload

  1. Tools Board select your ESP32 dev board (e.g. ESP32 Dev Module).
  2. Tools Port select the COM port for the board.
  3. Click Upload.

Open Tools Serial Monitor at 115200 baud to see boot messages and connection activity.

Connecting From ARC

  1. In ARC, add an EZ-B v4 / IoTiny connection (or use EZB Scan from the connection dialog).
  2. If you used AP mode, join the WiFi network you configured (default SSID GetOffMyLawn), then the board's IP will be 192.168.1.1.
  3. If you used Client mode, read the IP from the Serial Monitor at boot, or let EZB Scan auto-discover the device by name.
  4. Click Connect. You'll hear a two-tone "connect" chime from the DAC output. A matching "disconnect" chime plays when ARC disconnects.

Supported ARC Commands

The firmware implements the EZB protocol used by ARC. All commands are accepted so the protocol stream stays in sync, but not every command drives physical hardware on a generic ESP32.

Feature Status Notes
Ping / Firmware ID Fully supported Reports firmware ID 23149
I2C Read / Write Fully supported Uses GPIO 21/22
I2C bus clock speed Fully supported ARC can override at runtime
UART Expansion #0 (init / write / read / available) Fully supported Uses GPIO 16/17
UART Expansion #1 and #2 Accepted, no-op Consumed for protocol sync only
Sound streaming (init / load / play / stop) Fully supported 8-bit PCM @ 14700 Hz via built-in DAC
Servo position / PWM speed / release all Accepted, no-op No servo driver is wired by default
Digital port on / off / read Accepted, no-op Reads return 0
ADC read Accepted, no-op Returns 0
Camera data passthrough (port 24) Fully supported Streams Serial1 RX to TCP clients

If you need real servo output, connect an I2C PWM driver (such as a PCA9685) to GPIO 21/22 and drive it from ARC using the I2C commands.

Camera / Data Passthrough (Port 24)

Anything received on Serial1 (GPIO 12 RX) is streamed to whichever client is connected to TCP port 24. This is the mechanism ARC uses to pull JPEG frames from an attached camera module, but it will pass through any byte stream - not just video. Use it to bridge serial telemetry, sensor streams, or any data source that speaks a raw UART over WiFi.

The bridge uses 1460-byte chunks with a 10 ms flush timeout for low latency. Serial1 uses a 32 KB RX buffer so brief WiFi stalls don't drop data.

Audio Output

ARC's sound-streaming feature plays 8-bit unsigned PCM at 14700 Hz through the ESP32's built-in DAC. Both DAC pins (GPIO 25 and GPIO 26) carry the same mono signal - connect either pin to an amplifier or powered speaker through a coupling capacitor.

The firmware also plays short sine-wave chimes on connect and disconnect so you get audible feedback without watching the Serial Monitor.

Troubleshooting

Board halts at boot with "i2s_driver_install failed" You're using an ESP32-S2/S3/C3/C6/H2. These variants don't have the built-in DAC peripheral this firmware uses. Use an original ESP32.

ARC can't discover the device Confirm the board and PC are on the same network. In Client mode, check the Serial Monitor for the assigned IP. UDP broadcasts are sent to the subnet every 4 seconds on port 4242 - some routers and guest networks block UDP broadcast, in which case connect by IP address directly.

Connection drops or audio stutters Strong WiFi signal matters. The firmware disables WiFi power saving, but weak signal still causes TCP stalls. Move the board closer to the access point or use Client mode on your main network instead of AP mode.

I want to change the pin assignments Edit the #define blocks near the top of the sketch (SERIAL1_RX, SERIAL2_RX, I2C_SDA, etc.) and re-upload. The DAC pins (GPIO 25/26) are fixed in hardware and cannot be changed.

Downloads

Download
  • Lower latency for ARC commands that expect responses (I2C sensor reads, ADC reads, UART device polling)
  • Higher throughput on the UART Expansion bridge for devices that stream data
  • Fewer TCP stalls under heavy command bursts - the EZB task stays responsive and keeps the receive window open
  • More headroom for demanding robot projects that mix servo control, I2C sensors, UART devices, and audio playback simultaneously
Click to show supported capabilities
Supported Capabilities
  • Adjustable I2C clock speed
    The i2c driver allows custom clock speeds to be specified
  • Broadcasts to ARC's PnP network scanner
    Controller broadcasts itself on the network using the ARC PnP network scanner protocol. This is so ARC can find devices on the network which may have dhcp assigned addresses.
  • Can stream Audio v4 codec
    Supports the streaming Audio v4 codec to play music, speech and sound effects out of the DAC on the controller.
  • Can stream video v4 codec
    The controller supports the streaming Video v4 codec on a TCP or UART or USB connection.
  • Hardware UART TX/RX with DMA buffer and adjustable baud rate
    Contains 1 or more hardware UARTs with TX/RX functionality and DMA RX buffering.
  • I2C Master
    The controller supports the ARC I2C commands for Master mode.
  • Native WiFi Connectivity from ARC
    Controller supports WiFi connectivity using TCP between your computer with ARC.
  • PWM Duty on digital ports
    Digital ports can output a PWM between 0% and 100%.
  • PWM servos on digital ports
    The controller supports PWM Servos on digital ports. These are also called Hobby servos.
  • PWM servos on digital ports can release their position
    PWM servo driver on digital ports support the feature to release their holding position.
  • Read/Write Digital I/O Ports
    The ports marked as being digital will respond to Read and Write commands of boolean logic. The status of the digital port will be either TRUE or FALSE when voltage is detected or not, respectively.
Download
  • removed pca9685 native support because its now recommended to use the robot skill
  • added i2c support
  • several bug fixes for performance
Click to show supported capabilities
Supported Capabilities
  • Adjustable I2C clock speed
    The i2c driver allows custom clock speeds to be specified
  • Broadcasts to ARC's PnP network scanner
    Controller broadcasts itself on the network using the ARC PnP network scanner protocol. This is so ARC can find devices on the network which may have dhcp assigned addresses.
  • Can stream Audio v4 codec
    Supports the streaming Audio v4 codec to play music, speech and sound effects out of the DAC on the controller.
  • Can stream video v4 codec
    The controller supports the streaming Video v4 codec on a TCP or UART or USB connection.
  • Hardware UART TX/RX with DMA buffer and adjustable baud rate
    Contains 1 or more hardware UARTs with TX/RX functionality and DMA RX buffering.
  • I2C Master
    The controller supports the ARC I2C commands for Master mode.
  • Native WiFi Connectivity from ARC
    Controller supports WiFi connectivity using TCP between your computer with ARC.
  • PWM Duty on digital ports
    Digital ports can output a PWM between 0% and 100%.
  • PWM servos on digital ports
    The controller supports PWM Servos on digital ports. These are also called Hobby servos.
  • PWM servos on digital ports can release their position
    PWM servo driver on digital ports support the feature to release their holding position.
  • Read/Write Digital I/O Ports
    The ports marked as being digital will respond to Read and Write commands of boolean logic. The status of the digital port will be either TRUE or FALSE when voltage is detected or not, respectively.
Download
  • Added built-in audio FX synthesis (sine-wave tone generator) on the ESP32
  • Implemented audible connect and disconnect tones for EZ-B client connections
  • Added fixed-point oscillator with envelope ramping to prevent audio clicks
  • Improved audio ring buffer handling and underrun behavior (pads silence instead of replaying old data)
  • Simplified audio read/write logic for lower overhead and more predictable timing
  • Added time/frequency helper functions for accurate sample and phase calculations
  • Ensured audio generation yields to FreeRTOS to avoid starving WiFi and audio tasks
  • Minor formatting cleanup and consistency improvements
Click to show supported capabilities
Supported Capabilities
  • Broadcasts to ARC's PnP network scanner
    Controller broadcasts itself on the network using the ARC PnP network scanner protocol. This is so ARC can find devices on the network which may have dhcp assigned addresses.
  • Can stream Audio v4 codec
    Supports the streaming Audio v4 codec to play music, speech and sound effects out of the DAC on the controller.
  • Can stream video v4 codec
    The controller supports the streaming Video v4 codec on a TCP or UART or USB connection.
  • Hardware UART TX/RX with DMA buffer and adjustable baud rate
    Contains 1 or more hardware UARTs with TX/RX functionality and DMA RX buffering.
  • Native WiFi Connectivity from ARC
    Controller supports WiFi connectivity using TCP between your computer with ARC.
  • PWM Duty on digital ports
    Digital ports can output a PWM between 0% and 100%.
  • PWM servos on digital ports
    The controller supports PWM Servos on digital ports. These are also called Hobby servos.
  • PWM servos on digital ports can release their position
    PWM servo driver on digital ports support the feature to release their holding position.
  • Read/Write Digital I/O Ports
    The ports marked as being digital will respond to Read and Write commands of boolean logic. The status of the digital port will be either TRUE or FALSE when voltage is detected or not, respectively.
Download

*Note: Requires Synthiam ARC v2026.02.18.00 or newer

  • Runs as WiFi Access Point or WiFi Client

    • AP mode is enabled by compile-time flag (AP_MODE) with configurable SSID/password.
    • Client mode supported with configurable SSID/password.
  • ARC auto-discovery (EZ-B Scan compatible)

    • Broadcasts UDP discovery packets every ~4 seconds on port 4242.

    • Announces two services:

      • EZ-B service on TCP port 23
      • Camera/UART passthrough service on TCP port 24
    • Includes a DEVICE_NAME string so ARC can show a friendly name.

Multi-task (FreeRTOS) architecture

  • Uses 4 FreeRTOS tasks (not pinned) for compatibility across single-core and dual-core ESP32 variants:

    • EZB Task (high priority): protocol + socket drain on port 23
    • UART Bridge Task: streams Serial1 RX to TCP client on port 24
    • Audio DAC Task: plays streamed 8-bit PCM using ESP32 DAC via I2S DMA
    • Broadcast Task: sends EZ-B scan discovery packets

EZ-B protocol server (TCP port 23)

  • Hosts an EZ-B compatible TCP server on port 23 for Synthiam ARC to connect to.

  • Implements a high-performance RX ring buffer

    • Aggressively drains TCP RX using burst reads to prevent the TCP receive window from shrinking (helps ARC when sending many tiny packets).
    • Parses commands only from the ring buffer (never directly from the socket).

PCA9685 (16-channel PWM/servo) support over I2C

  • Initializes and requires a PCA9685 at I2C address 0x40

    • Uses configurable I2C pins (PCA_SDA_PORT, PCA_SCL_PORT) and 400 kHz I2C clock.
    • If the PCA9685 is not detected, firmware halts in a fatal error loop with wiring/debug info over Serial.
  • Provides ARC control for ports 0-15 via the PCA9685:

    • Servo position (0-180 mapped to pulse range)
    • PWM percent output (0-100%)
    • Digital ON/OFF (full on / full off via PCA9685)
    • Release all servos resets outputs to off

Audio streaming output (ESP32 DAC via I2S)

  • Supports ARC audio streaming commands under CmdEZBv4

    • Accepts audio bytes as 8-bit unsigned PCM (0-255); silence is 128
    • Plays at 14700 Hz sample rate using I2S DMA to the internal DAC
    • Outputs to GPIO 25 and GPIO 26 (same mono signal on both pins)
  • Audio buffering behavior

    • Uses a large in-memory audio ring buffer (configured as 131072 bytes)
    • If the ring buffer fills, extra incoming audio bytes are dropped (to keep networking responsive)

UART features

UART passthrough "Camera" bridge (TCP port 24)

  • Runs a TCP server on port 24 and streams Serial1 RX to the connected client.

  • Tuned for efficiency:

    • Sends in chunks up to 1460 bytes
    • Flush timeout of ~10 ms to avoid tiny packets
    • Enlarged Serial1 RX buffer (32768 bytes) for bursty data

EZ-B v4 UART Expansion 0 (Serial2)

  • Implements ARC-style UART expansion commands for UART Expansion 0:

    • Init: CmdV4UARTExpansion0Init sets baud and opens Serial2 on configurable pins (SERIAL2_RX / SERIAL2_TX)
    • Write: CmdV4UARTExpansion0Write
    • Available: CmdV4UARTExpansion0AvailableBytes
    • Read: CmdV4UARTExpansion0Read
  • UART Expansion 1 and 2 are stubbed

    • Accept commands but return zeros / discard data (placeholders for future expansion)

Status / identification

  • Responds to ARC ping (CmdPing) and reports a firmware ID (CmdGetFirwareID) of 23149.
  • Serial debug output at 115200 baud for startup logs, WiFi events, PCA9685 probe status, and client connect/disconnect messages.
Click to show supported capabilities
Supported Capabilities
  • Broadcasts to ARC's PnP network scanner
    Controller broadcasts itself on the network using the ARC PnP network scanner protocol. This is so ARC can find devices on the network which may have dhcp assigned addresses.
  • Can stream Audio v4 codec
    Supports the streaming Audio v4 codec to play music, speech and sound effects out of the DAC on the controller.
  • Can stream video v4 codec
    The controller supports the streaming Video v4 codec on a TCP or UART or USB connection.
  • Hardware UART TX/RX with DMA buffer and adjustable baud rate
    Contains 1 or more hardware UARTs with TX/RX functionality and DMA RX buffering.
  • Native WiFi Connectivity from ARC
    Controller supports WiFi connectivity using TCP between your computer with ARC.
  • PWM Duty on digital ports
    Digital ports can output a PWM between 0% and 100%.
  • PWM servos on digital ports
    The controller supports PWM Servos on digital ports. These are also called Hobby servos.
  • PWM servos on digital ports can release their position
    PWM servo driver on digital ports support the feature to release their holding position.
  • Read/Write Digital I/O Ports
    The ports marked as being digital will respond to Read and Write commands of boolean logic. The status of the digital port will be either TRUE or FALSE when voltage is detected or not, respectively.

ARC Pro

Upgrade to ARC Pro

Join the ARC Pro community and gain access to a wealth of resources and support, ensuring your robot's success.