abobija / esp-smartconfig-dart

EspTouch and EspTouchV2 implementations of SmartConfig provisioning protocols. Plain Dart. All platforms.
https://pub.dev/packages/esp_smartconfig
MIT License
46 stars 11 forks source link

RangeError on short password Length #6

Closed seikosantana closed 2 years ago

seikosantana commented 2 years ago

I tried using a 3-characters password and it throws the range error. image

If the password is long enough, the error is not thrown. I haven't tried how many characters in maximum that could cause the error.

E/flutter ( 5454): [ERROR:flutter/runtime/dart_isolate.cc(1098)] Unhandled exception:
E/flutter ( 5454): RangeError: Invalid value: Not in inclusive range 0..72: 75
E/flutter ( 5454): #0      List.insertAll (dart:core-patch/growable_array.dart:44:7)
E/flutter ( 5454): #1      EspTouch._dataCodes.<anonymous closure> (package:esp_smartconfig/src/protocols/esptouch.dart:58:17)
E/flutter ( 5454): #2      _IntListMixin.forEach (dart:typed_data-patch/typed_data_patch.dart:215:8)
E/flutter ( 5454): #3      EspTouch._dataCodes (package:esp_smartconfig/src/protocols/esptouch.dart:57:19)
E/flutter ( 5454): #4      EspTouch.prepare (package:esp_smartconfig/src/protocols/esptouch.dart:27:19)
E/flutter ( 5454): #5      Provisioner._startProvisioning (package:esp_smartconfig/src/provisioner.dart:199:9)
E/flutter ( 5454): <asynchronous suspension>
abobija commented 2 years ago

Hi @seikosantana, thanks for the feedback and sorry for the late reply, but I'm wondering how did you even managed to set WiFi password on your router that is shorter than 8 characters, because according to WPA/WPA2 specs, the minimum length of WiFi password is 8 chars.

abobija commented 2 years ago

Closed due no activity.

seikosantana commented 2 years ago

Hi,

Sorry I was away for a while. Back then I didn't remember the minimum length of WiFi password and wasn't aware at that moment. Later I had figured that out so I did set the minimum length of WIFi password on the UI part before starting provision.

But anyway, I probably will suggest that the error message is throws is more specific to the minimum length of WiFi password so it gives better clue of the mistake. Thanks for your effort on this awesome library!

abobija commented 2 years ago

Thanks @seikosantana For sure I will add more descriptive error message for password length. Thanks for feedback.

Edit: Checking for the password min length is done and it is published in new version (1.1.5) version of esp_smartconfig package.