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

插件详情v1.1.0

esptouch_smartconfig

空安全 Flutter ESP Touch 智能配置插件。在 Android 和 iOS 上运行。ESP 设备连接目标 AP,设备需要运行智能配置。

AndroidiOS
近 30 天下载
98
喜欢数
25
Pub 分数
150

安装插件

flutter pub add esptouch_smartconfig

插件介绍

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

一个空安全的 Flutter 插件,可让 ESP 设备使用 Smart Config 连接到目标 Wi-Fi 网络。它支持 Android 和 iOS 平台,通过应用程序广播 Wi-Fi 凭据,实现 ESP 基于物联网设备的无缝配置。该插件专为支持 Smart Config 协议的 ESP 芯片设计,允许用户无需手动输入即可配置设备。非常适合需要快速设备设置的物联网应用开发者。

适合场景

  • 物联网设备接入
  • 智能家居设备设置
  • 无线传感器网络配置
  • ESP32/ESP8266 设备配对
  • 自动 Wi-Fi 配置

主要特点

  • 空安全支持
  • 跨平台(Android & iOS)
  • ESP Smart Config 集成
  • 用于Wi-Fi凭证传输的简单API
  • 实时连接反馈

适合对象

  • 物联网应用开发者
  • 硬件集成商
  • 智能家居产品创作者
  • 嵌入式系统工程师
  • 原型开发团队

使用建议

  • 需要带有智能配置固件的ESP设备
  • 仅限支持智能配置的设备
  • Android 上所需的网络权限
  • iOS 后台执行限制
  • 取决于正确的ESP固件实现

原始 README

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

esptouch_smartconfig

Espressif’s ESP-TOUCH protocol implements the Smart Config technology to help users connect ESP8266EX- and ESP32-embedded devices (hereinafter referred to as the device) to a Wi-Fi network through simple configuration on a smartphone flutter app.

Getting Started

Android

Add Permission android/app/src/main/AndroidManifest.xml

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
iOS

image

Add ios/Info.plist

<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Used to Location's Info always for Using Beacon.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Used to Location's Info always for Using Beacon.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Used to Location's Info for Using Beacon when In Use.</string>

Usage

late Stream<ESPTouchResult>? _stream;
final Set<ESPTouchResult> _results = Set();

@override
  void initState() {
    _stream = EsptouchSmartconfig.run(widget.ssid, widget.bssid,
        widget.password, widget.deviceCount, widget.isBroadcast);
    super.initState();
  }
  
@override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: IconButton(
            icon: Icon(Icons.arrow_back),
            onPressed: () {
              Navigator.of(context).pop(_results);
            }),
        backgroundColor: Colors.red,
        title: Text(
          'Task',
        ),
      ),
      body: Container(
        child: StreamBuilder<ESPTouchResult>(
          stream: _stream,
          builder: (context, AsyncSnapshot<ESPTouchResult> snapshot) {
            if (snapshot.hasError) {
              return error(context, 'Error in StreamBuilder');
            }
            switch (snapshot.connectionState) {
              case ConnectionState.active:
                _results.add(snapshot.data!);
                return resultList(context, ConnectionState.active);
              case ConnectionState.none:
                return noneState(context);
              case ConnectionState.done:
                if (snapshot.hasData) {
                  _results.add(snapshot.data!);
                  return resultList(context, ConnectionState.done);
                } else
                  return noneState(context);
              case ConnectionState.waiting:
                return waitingState(context);
            }
          },
        ),
      ),
    );
  } 

Reference

ESP Touch

https://github.com/smaho-engineering/esptouch_flutter
https://github.com/kittenbot/flutter_smartconfig
https://github.com/EspressifApp/EsptouchForIOS
https://github.com/EspressifApp/EsptouchForAndroid

Wifi Info

https://github.com/flutter/plugins

Version

iOS Version v2.2.0
Android Version v2.0.0

所属分类

源码仓库

使用此插件的项目

暂无相关数据。