esp_smartconfig 2.0.4 copy "esp_smartconfig: ^2.0.4" to clipboard
esp_smartconfig: ^2.0.4 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:loggerx/loggerx.dart';

void main() async {
  logging.level = LogLevel.debug;

  final provisioner = Provisioner.espTouch();

  provisioner.listen((response) {
    log.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) {
    log.error(e, s);
  }

  provisioner.stop();
  exit(0);
}
38
likes
160
pub points
86%
popularity

Publisher

verified publisherabobija.com

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

loggerx, pointycastle

More

Packages that depend on esp_smartconfig