Skip to content
/ esp_iot_template Public template

Reusable **ESP IoT template** application based on [ESP-IDF](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/index.html) as a standalone device with a basic feature-set

License

Notifications You must be signed in to change notification settings

thebino/esp_iot_template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP IoT template

License

Reusable ESP IoT template application based on ESP-IDF as a standalone device with a basic feature-set:

  • Over-the-air update via BLE
  • Provisioning via BLE to create or connect to a nearby WIFI Network
  • Handle a single sensor (components/button)
  • Control a single actor (components/lighting)

Setup

ESP32

  1. Install Microsoft Visual Code
  2. Open the project folder esp32 within vscode
  3. install the recommended ESP-IDF extension
  4. run the Espressif IDF Setup wizard

Android

  1. Install Android studio
  2. Open the project folder android within the IDE
  3. run a gradle build by invoking $ ./gradlew installDebug

CI/CD

ESP32

Continuous Integration Pipeline [ESP32]

Continuous Integration Pipeline [Android]

This project is using automated processes known as continuous integration and continuous delivery (CI/CD) by using github actions

Pull requests will automatically run automated tests on a self-hosted runner. Self-hosted runners are used to access custom hardware, in this particular project an ESP32 device to run target based unit tests on it.

Testing without a real device is called Host-based testing and is currently not supported by this template since it is still experimental.

Structure

├── android                     
├── docs
└── esp32
    ├── components
    │   ├── bluetooth                 Handle communication via bluetooth LE
    │   │   ├── include
    │   │   ├── src
    │   │   └── test
    │   ├── lighting                  Change the state of the LEDs regarding the configuration.
    │   │   ├── include
    │   │   ├── src
    │   │   └── test
    │   ├── button                    Observe button states and react regarding the configuration.
    │   │   ├── include
    │   │   ├── src
    │   │   └── test
    │   └── wifi                      Handle communication via Wireles LAN
    │       ├── include
    │       ├── src
    │       └── test
    ├── host_test                     Test application to run on a Linux Host
    ├── main                          Main application to run on an esp device
    ├── sdkconfig.defaults            Default project configuration
    └── test                          Test application to run on an esp device

Testing

Target based tests

Run tests on a real device locally connected by build and flash the application inside the esp32/test folder.

idf.py --project-dir esp32/test --build-dir esp32/test/build flash monitor

Linux-host based unit tests

Run host-based test by

esp_ble_device/test_host$ idf.py --preview set-target linux

Self-hosted runners

run the following command to get the cgroup properties

ls -l /dev/ | grep tty.usbserial

Based on the ESP-S3-WROOM-1

Summary

  • Button Long-press on/off device

  • BLE Profile OTA Service OTA Control OTA Data Communication Service Communication Control Communication Data

  • Wifi start/stop AP

Features

  • Housing
  • PCB
  • BLE Pairing / Bonding
  • OTA Firmware update
  • Sensor (button / rotary)
  • Actuator (LED Ring / Piezo Buzzer)

Housing

The case is designed with OpenSCAD based on this devkit-v4-case

3D Printed Case

PCB

The PCB is designed with KiCad & KiCad libraries by Espressif

Base PCB

Power supply

  • EREMIT 3.7V 2500mAh LiPo (JST PH 2.0mm)

Wiring

Rotary CLK 4 DT 15 SW 13

  • 3V GND GND

Resource

BLE Pairing & Bonding ESP32-Devkit-Type-C ESP32-Devkit Case JLCPCB PCB fabrication espbs

About

Reusable **ESP IoT template** application based on [ESP-IDF](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/index.html) as a standalone device with a basic feature-set

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages