搜索插件、代码仓与 APP 分类

插件详情v3.0.0

esp_smartconfig

EspTouch 和 EspTouchV2 的 SmartConfig 配置协议实现。纯 Dart。适用于所有平台。

AndroidiOSmacOSWindowsLinux
近 30 天下载
580
喜欢数
46
Pub 分数
160

安装插件

flutter pub add esp_smartconfig

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个用于物联网设备配置的 Esptouch 和 EsptouchV2 智能配置协议的 Dart 实现。可让 ESP8266/ESP32 设备通过智能手机或桌面应用程序无缝连接 Wi-Fi,无需直接网络访问。完全平台无关,支持 Android、iOS、macOS、Windows 和 Linux。专为希望在跨平台 Flutter 应用中集成零接触设备配对功能的开发者设计。该包完全使用 Dart 编写,无原生依赖,确保在所有支持平台上兼容。

适合场景

  • 物联网设备接入
  • 智能家居设备设置
  • 嵌入式设备配置
  • 跨平台 Wi-Fi 配置
  • 自动设备注册

主要特点

  • Esptouch 和 EsptouchV2 支持
  • 纯 Dart 实现
  • 多平台兼容性
  • 无需原生代码
  • 轻量且高效
  • 安全的Wi-Fi凭证传输

适合对象

  • Flutter 开发人员构建物联网应用
  • 使用ESP芯片的硬件集成商
  • 需要零接触设备设置的应用程序
  • 跨平台移动/桌面解决方案
  • 避免原生平台代码的项目

使用建议

  • 需要兼容的 ESP8266/ESP32 固件
  • 移动平台所需的网络权限
  • 仅限支持Esptouch协议的设备
  • 不处理配置后的设备重启
  • 最佳用于本地网络环境

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

esp_smartconfig

pub version license

Dart implementation of EspTouch provisioner. Supports Android, iOS, Windows, Linux and macOS.

Implemented protocols

  • EspTouch
  • EspTouch V2

Supported platforms

All non-web platforms are supported. Web platform is not supported mainly because browsers does not allow UDP communication.

If you are going to use this library on Desktop platforms make sure that UDP port 18266 is open in firewall for incoming data.

Breaking Change iOS 14.6/16

The breaking change was implemented with 14.6. However, it seems to be the case that the mentioned problem only occurs on devices with iOS version 16. It results in the fact that no connection to the ESP can be established.

How to:

  • You need an Apple-Developer account
  • After the Dev-Account has been approved, you have to make a request via this form to be allowed to use the Multicast Api.
  • Then you can follow this guide (new process)

Demo videos

Console App Flutter Mobile App
Demo Video - Console App Demo Video - Flutter Mobile App

Example

Several examples of using this library are available in example folder.

import 'package:esp_smartconfig/esp_smartconfig.dart';

final provisioner = Provisioner.espTouch();

provisioner.listen((response) {
    print("Device ${response.bssidText} connected to WiFi!");
});

try {
    await provisioner.start(ProvisioningRequest.fromStrings(
        ssid: "NETWORK NAME",
        bssid: "ROUTER BSSID", // Optional
        password: "NETWORK PASSWORD",
    ));

    // If you are going to use this library in Flutter
    // this is good place to show some Dialog and wait for exit
    //
    // Or simply you can delay with Future.delayed function
    await Future.delayed(Duration(seconds: 10));
} catch (e, s) {
    print(e);
}

// Provisioning does not have any timeout so it needs to be
// stopped manually
provisioner.stop();

SmartConfig

The SmartConfigTM is a provisioning technology to connect a new Wi-Fi device to a Wi-Fi network.

The advantage of this technology is that the device does not need to directly know SSID or password of an Access Point (AP). Those information is provided using this library. This is particularly important to headless device and systems, due to their lack of a user interface.

Author

GitHub: abobija
Homepage: abobija.com

License

MIT

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目