Open karthiksensesemi opened 7 months ago
I have also the same problem. Although it only occurs for me on android 14. Other androids are working and iOS devices are also fine.
Could you please share your device info? @karthiksensesemi
My android version is 11. Now the above data transfer works. But once the data is received and iot wifi is disconnected. The mobile Internet/Wifi doesn't work within the app.
Are you forcing wifi usage , and if so. Are you also unforcing it before disconnecting?
https://pub.dev/documentation/wifi_iot/latest/wifi_iot/WiFiForIoTPlugin/forceWifiUsage.html
Thanks a ton. I fixed it. I was clueless and frustrated from past 3 weeks.
Glad to hear that. How did you resolve the socket problem?
Actually,
My code:
Future
readWriteWifi({String? req}) async {
try {
//connect and listen to data
socket = await Socket.connect(wifiHost, wifiPort);
print(socket!.address);
socket!.write(req);
final a = socket!.listen((List
I think I need to test with android 14 as well. And will come back with update.
I've got it working as well. The problem was that on some androids you have to force wifi before pinging the device. iOS doesn't require that.
I'm using this package for auto-connect to iot device. It gets connected successfully but when i wanted to receive data through tcp socket "SocketException: Connection failed (OS Error: Network is unreachable, errno = 101), address = 192.168.1.1, port = 5002". I face the above error whereas when i manually to wifi, i receive all the data through sockets.