esp_smartconfig 3.0.0 copy "esp_smartconfig: ^3.0.0" to clipboard
esp_smartconfig: ^3.0.0 copied to clipboard

EspTouch and EspTouchV2 implementations of SmartConfig provisioning protocols. Plain Dart. All platforms.

example/example.dart

import 'dart:io';

import 'package:esp_smartconfig/esp_smartconfig.dart';
import 'package:logging/logging.dart';

void main() async {
  Logger.root.level = Level.FINER;
  Logger.root.onRecord.listen((record) {
    print('[${record.level.name}] ${record.message}');
  });

  final provisioner = Provisioner.espTouch();

  provisioner.listen((response) {
    Logger.root.info("\n"
        "\n---------------------------------------------------------\n"
        "Device ($response) is connected to WiFi!"
        "\n---------------------------------------------------------\n");
  });

  try {
    await provisioner.start(ProvisioningRequest.fromStrings(
      ssid: "Renault 1.9D",
      bssid: "f8:d1:11:bf:28:5c", // optional
      password: "renault19",
    ));

    await Future.delayed(Duration(seconds: 10));
  } catch (e, s) {
    Logger.root.shout("Error", e, s);
  }

  provisioner.stop();
  exit(0);
}
45
likes
160
points
681
downloads

Publisher

verified publisherabobija.com

Weekly Downloads

EspTouch and EspTouchV2 implementations of SmartConfig provisioning protocols. Plain Dart. All platforms.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

logging, pointycastle

More

Packages that depend on esp_smartconfig