Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 121 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,126 @@
# Miscellaneous
*.class
*.lock
!pubspec.lock
*.log
*.pyc
*.swp
.DS_Store
.dart_tool/
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/*

# Visual Studio Code related
.classpath
.project
.settings/
.vscode/*


# Flutter repo-specific
/bin/cache/
/bin/mingit/
/dev/benchmarks/mega_gallery/
/dev/bots/.recipe_deps
/dev/bots/android_tools/
/dev/docs/doc/
/dev/docs/flutter.docs.zip
/dev/docs/lib/
/dev/docs/pubspec.yaml
/dev/integration_tests/**/xcuserdata
/dev/integration_tests/**/Pods
/packages/flutter/coverage/
./version

# packages file containing multi-root paths
.packages.generated

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/

build/
flutter_*.png
linked_*.ds
unlinked.ds
unlinked_spec.ds
**/.fvm/

# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java
**/android/key.properties
**/android/.idea/
*.jks

# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Flutter.podspec
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/.last_build_id
**/ios/Flutter/flutter_assets/
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*

# Coverage
coverage/

# Web related

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Exceptions to the above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
!/dev/ci/**/Gemfile.lock
!.vscode/extensions.json
!.vscode/launch.json
!.vscode/tasks.json
!.vscode/settings.json
!.idea/codeStyles/
!.idea/dictionaries/
!.idea/runConfigurations/
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"yaml.schemaStore.enable": false
}
28 changes: 20 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
## [1.0.0] - 2022-03-24

* Stable release for Espressif Esp32 Soft Ap provisioning with protobuf and cryptography with null-safety. Based on version 1.0.1 from esp_softap_provisioning.
## [2.0.0] - 2023-10-12

> Author: [@jeroen-meijer](https://github.com/jeroen-meijer)

## [1.0.1] - 2022-03-25
- **feat!**: Many classes have been altered in small and significant ways. In particular, expect these types of changes:
- Most classes are now marked immutable.
- Functions that previously returned a `Future<bool>` now return a `Future<void>`. In cases where these functions returned `false`, they now throw an exception.
- Functions that internally caught exceptions and returned `null` now throw those exceptions.
- **chore!: upgrade Dart SDK constraint to 3.0.0 or higher, upgrade Flutter SDK constraint to 3.10.0 or higher.**
- feat: add `logger.dart` for consumer-customizable logging (import `package:esp_provisioning_softap/logger.dart` and set `logger` as desired).
- chore: add [`very_good_analysis`](https://pub.dev/packages/very_good_analysis) package and linter rules and fix all issues.
- chore: upgrade all dependencies to latest versions.
- chore: format all files.

* Minor bugfixes. sendReceiveCustomData-Endpoint can now be specified.
## [1.0.3] - 2022-09-17

- Update Kotlin Version from 1.3.50 to 1.5.20

## [1.0.2] - 2022-05-02

* Minor bugfixes in provisioning process.
- Minor bugfixes in provisioning process.

## [1.0.3] - 2022-09-17
## [1.0.1] - 2022-03-25

- Minor bugfixes. sendReceiveCustomData-Endpoint can now be specified.

## [1.0.0] - 2022-03-24

* Update Kotlin Version from 1.3.50 to 1.5.20
- Stable release for Espressif Esp32 Soft Ap provisioning with protobuf and cryptography with null-safety. Based on version 1.0.1 from esp_softap_provisioning.
36 changes: 21 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ A Flutter plugin for provisioning ESP32 modules with SoftAP

[![GitHub release](https://img.shields.io/github/release/Naereen/StrapDown.js.svg)](https://github.com/nicop2000/esp_provisioning_softap/releases)
[![GitHub license](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://github.com/nicop2000/esp_provisioning_softap/blob/main/LICENSE)

<!--[![pub points](https://badges.bar/sentry/pub%20points)](https://pub.dev/packages/esp_provisioning_softap/score) -->

## Example App

GIF by original pub-package [esp_softap_provisioning](https://github.com/omert08/esp_softap_provisioning)

<img src="https://raw.githubusercontent.com/omert08/esp_softap_provisioning/main/example/esp_softap_example.gif" width="360"/>
Expand All @@ -14,36 +17,38 @@ GIF by original pub-package [esp_softap_provisioning](https://github.com/omert08

Comparison to esp_provisioning:

| Repo | softap support | ble support | cryptography | protobuf
| ------------- | ------------- | ------------- | ------------- | -------------|
| esp_provisioning_softap | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_check_mark: (2.0.1) | :heavy_check_mark: (2.0.0)
| esp_provisioning | :heavy_multiplication_x: | :heavy_check_mark: | :heavy_check_mark: (1.4.1) | :heavy_check_mark: (1.0.1)
| Repo | softap support | ble support | cryptography | protobuf |
| ----------------------- | ------------------------ | ------------------------ | -------------------------- | -------------------------- |
| esp_provisioning_softap | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_check_mark: (2.0.1) | :heavy_check_mark: (2.0.0) |
| esp_provisioning | :heavy_multiplication_x: | :heavy_check_mark: | :heavy_check_mark: (1.4.1) | :heavy_check_mark: (1.0.1) |

Last update: 24 / 03 / 2022

## Usage

Changes on pubspec.yaml
```flutter pub add esp_provisioning_softap_null_safe```
`flutter pub add esp_provisioning_softap_null_safe`

then, run ```flutter pub get```,
then, run `flutter pub get`,

We need to give permissions for http connections.

* Changes on AndroidManifest.xml (<your_app>/android/app/src/main/AndroidManifest.xml):
- Changes on AndroidManifest.xml (<your_app>/android/app/src/main/AndroidManifest.xml):

Add `<uses-permission android:name="android.permission.INTERNET"/>` and `android:usesCleartextTraffic="true"` to AndroidManifest.xml.

Add ``` <uses-permission android:name="android.permission.INTERNET"/> ``` and ```android:usesCleartextTraffic="true"``` to AndroidManifest.xml.
```
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
...
android:usesCleartextTraffic="true"
android:usesCleartextTraffic="true"
...
...
```

* Changes on Info.plist (<your_app>/ios/Runner/Info.plist) :
- Changes on Info.plist (<your_app>/ios/Runner/Info.plist) :

```
<plist version="1.0">
<dict>
Expand Down Expand Up @@ -76,10 +81,11 @@ For iOS, it's recommended to put platform version >= 9.0 , You can edit this var
Library is ready to use, you can check example app directory for implementation. <b> Notice that Proof of posession (POP) should be matching with ESP's. </b>

## Credits
* I updated the code from the pub-package [esp_softap_provisioning](https://github.com/omert08/esp_softap_provisioning) to null safety.

- I updated the code from the pub-package [esp_softap_provisioning](https://github.com/omert08/esp_softap_provisioning) to null safety.

The original package by Omer Taban referred to:
* I have referred to sunshine-tech [esp_provisioning](https://github.com/sunshine-tech/esp_provisioning) repository for native cipher code.

* I have referred to Espressif [esp_prov](https://github.com/espressif/esp-idf/tree/cf457d4/tools/esp_prov) repository for provisioning structure.

- I have referred to sunshine-tech [esp_provisioning](https://github.com/sunshine-tech/esp_provisioning) repository for native cipher code.

- I have referred to Espressif [esp_prov](https://github.com/espressif/esp-idf/tree/cf457d4/tools/esp_prov) repository for provisioning structure.
30 changes: 6 additions & 24 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
include: package:very_good_analysis/analysis_options.yaml

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
analyzer:
exclude:
- 'lib/**/*.pb*.dart'

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
# TODO: Remove once docs are implemented.
public_member_api_docs: false
12 changes: 12 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"words": [
"bssid",
"Cryptor",
"proto",
"protocomm",
"Pubkey",
"rssi",
"softap",
"spinkit"
]
}
12 changes: 12 additions & 0 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
include: package:very_good_analysis/analysis_options.yaml

analyzer:
exclude:
- 'lib/**/*.pb*.dart'

linter:
rules:
# TODO: Remove once docs are implemented.
public_member_api_docs: false
library_private_types_in_public_api: false
avoid_print: false
57 changes: 31 additions & 26 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,43 @@ import 'package:flutter/material.dart';
typedef ItemTapCallback = void Function(Map<String, dynamic> item);

void main() {
runApp(MaterialApp(home: HomeScreen()));
runApp(const MaterialApp(home: HomeScreen()));
}

class HomeScreen extends StatelessWidget {
const HomeScreen({super.key});

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.lightBlue,
title: const Text('ESP SoftAp Provisioning'),
),
body: Center(
child: MaterialButton(
color: Colors.lightBlueAccent,
elevation: 5,
padding: EdgeInsets.all(15.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(5))),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => SoftApScreen()));
},
child: Text(
'Start Provisioning',
style: Theme.of(context)
.textTheme
.headline6
.copyWith(color: Colors.white),
),
appBar: AppBar(
backgroundColor: Colors.lightBlue,
title: const Text('ESP SoftAp Provisioning'),
),
body: Center(
child: MaterialButton(
color: Colors.lightBlueAccent,
elevation: 5,
padding: const EdgeInsets.all(15),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(5)),
),
));
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute<void>(
builder: (context) => const SoftApScreen(),
),
);
},
child: Text(
'Start Provisioning',
style: Theme.of(context)
.textTheme
.titleLarge!
.copyWith(color: Colors.white),
),
),
),
);
}
}
Loading