ItKindaWorks/ESPHelper
소개
A library to make using WiFi & MQTT on the ESP8266 easy.
시스템 및 인프라What you can do
- Automatic WiFi and MQTT Connection Management: Handles connecting, reconnecting, and resubscribing to MQTT topics.
- MQTT Topic Subscription Management: Add, remove, and auto-resubscribe to topics.
- OTA Updates: Easily enable/disable OTA, set OTA password and hostname.
- Broadcast Mode: Create an access point for configuration or OTA when no WiFi is available.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalESPHelper
ESPHelper is a C++ library designed to simplify WiFi and MQTT connectivity for ESP8266 and ESP32 platforms. It manages WiFi and MQTT connections, automatic reconnection, topic subscriptions, and supports OTA (Over-The-Air) updates, making it ideal for IoT and home automation projects.
Features
- Automatic WiFi and MQTT Connection Management: Handles connecting, reconnecting, and resubscribing to MQTT topics.
- MQTT Topic Subscription Management: Add, remove, and auto-resubscribe to topics.
- OTA Updates: Easily enable/disable OTA, set OTA password and hostname.
- Broadcast Mode: Create an access point for configuration or OTA when no WiFi is available.
- Web Configuration: Optional web interface for device configuration (
ESPHelperWebConfig). - Callback Support: Set custom callbacks for WiFi connection, WiFi loss, and MQTT messages.
- Secure MQTT: Supports SSL/TLS connections to MQTT brokers.
Requirements
Make sure you have these libraries installed:
- Metro
- PubSubClient (Current Supported Version - 2.8)
- ArduinoJson (Current Supported Version - 7.0.4)
- SafeString (Current Supported Version - 4.1.30)
In addition to those libraries, make sure that you have the ESP core files installed for your platform.
Getting Started
See the examples/GettingStarted folder for usage examples.
Basic Usage
#include "ESPHelper.h"
ESPHelper helper;
void setup() {
helper.setSSID("yourSSID");
helper.setPASS("yourPassword");
helper.setMQTTIP("mqtt.example.com");
helper.begin();
}
void loop() {
helper.loop();
}
Useful Methods:
bool begin(); Initialize the system (must be called once).
int loop(); must be called as often as possible to maintain connections and run the various subsystems
bool subscribe(char* topic); subscribe to a given MQTT topic (will NOT auto re-subscribe on connection lost)
bool addSubscription(char* topic); add a topic to the subscription list (will auto re-subscribe on connection lost)
bool removeSubscription(char* topic); remove a topic from the subscription list and unsubscribe
void publish(char* topic, char* payload); publish a given MQTT message to a given topic
ToDo
- Implement callback for lost WiFi connection
관련 프로젝트 살펴보기
불러오는 중…