Skip to content

Developer-RU/ESP32-DFU-iOS

ESP32-DFU iOS Client

License: MIT Platform Firmware

SwiftUI iOS client for over-the-air firmware updates of ESP32 devices over BLE using the Nordic Legacy DFU profile.

The app is implemented with CoreBluetooth and does not depend on proprietary mobile SDKs.

Screenshots

Home screen   Device picker   Settings

Key Features

  • BLE scanning with a configurable timeout and countdown.
  • Device list sorted by RSSI.
  • Firmware file import through the iOS file picker.
  • Full Legacy DFU stage flow with visible timeline and progress.
  • Configurable PRN, MTU preference, scan duration, and reconnect behavior.
  • Automatic reconnect attempts on transient BLE disconnections.
  • CoreBluetooth restoration support for interrupted sessions.
  • Built-in localization system with multiple supported languages.

Requirements

  • iOS 16.0+
  • Xcode 15+
  • macOS with command-line tools
  • XcodeGen (project is generated from project.yml)
  • Physical iPhone for BLE validation
  • ESP32 target running compatible DFU firmware

Quick Start

git clone https://github.com/Developer-RU/ESP32-DFU-iOS.git
cd ESP32-DFU-iOS

# Install XcodeGen once (if needed)
brew install xcodegen

# Generate project
xcodegen generate

# Open project
open ESP32-DFU.xcodeproj

Then:

  1. Select a physical iPhone as the run destination.
  2. Configure Signing and Team in Xcode.
  3. Build and run.

DFU Protocol Summary

This client uses Nordic Legacy DFU UUIDs:

  • Service: 00001530-1212-EFDE-1523-785FEABCD123
  • Control Point: 00001531-1212-EFDE-1523-785FEABCD123
  • Packet: 00001532-1212-EFDE-1523-785FEABCD123

High-level sequence:

  1. Connect and discover DFU characteristics.
  2. Enable notifications on Control Point.
  3. Set PRN and send Start DFU.
  4. Send init packet metadata (device/app info, size, CRC32).
  5. Send firmware payload in chunks over Packet characteristic.
  6. Validate image and send Activate & Reset.

For deeper details, see docs/dfu-protocol.md.

Project Structure

ESP32-DFU/
  App/
    ESP32_DFUApp.swift
    Localization.swift
  Models/
    BLEDevice.swift
    DFUStage.swift
  Services/
    BLEScanner.swift
    DFUSessionManager.swift
  Views/
    ContentView.swift
    DevicePickerView.swift
    SettingsView.swift
    StageTimelineView.swift
  Resources/
  Info.plist
project.yml

Build and Validation

# Generate project
xcodegen generate

# Build for simulator without signing
xcodebuild \
  -project ESP32-DFU.xcodeproj \
  -scheme ESP32-DFU \
  -sdk iphonesimulator \
  -destination 'platform=iOS Simulator,name=iPhone 15' \
  CODE_SIGNING_ALLOWED=NO \
  build

Documentation Index

  • docs/architecture.md
  • docs/dfu-protocol.md
  • docs/development.md
  • docs/troubleshooting.md
  • REAL_DFU_TEST_PLAN.md
  • CONTRIBUTING.md
  • SECURITY.md
  • SUPPORT.md
  • CHANGELOG.md

Wiki source pages are also included in the wiki directory for easy publishing to GitHub Wiki.

Related Firmware Project

Use the companion firmware repository:

Typical firmware build command (PlatformIO):

pio run

License

MIT License. See LICENSE.

About

SwiftUI iPhone application for over-the-air firmware updates of ESP32 devices over BLE using the Nordic Legacy DFU profile. No proprietary SDK required — implemented directly on CoreBluetooth.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors

Languages