Skip to content

espressif/esp-iot-solution

 
 

Repository files navigation

ESP32 IoT Solution Overview


Espressif IoT Device Drivers, Documentations And Solutions.

release/v1.1 based on ESP-IDF v4.0.1

Contents

  • components:

    • Small drivers of different devices like button and LED
    • Drivers of sensors
    • Drivers of different I2C devices
    • Friendly APIs of WiFi and OTA
  • documents:

    • Documentations of some important features
    • Instruction of some different solutions
  • examples:

    • Example project using this framework
  • tools:

    • Different tools and scripts
    • Unit-test project

Examples

Components

Features

Framework

General fucntions

  • ADC - Driver and example of ADC
  • Button - Driver and example of using buttons and keys.
  • Debugs - Provides different commands for debugging via UART.
  • LED - Driver and example of using LED, which provides such APIs as to blink with different frequency.
  • Light - Driver and example of using PWM to drive a light, which provides such APIs as to control several channels of LED.
  • OTA - Driver and example of upgrading firmware from the given URL.
  • Param - Driver and example of saving and loading data via NVS flash.
  • Power Meter - Driver and example of a single-phase energy meter such as BL0937 or HLW8012.
  • Relay - Driver and example of a relay with different driving modes.
  • Weekly timer - Driver and example of a weekly timer to trigger events at some certain moment in each week.

HMI

  • LittlevGL - Driver of using LittlevGL embedded GUI library.
  • uGFX - Driver and example of using uGFX embedded GUI library.

I2C Sensors

  • APDS9960 - Driver and example of reading APDS9960, which is an ambient light photo Sensor.
  • BH1750 - Driver and example of reading BH1750 light sensor (GY-30 module).
  • BME280 - Driver and example of reading BME280, which is an pressure and temperature Sensor.
  • FT5X06 - Driver and example of reading FT5X06, which is a touch Sensor.
  • HDC2010 - Driver and example of reading HDC2010, which is a low power temperature and humidity sensor.
  • HTS221 - Driver and example of reading HTS221 temperature and humidity sensor.
  • LIS2DH12 - Driver and example of reading LIS2DH12, which is a 3-axis accelerometer.
  • MVH3004D - Driver and example of reading MVH3004D temperature and humidity sensor.
  • VEML6040 - Driver and example of reading VEML6040, which is a RGBW color sensor.

I2C Devices

  • AT24C02 - Driver and example of driving AT24C02, which is an eeprom storage.
  • CH450 - Driver and example of driving CH450, which is a 7-segment LED driver.
  • HT16C21 - Driver and example of driving HT16C21, which is a LED driver.
  • IS31FL3XXX - Driver and example of driving is31fl3xxx series chips, which are light effect LED driver chips.
  • MCP23017 - Driver and example of using mcp23017, which is a 16-bit I/O expander.
  • SSD1306 - Driver and example of using ssd1306, which is a 132 x 64 dot matrix OLED/PLED segment driver chip.

I2S Devices

  • ILI9806 - Driver and example of driving ILI9806 LCD.
  • NT35510 - Driver and example of driving NT35510 LCD.

Motor

  • Servo - Driver and example of driving servo motors.
  • A4988 - Driver and example of driving A4988, which is a stepper motor driver.

Network Abstract

  • MQTT - Driver and example of using MQTT client, which is a light-weight IoT protocol.
  • TCP - API and example of using TCP server and client in C++.
  • UDP - API and example of using UDP in C++.
  • Alink - API and example of connecting and communicating with Alink cloud service.
    • Note: This example has been abandoned, please refer: esp32-alink

SPI Devices

  • E-ink display - API and example of driving and controlling SPI E-ink screen.
  • LCD screen - API and example of driving and controlling SPI LCD.
  • XPT2046 Touch screen - API and example of driving and controlling SPI Touch Screen.

WiFi Abstract

Documents

Tools

unit-test-app (Make)

To use uint-test, follow these steps:

  • Change to the directory of unit-test-app

    cd YOUR_IOT_SOLUTION_PATH/tools/unit-test-app
    
  • Use the default sdkconfig and compile unit-test-app by make IOT_TEST_ALL=1 -j8

    make defconfig
    make IOT_TEST_ALL=1
    
  • Flash the images by make flash

    make IOT_TEST_ALL=1 flash
    
  • Reset the chip and see the uart log using an uart tool such as minicom

  • All kinds of components will be shown by uart

    Here's the test menu, pick your combo:
    (1)     "Sensor BH1750 test" [bh1750][iot][sensor]
    (2)     "Button test" [button][iot]
    (3)     "Button cpp test" [button_cpp][iot]
    (4)     "Dac audio test" [dac_audio][iot][audio]
    (5)     "Debug cmd test" [debug][iot]
    (6)     "Deep sleep gpio test" [deep_sleep][rtc_gpio][current][iot]
    (7)     "Deep sleep touch test" [deep_sleep][touch][current][iot]
     ......
    
  • You need to send the index of the unit you want to test by uart. Test code of the unit you select will be run

Quick Start

Hardware

Setting up Development Environment

  1. Install ESP-IDF v4.0.1 Step By Step

Current branch based on ESP-IDF v4.0.1

  1. Get ESP-IoT-Solution

    git clone --recursive https://github.com/espressif/esp-iot-solution
  2. Initialize the Submodules

    git submodule update --init --recursive
  3. Set up the Environment Variables

    export IOT_SOLUTION_PATH=~/esp/esp-iot-solution

Creating Your Project (CMake)

  • We can regard IoT solution project as a platform that contains different device drivers and features

  • Add-on project: If you want to use those drivers and build your project base on the framework, you need to include the IoT components into your project's CMakeLists.txt.

    cmake_minimum_required(VERSION 3.5)
    
    include($ENV{IOT_SOLUTION_PATH}/component.cmake)
    include($ENV{IDF_PATH}/tools/cmake/project.cmake)
    
    project(empty-project)
    
  • Stand-alone component: if you just want to pick one of the component and put it into your existing project, you just need to copy the single component to your project components directory. But you can also append the component list in your project's CMakeLists.txt like this:

    set(EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS} ${IOT_SOLUTION_PATH}/components/{component_you_choose}")
    

Creating Your Project (Legacy GNU Make)

  • We can regard IoT solution project as a platform that contains different device drivers and features

  • Add-on project: If you want to use those drivers and build your project base on the framework, you need to include the IoT components into your project's Makefile.

    include $(IOT_SOLUTION_PATH)/component.mk
    include $(IDF_PATH)/make/project.mk
    
  • Stand-alone component: if you just want to pick one of the component and put it into your existing project, you just need to copy the single component to your project components directory. But you can also append the component list in your project Makefile like this:

    EXTRA_COMPONENT_DIRS += $(IOT_SOLUTION_PATH)/components/{component_you_choose}