सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
esptouch_flutter एक Flutter प्लगइन है जो ESP-8266 और ESP-32 डिवाइस के लिए Wi-Fi नेटवर्क कॉन्फ़िगर करने के लिए ESP-Touch (स्मार्ट कॉन्फ़िग) कार्यक्षमता सक्षम करता है। यह मोबाइल डिवाइस से लक्षित हार्डवेयर तक वाईफाई के द्वारा कॉन्फ़िगरेशन डेटा भेजकर बिना किसी ब्रेक के नेटवर्क सेटअप की अनुमति देता है। यह Android और iOS दोनों के साथ संगत है, और आवश्यक लॉगिन डेटा के हाथ से इनपुट के बिना आईओटी डिवाइस के ओनबोर्डिंग को सरल बनाता है। प्लगइन को एक सरल API के उपयोग से आसानी से Flutter ऐप में एकीकृत किया जा सकता है।
उपयोग
आईओटी उपकरण जोड़ना
ESP मॉड्यूल के लिए Wi-Fi सेटअप
स्मार्ट होम डिवाइस सेटअप
स्वचालित उपकरण प्रदान करना
ESP उपकरणों के साथ मोबाइल ऐप एकीकरण
मुख्य विशेषताएँ
ESP-Touch प्रोटोकॉल का समर्थन करता है
Android और iOS पर काम करता है
सरल API एकीकरण
हाथ से SSID/पासवर्ड दर्ज करने की आवश्यकता नहीं है
वास्तविक समय उपकरण खोज
इनके लिए उपयुक्त
आईओटी एप्लिकेशन बनाने वाले डेवलपर्स
ESP चिप्स का उपयोग करने वाले हार्डवेयर इंटीग्रेटर
स्मार्ट डिवाइसेज के लिए मोबाइल ऐप्स
शून्य स्पर्श उपकरण सेटअप की आवश्यकता वाले प्रोजेक्ट
विचार योग्य बातें
संगत ESP फर्मवेयर की आवश्यकता है
ESP-Touch समर्थित उपकरणों तक सीमित
Android/iOS पर आवश्यक नेटवर्क की अनुमतियाँ
कुछ प्लेटफॉर्म पर पृष्ठभूमि निष्पादन की आवश्यकता हो सकती है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
esptouch_flutter
Flutter plugin for ESP-Touch to configure network for ESP-8266 and ESP-32 devices. Runs on iOS and Android.
esptouch_flutter is Flutter plugin package which contains an API for ESP-Touch written in Dart combined with
platform-specific implementation for Android using Java and iOS using Objective-C.
This package provides a high customizability to the ESP Touch tasks and an idiomatic Dart interface for launching tasks. Custom task parameters lets the users of this plugin change how long the task runs, you could set it to hours, if this is what your workflow requires.
import'package:esptouch_flutter/esptouch_flutter.dart';
// Somewhere in your widget...finalESPTouchTask task = ESPTouchTask(
ssid: 'My WiFi network',
bssid: 'ab:cd:ef:12:23:34',
password: 'I love SMAHO',
);
finalStream<ESPTouchResult> stream = task.execute();
final printResult = (ESPTouchResult result) {
print('IP: ${result.ip} MAC: ${result.bssid}');
};
StreamSubscription<ESPTouchResult> streamSubscription = stream.listen(printResult);
// Don't forget to cancel your stream subscription.// You might cancel after the UDP wait+send time has passed (default 1 min)// or you could cancel when the user asked to cancel// for example, either via X button, or popping a route off the stack.
streamSubscription.cancel();
If you would like to customize the task, provide an ESPTouchTaskParameter instance as taskParameter to ESPTouchTask. In the code example, I specify the types for clarity but you can omit the types as Dart can infer them.
finalESPTouchTask task = ESPTouchTask(
ssid: 'My WiFi network',
bssid: 'ab:cd:ef:12:23:34',
password: 'I love Flutter and ESP-Touch, too',
// Tweak the task using task parameters
taskParameter: ESPTouchTaskParameter(waitUdpReceiving: Duration(hour: 12)),
);
// You can still stop the task at any point by calling .cancel on the stream subscription:
streamSubscription.cancel();
In a real world example, you'd get the WiFi credentials from the user and you could either display the configured device, save it locally in SQLite or send it to your backend.
Fundamentals
Use a real phone for development. The plugin will not work in emulators and simulators, so you need real phones for development. Run flutter devices to verify.
Prepare your embedded devices. To verify that the ESP-Touch app works, you need some hardware with ESP8266 and ESP32 to connect to your WiFi network.
connectivity
You may to provide an easy way for getting the current WiFi network's SSID and BSSID. Use the connectivity plugin for discovering the state of the network (WiFi & mobile/cellular) connectivity on Android and iOS.
ESP-Touch
Using ESP-Touch, you can configure network for ESP8266 and ESP32 devices.
Espressif’s ESP-Touch protocol implements the Smart Config technology to help users connect
ESP8266EX- and ESP32-embedded devices to a Wi-Fi network through simple configuration on a
smartphone.
The original iOS and
Android modules had to be heavily customized and
tweaked in order to support custom task parameters.
Known issues
We needed full customizability for the touch task parameters, these made changing a significant
chunk of the Android and iOS platform side code necessary.
We added builders for the task parameters as this looked like a solution that required the least
changes to the platform code.
The only way I could implement this plugin is by pasting the platform-specific code into this
project. One reason for this was that it wasn't published anywhere as easily installable packages,
and the second reason is that I had to tweak the platform code to support configuration of
the ESPTouchTaskParameters. This means that new changes to the original git repositories do not
automatically show up in this project, so we need to manually update the Android and iOS code.
The underlying Android and iOS apps support different task parameters. There were multiple
changes especially around IPv4 vs IPv6 handling. The plugin does not handle all of these
differences.
Keeping track of finished tasks is necessary on Flutter's side.
AES support (last I checked the support differred on Android and iOS, so I haven't added them)
Breaking change in iOS 14.6
Starting with iOS 14.6 the com.apple.developer.networking.multicast entitlement is required, to allow the broadcasting of IP packages on iOS, which is used by esptouch.
In order ot enable it, you need to request the entitlemant as an account holder here.
Once you are enrolled, you can configure it here
If you are coming from IoT background, you might not know what Flutter is.
Flutter is Google's UI toolkit for creating beautiful, native experiences for iOS and Android from a single codebase. For help getting started with Flutter, view the online documentation.
This repository contains a Flutter plugin package for ESP-Touch. A plugin package is a specialized package that includes platform-specific implementation code for Android and iOS. The Flutter portion of the app sends messages to its host (iOS or Android) over a platform channel. This plugin relies on platform channels (event channels) heavily.