블루투스 저전력(BLE)을 통해 ESP32 모듈의 구성 설정을 간소화하도록 설계된 플러터 플러그인입니다. 장치가 ESP32 단위를 탐지하고 연결하며 간단하고 일관된 인터페이스를 통해 구성할 수 있도록 해주어 무선으로 원격 설정이 가능합니다. 복잡한 와이어링이나 수동 네트워크 입력 없이 빠른 배포와 기기 온보딩이 필요한 IoT 프로젝트에 적합합니다. 이 플러그인은 안드로이드 및 iOS 플랫폼을 모두 지원하여 모바일 환경에서 광범위한 호환성을 보장합니다.
사용 사례
IoT 장치 온보딩
무선 ESP32 구성
스마트 홈 장치 설정
자동 펌웨어 프로비저닝
원격 장치 관리
주요 기능
BLE 기반 장치 프로비저닝
크로스 플랫폼 지원 (Android 및 iOS)
장치 탐지용 간단한 API
보안 연결 처리
실시간 상태 피드백
적합한 대상
사물인터넷 개발자
임베디드 시스템 엔지니어
스마트 기기용 모바일 앱 개발자
하드웨어 스타트업
현장 기술자가 연결 장치를 배포하는
고려 사항
BLE 호환 장치가 필요합니다
호환 펌웨어를 갖춘 ESP32 모듈에 한정
백그라운드 모드는 추가 구성이 필요할 수 있습니다
안드로이드에서 필요한 네트워크 권한
iOS 백그라운드 실행 제한
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
esp_provisioning_ble
A library for provisioning a ESP32 with Bluetooth BLE
The transport attribute accepts only the ProvTransport type, and the security attribute accepts only the ProvSecurity type, which has an implementation called Security1 that you will use to pass the Proof-of-Possession (PoP).
Establish a session with the device:
After that, you will need to establish a session with the device. You can do this using the establishSession function, which returns three types of EstablishSessionStatus:
Connected: When the device establishes a connection successfully.
Disconnected: When an error occurs while establishing a connection with the device.
KeyMismatch: When the Proof-of-Possession (PoP) is incorrect.
var sessionStatus = await prov.establishSession();
log.d("Session Status = $sessionStatus");
switch (sessionStatus) {
caseEstablishSessionStatus.Connected:
emit(BleWifiEstablishedConnectionState());
caseEstablishSessionStatus.Disconnected:
emit(BleWifiEstablishedConnectionFailedState());
caseEstablishSessionStatus.Keymismatch:
emit(BleWifiEstablishedConnectionKeyMismatch());
}
Scan networks from the device:
To scan Wi-Fi networks, use the startScanWifi function, which returns a list of WifiAp objects, each of which has the following attributes:
String ssid
int rssi
bool active
bool private
var listWifi = await prov.startScanWiFi();
log.d('Found ${listWifi.length} Wi-Fi networks');
for (var obj in listWifi) {
log.d('Wi-Fi network: ${obj.ssid}');
}
Send and Apply WI-Fi Config:
To send and apply config use the sendWifiConfig and applyWifiConfig functions, respectively.
The Protocol Communication (protocomm) component manages secure
sessions and provides the framework for multiple transports. The
application can also use the protocomm layer directly to have
application-specific extensions for the provisioning or non-provisioning
use cases.
Following features are available for provisioning:
Proof-of-possession (support with protocomm_security1 only)
Salt and Verifier (support with protocomm_security2 only)
Protocomm internally uses protobuf (protocol buffers) for secure
session establishment. Users can choose to implement their own security
(even without using protobuf). Protocomm can also be used without any
security layer.
Protocomm provides the framework for various transports:
Bluetooth LE
Wi-Fi (SoftAP + HTTPD)
Console, in which case the handler invocation is automatically
taken care of on the device side. See Transport Examples below for code
snippets.
Note that for protocomm_security1 and protocomm_security2, the client
still needs to establish sessions by performing the two-way handshake.
See Unified Provisioning for more details about the secure handshake logic.
Comparasion:
Comparison with esp_provisioning_softap package:
Repo
softap support
ble support
cryptography
protobuf
esp_provisioning_softap
✔️
✖️
✔️ (2.0.1)
✔️ (2.0.0)
esp_provisioning_ble
✖️
✔️
✔️ (2.5.0)
✔️ (3.0.0)
Last update: 10/06/2023 (Octorber 6, 2023).
TODOS:
Test and create examples of the package with others Bluetooth packages.