1. Introduction
  2. Author’s Note
  3. How to use this book?
  4. Preparation
  5. 1. Introduction to IoT
    1. 1.1. Architecture of IoT
    2. 1.2. IoT Application in Smart Homes
  6. 2. Introduction and Practice of IoT Projects
    1. 2.1. Introduction to Typical IoT Projects
      1. 2.1.1. Basic Modules for Common IoT Devices
      2. 2.1.2. Basic Modules of Client Applications
      3. 2.1.3. Introduction to Common IoT Cloud Platforms
    2. 2.2. 🧐 Practice: Smart Light Project
      1. 2.2.1. Project Structure
      2. 2.2.2. Project Functions
      3. 2.2.3. Hardware Preparation
      4. 2.2.4. Development Process
    3. 2.3. Summary
  7. 3. Introduction to ESP RainMaker
    1. 3.1. What is ESP RainMaker?
    2. 3.2. The Implementation of ESP RainMaker
      1. 3.2.1. Claiming Service
      2. 3.2.2. RainMaker Agent
      3. 3.2.3. Cloud Backend
      4. 3.2.4. RainMaker Client
    3. 3.3. 🧐 Practice: Key Points for Developing with ESP RainMaker
    4. 3.4. Features of ESP RainMaker
      1. 3.4.1. User Management
      2. 3.4.2. End User Features
      3. 3.4.3. Admin Features
    5. 3.5. Summary
  8. 4. Setting Up Development Environment
    1. 4.1. ESP-IDF Overview
      1. 4.1.1. ESP-IDF Versions
      2. 4.1.2. ESP-IDF Git Workflow
      3. 4.1.3. Choosing a Suitable Version
      4. 4.1.4. Overview of ESP-IDF SDK Directory
    2. 4.2. Setting Up ESP-IDF Development Environment
      1. 4.2.1. Setting up ESP-IDF Development Environment on Linux
      2. 4.2.2. Setting up ESP-IDF Development Environment on Windows
      3. 4.2.3. Setting up ESP-IDF Development Environment on Mac
      4. 4.2.4. Installing VS Code
      5. 4.2.5. Introduction to Third-Party Development Environments
    3. 4.3. ESP-IDF Compilation System
      1. 4.3.1. Basic Concepts of Compilation System
      2. 4.3.2. Project File Structure
      3. 4.3.3. Default Build Rules of the Compilation System
      4. 4.3.4. Introduction to the Compilation Script
      5. 4.3.5. Introduction to Common Commands
    4. 4.4. 🧐 Practice: Compiling Example Program “Blink”
      1. 4.4.1. Example Analysis
      2. 4.4.2. Compiling the Blink Program
      3. 4.4.3. Flashing the Blink Program
      4. 4.4.4. Serial Port Log Analysis of the Blink Program
    5. 4.5. Summary
  9. Hardware and Driver Development
  10. 5. Hardware Design of Smart Light Products based on ESP32-C3
    1. 5.1. Features and Composition of Smart Light Products
    2. 5.2. Hardware Design of ESP32-C3 Core System
      1. 5.2.1. Power Supply
      2. 5.2.2. Power-on Sequence and System Reset
      3. 5.2.3. SPI Flash
      4. 5.2.4. Clock Source
      5. 5.2.5. RF and Antenna
      6. 5.2.6. Strapping Pins
      7. 5.2.7. GPIO and PWM Controller
    3. 5.3. 🧐 Practice: Building a Smart Light System with ESP32-C3
      1. 5.3.1. Selecting Modules
      2. 5.3.2. Configuring GPIOs of PWM Signals
      3. 5.3.3. Downloading Firmware and Debugging Interface
      4. 5.3.4. Guidelines for RF Design
      5. 5.3.5. Guidelines for Power Supply Design
    4. 5.4. Summary
  11. 6. Driver Development
    1. 6.1. Driver Development Process
    2. 6.2. ESP32-C3 Peripheral Applications
    3. 6.3. LED Driver Basics
      1. 6.3.1. Color Spaces
      2. 6.3.2. LED Driver
      3. 6.3.3. LED Dimming
      4. 6.3.4. Introduction to PWM
    4. 6.4. LED Dimming Driver Development
      1. 6.4.1. Non-Volatile Storage (NVS)
      2. 6.4.2. LED PWM Controller (LEDC)
      3. 6.4.3. LED PWM Programming
    5. 6.5. 🧐 Practice: Adding Drivers to Smart Light Project
      1. 6.5.1. Button Driver
      2. 6.5.2. LED Dimming Driver
    6. 6.6. Summary
  12. Wireless Communication and Control
  13. 7. Wi-Fi Configuration and Connection
    1. 7.1. Basics of Wi-Fi
      1. 7.1.1. Introduction to Wi-Fi
      2. 7.1.2. Evolution of IEEE 802.11
      3. 7.1.3. Wi-Fi Concepts
      4. 7.1.4. Wi-Fi Connection
    2. 7.2. Basics of Bluetooth
      1. 7.2.1. Introduction to Bluetooth
      2. 7.2.2. Bluetooth Concepts
      3. 7.2.3. Bluetooth Connection
    3. 7.3. Wi-Fi Network Configuration
      1. 7.3.1. Wi-Fi Network Configuration Guide
      2. 7.3.2. SoftAP
      3. 7.3.3. SmartConfig
      4. 7.3.4. Bluetooth
      5. 7.3.5. Other Methods
    4. 7.4. Wi-Fi Programming
      1. 7.4.1. Wi-Fi Components in ESP-IDF
      2. 7.4.2. Exercise: Wi-Fi Connection
      3. 7.4.3. Exercise: Smart Wi-Fi Connection
    5. 7.5. 🧐 Practice: Wi-Fi Configuration in Smart Light Project
      1. 7.5.1. Wi-Fi Connection in Smart Light Project
      2. 7.5.2. Smart Wi-Fi Configuration
    6. 7.6. Summary
  14. 8. Local Control
    1. 8.1. Introduction to Local Control
      1. 8.1.1. Application of Local Control
      2. 8.1.2. Advantages of Local Control
      3. 8.1.3. Discovering Controlled Devices through Smartphones
      4. 8.1.4. Data Communication Between Smartphones and Devices
    2. 8.2. Common Local Discovery Methods
      1. 8.2.1. Broadcast
      2. 8.2.2. Multicast
      3. 8.2.3. Comparison Between Broadcast and Multicast
      4. 8.2.4. Multicast Application Protocol mDNS for Local Discovery
    3. 8.3. Common Communication Protocols for Local Data
      1. 8.3.1. Transmission Control Protocol (TCP)
      2. 8.3.2. HyperText Transfer Protocol (HTTP)
      3. 8.3.3. User Datagram Protocol (UDP)
      4. 8.3.4. Constrained Application Protocol (CoAP)
      5. 8.3.5. Bluetooth Protocol
      6. 8.3.6. Summary of Data Communication Protocols
    4. 8.4. Guarantee of Data Security
      1. 8.4.1. Introduction to Transport Layer Security (TLS)
      2. 8.4.2. Introduction to Datagram Transport Layer Security (DTLS)
    5. 8.5. 🧐 Practice: Local Control in Smart Light Project
      1. 8.5.1. Creating a Wi-Fi-based Local Control Server
      2. 8.5.2. Verifying Local Control Functionality using Scripts
      3. 8.5.3. Creating a Bluetooth-based Local Control Server
    6. 8.6. Summary
  15. 9. Cloud Control
    1. 9.1. Introduction to Remote Control
    2. 9.2. Cloud Data Communication Protocols
      1. 9.2.1. MQTT Introduction
      2. 9.2.2. MQTT Principles
      3. 9.2.3. MQTT Message Format
      4. 9.2.4. Protocol Comparison
      5. 9.2.5. Setting Up MQTT Broker on Linux and Windows
      6. 9.2.6. Setting Up MQTT Client Based on ESP-IDF
    3. 9.3. Ensuring MQTT Data Security
      1. 9.3.1. Meaning and Function of Certificates
      2. 9.3.2. Generating Certificates Locally
      3. 9.3.3. Configuring MQTT Broker
      4. 9.3.4. Configuring MQTT Client
    4. 9.4. 🧐 Practice: Remote Control through ESP RainMaker
      1. 9.4.1. ESP RainMaker Basics
      2. 9.4.2. Node and Cloud Backend Communication Protocol
      3. 9.4.3. Communication between Client and Cloud Backend
      4. 9.4.4. User Roles
      5. 9.4.5. Basic Services
      6. 9.4.6. Smart Light Example
      7. 9.4.7. RainMaker App and Third-Party Integrations
    5. 9.5. Summary
  16. 10. Smartphone App Development
    1. 10.1. Introduction to Smartphone App Development
      1. 10.1.1. Overview of Smartphone App Development
      2. 10.1.2. Structure of the Android Project
      3. 10.1.3. Structure of the iOS Project
      4. 10.1.4. Lifecycle of an Android Activity
      5. 10.1.5. Lifecycle of iOS ViewController
    2. 10.2. Creating a New Smartphone App Project
      1. 10.2.1. Preparing for Android Development
      2. 10.2.2. Creating a New Android Project
      3. 10.2.3. Adding Dependencies for MyRainmaker
      4. 10.2.4. Permission Request in Android
      5. 10.2.5. Preparing for iOS Development
      6. 10.2.6. Creating a New iOS Project
      7. 10.2.7. Adding Dependencies for MyRainmaker
      8. 10.2.8. Permission Request in iOS
    3. 10.3. Analysis of the App’s Functional Requirements
      1. 10.3.1. Analysis of the Project’s Functional Requirements
      2. 10.3.2. Analysis of User Management Requirements
      3. 10.3.3. Analysis of Device Provisioning and Binding Requirements
      4. 10.3.4. Analysis of Remote-Control Requirements
      5. 10.3.5. Analysis of Scheduling Requirements
      6. 10.3.6. Analysis of User Center Requirements
    4. 10.4. Development of User Management
      1. 10.4.1. Introduction to RainMaker APIs
      2. 10.4.2. Initiating Communication via Smartphone
      3. 10.4.3. Account Registration
      4. 10.4.4. Account Login
    5. 10.5. Development of Device Provisioning
      1. 10.5.1. Scanning Devices
      2. 10.5.2. Connecting Devices
      3. 10.5.3. Generating Secret Keys
      4. 10.5.4. Getting Node ID
      5. 10.5.5. Provisioning Devices
    6. 10.6. Development of Device Control
      1. 10.6.1. Binding Devices to Cloud Accounts
      2. 10.6.2. Getting a List of Devices
      3. 10.6.3. Getting Device Status
      4. 10.6.4. Changing Device Status
    7. 10.7. Development of Scheduling and User Center
      1. 10.7.1. Implementing Scheduling Function
      2. 10.7.2. Implementing User Center
      3. 10.7.3. More Cloud APIs
    8. 10.8. Summary
  17. 11. Firmware Upgrade and Version Management
    1. 11.1. Firmware Upgrade
      1. 11.1.1. Overview of Partition Tables
      2. 11.1.2. Firmware Boot Process
      3. 11.1.3. Overview of the OTA Mechanism
    2. 11.2. Firmware Version Management
      1. 11.2.1. Firmware Marking
      2. 11.2.2. Rollback and Anti-Rollback
    3. 11.3. 🧐 Practice: Over-the-air (OTA) Example
      1. 11.3.1. Upgrade Firmware Through a Local Host
      2. 11.3.2. Upgrade Firmware Through ESP RainMaker
    4. 11.4. Summary
  18. Optimisation and Mass Production
  19. 12. Power Management and Low-Power Optimisation
    1. 12.1. ESP32-C3 Power Management
      1. 12.1.1. Dynamic Frequency Scaling
      2. 12.1.2. Power Management Configuration
    2. 12.2. ESP32-C3 Low-Power Mode
      1. 12.2.1. Modem-sleep mode
      2. 12.2.2. Light-sleep Mode
      3. 12.2.3. Deep-sleep mode
      4. 12.2.4. Current Consumption in Different Power Modes
    3. 12.3. Power Management and Low-Power Debugging
      1. 12.3.1. Log Debugging
      2. 12.3.2. GPIO Debugging
    4. 12.4. Practice: Power Management in Smart Light Project
      1. 12.4.1. Configuring Power Management Feature
      2. 12.4.2. Use Power Management Locks
      3. 12.4.3. Verifying Power Consumption
    5. 12.5. Summary
  20. 13. Enhanced Device Security Features
    1. 13.1. Overview of IoT Device Data Security
      1. 13.1.1. Why Securing IoT Device Data?
      2. 13.1.2. Basic Requirements for IoT Device Data Security
    2. 13.2. Data Integrity Protection
      1. 13.2.1. Introduction to Integrity Verification Method
      2. 13.2.2. Integrity Verification of Firmware Data
      3. 13.2.3. Example
    3. 13.3. Data Confidentiality Protection
      1. 13.3.1. Introduction to Data Encryption
      2. 13.3.2. Introduction to Flash Encryption Scheme
      3. 13.3.3. Flash Encryption Key Storage
      4. 13.3.4. Working Mode of Flash Encryption
      5. 13.3.5. Flash Encryption Process
      6. 13.3.6. Introduction to NVS Encryption
      7. 13.3.7. Examples of Flash Encryption and NVS Encryption
    4. 13.4. Data Legitimacy Protection
      1. 13.4.1. Introduction to Digital Signature
      2. 13.4.2. Overview of Secure Boot Scheme
      3. 13.4.3. Introduction to Software Secure Boot
      4. 13.4.4. Introduction to Hardware Secure Boot
      5. 13.4.5. Examples
    5. 13.5. Practice: Security Features In Mass Production
      1. 13.5.1. Flash Encryption and Secure Boot
      2. 13.5.2. Enabling Flash Encryption and Secure Boot with Batch Flash Tools
      3. 13.5.3. Enabling Flash Encryption and Secure Boot in Smart Light Project
    6. 13.6. Summary
  21. 14. Firmware Burning and Testing for Mass Production
    1. 14.1. Firmware Burning in Mass Production
      1. 14.1.1. Defining Data Partitions
      2. 14.1.2. Firmware Burning
    2. 14.2. Mass Production Testing
    3. 14.3. Practice: Mass Production Data in Smart Light Project
    4. 14.4. Summary
  22. 15. ESP Insights: Remote Monitoring Platform
    1. 15.1. Introduction to ESP Insights
    2. 15.2. Getting Started with ESP Insights
      1. 15.2.1. Getting Started with ESP Insights in the esp-insights Project
      2. 15.2.2. Running Example in the esp-insights Project
      3. 15.2.3. Reporting Coredump Information
      4. 15.2.4. Customising Logs of Interest
      5. 15.2.5. Reporting Reboot Reason
      6. 15.2.6. Reporting Custom Metrics
    3. 15.3. Practice: Using ESP Insights in Smart Light Project
    4. 15.4. Summary

ESP32-C3 Wireless Adventure: A Comprehensive Guide to IoT

Data Confidentiality Protection

  • Introduction to Data Encryption

  • Introduction to Flash Encryption Scheme

  • Flash Encryption Key Storage

  • Working Mode of Flash Encryption

  • Flash Encryption Process

  • Introduction to NVS Encryption

  • Examples of Flash Encryption and NVS Encryption