Skip to content

dongquoctien/esp32-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32-LAB

ESP32-LAB is a long-term research and implementation repository for ESP32, focused on clean architecture, real-world IoT patterns, and production scalability.

This repository is not a short-lived demo project. It is designed as an ESP32 laboratory, where core features are implemented, tested, and reused across future products.


🎯 Goals

  • Understand and implement the full capabilities of ESP32
  • Apply IoT best practices (MQTT, OTA, Power, Security)
  • Strictly separate business logic from hardware
  • Enable development & testing without ESP32 hardware
  • Seamlessly port code to real ESP32 devices
  • Serve as a foundation for future IoT / audio products

🧱 Architecture Principles

  • Core logic must be platform-agnostic

  • ESP32 acts only as a platform adapter

  • The same logic should run on:

    • PC mock (no hardware required)
    • Real ESP32 hardware
Core Logic (platform-agnostic)
        ↓
Platform Adapter
  - PC Mock
  - ESP32

📁 Repository Structure

esp32-lab/
├── README.md
├── docs/                 # Architecture & roadmap documentation
│   ├── architecture.md
│   ├── roadmap.md
│   └── conventions.md
├── core/                 # Hardware-independent logic
│   ├── network/          # Wi-Fi, MQTT, HTTP
│   ├── audio/            # Audio logic (playback, queue, state)
│   ├── system/           # State machine, configuration
│   └── utils/
├── examples/             # Feature-based ESP32 examples
│   ├── wifi/
│   ├── mqtt/
│   ├── audio/
│   ├── ble/
│   └── ota/
├── tools/
│   └── pc-mock/          # ESP32 simulation on PC
└── platformio.ini

🛠️ Technology Stack

  • VS Code

  • PlatformIO

  • Frameworks:

    • Arduino (early phases)
    • ESP-IDF (advanced, optional)
  • MQTT: PubSubClient

  • JSON: ArduinoJson

  • Audio: ESP32-audioI2S

  • MQTT Broker: Mosquitto / HiveMQ


🗺️ Feature Roadmap

Phase 1 – Foundation

  • Wi-Fi connection & reconnection
  • Logging & configuration management
  • JSON parsing & validation

Phase 2 – IoT Communication

  • HTTP client
  • MQTT publish / subscribe
  • Command & message schema

Phase 3 – Architecture

  • Event-driven design
  • State machine
  • Retry, timeout & error handling

Phase 4 – Audio

  • Download MP3 from URL
  • Low-bitrate MP3 playback
  • Audio queue & interrupt handling

Phase 5 – No-Hardware Testing

  • PC-based ESP32 mock
  • MQTT + API integration tests
  • Simulated audio output

Phase 6 – Advanced ESP32

  • OTA updates
  • Power management (sleep modes)
  • BLE
  • Security (TLS, certificates)

🔁 Development Workflow

  1. Implement features in core
  2. Test using PC mock
  3. Port adapter to ESP32 hardware
  4. Upload via PlatformIO
  5. Optimize memory & performance
  6. Prepare OTA deployment

🚫 Non-Goals

  • No dependency on ESP32 emulators
  • No hardware-coupled business logic
  • No single-use demo code

🏁 Conclusion

ESP32-LAB is designed to:

  • Provide a structured way to master ESP32
  • Enable real-world IoT & audio device development
  • Serve as a reusable codebase for multiple projects

This repository is meant to evolve over years, not weeks.


📌 Notes

  • Architecture quality is prioritized over the number of examples
  • Every feature is implemented with a production mindset

Happy hacking 🚀

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages