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

provisioner.listen can not get any data #18

Closed TONYCHOU81905 closed 12 months ago

TONYCHOU81905 commented 12 months ago

Hello everyone, below is my code, my esp can receive wifi information , but my app can not receive any data that esp is connected. Does there anyone face the same issue as me?

provisioner.listen((response) { debugPrint('SSID:${response.ipAddressText}'); debugPrint("\n" "\n------------------------------------------------------------------------\n" "Device ($response) is connected to WiFi!" "\n------------------------------------------------------------------------\n"); });

abobija commented 12 months ago

From README:

If you are going to use this library on Desktop platforms make sure that UDP port 18266 is open in the firewall for incoming data.

TONYCHOU81905 commented 12 months ago

but I'm using on phone, but neither ios nor Android can not listen to any data. Is there any configuration that I need to be careful? Thank you

abobija commented 12 months ago

For Android make sure to have these permissions in the AndroidManifest.xml file:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
TONYCHOU81905 commented 12 months ago

But in ios, we face the same issue. And we have already added Multicast capability in my project