Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

with your example i can't find the esp32 ble provision device #4

Open
williamz64 opened this issue Jul 14, 2020 · 6 comments
Open

with your example i can't find the esp32 ble provision device #4

williamz64 opened this issue Jul 14, 2020 · 6 comments

Comments

@williamz64
Copy link

with your example i can't find the esp32 ble provision device, have any advice?

@trannhoduc
Copy link

I have the same situation as you
Do you think this provision is different from a regular provision?
As far as I know it consists of steps:

  1. Disconnect with the node
  2. Try to reconnect with the node
  3. Connect successfully and discover ESP-BLE-MESH GATT Service
  4. Get Composition Data of the node and add AppKey to it

But the API is :
EspProv prov = EspProv( transport: TransportBLE(ble_peripheral), security: Security1(pop: pop)); var success = await prov.establishSession(); await prov.sendWifiConfig(ssid: event.ssid, password: event.password); await prov.applyWifiConfig();

I don't know why we have WIFI here ?

@saps1063
Copy link

saps1063 commented Apr 5, 2021

I have the same issue. It's because of they are scanning particular service uuid on ble_service file.

return _bleManager.startPeripheralScan( uuids: [TransportBLE.PROV_BLE_SERVICE], scanMode: ScanMode.opportunistic, allowDuplicates: true);

Scanning without uuid show me esp device in scan list. But it's not going further for the provisioning.

@SamKlim
Copy link

SamKlim commented Nov 15, 2021

@saps1063 I am working on this too, once i removed the particular service uuid, the next error i faced was :

Error conencting to device NoSuchMethodError: The method 'isConnected' was called on null. If this was the error you received, the fix is to in the startProvisioning() method, the fix is to move Peripheral p = peripheral ?? selectedPeripheral; below await _bleManager.stopPeripheralScan(). Have you worked on this further?

@MurtuzaSrashtaSoft
Copy link

show bottom sheet after 2 send delay.

example/lib/ble_screen/ble_screen.dart


 if (state is BleStateLoaded) {
              return ScanList(state.bleDevices, Icons.bluetooth, onTap:
                  (Map<String, dynamic> item, BuildContext _context) async {
                BlocProvider.of<BleBloc>(_context).add(BleEventSelect(item));
                BlocProvider.of<BleBloc>(_context).add(BleEventStopScan());
                await Future.delayed(Duration(seconds: 2));
                _showBottomSheet(item, context);
              });
            }

@skashok
Copy link

skashok commented May 30, 2022

Hi, I am also working on the same. after giving empty UUID list it list the my device, when I select it, It throws this exception

2022-05-30 16:24:59.478540+0530 Runner[1381:48973] flutter: ^[[38;5;196m│ ⛔ Error conencting to device NoSuchMethodError: The method 'securitySession' was called on null.<…>
2022-05-30 16:24:59.478598+0530 Runner[1381:48973] flutter: ^[[38;5;196m│ ⛔ Receiver: null<…>
2022-05-30 16:24:59.478652+0530 Runner[1381:48973] flutter: ^[[38;5;196m│ ⛔ Tried calling: securitySession(null)<…>
2022-05-30 16:24:59.478708+0530 Runner[1381:48973] flutter: ^[[38;5;196m└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────<…>
2022-05-30 16:24:59.479583+0530 Runner[1381:48973] flutter: ^[[38;5;196m┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────<…>
2022-05-30 16:24:59.479660+0530 Runner[1381:48973] flutter: ^[[38;5;196m│ #0 WifiBloc._mapLoadToState (package:esp_provisioning_example/wifi_screen/wifi_bloc.dart:50:1<…>
2022-05-30 16:24:59.479707+0530 Runner[1381:48973] flutter: ^[[38;5;196m│ #1 <asynchronous suspensio<…>
2022-05-30 16:24:59.479773+0530 Runner[1381:48973] flutter: ^[[38;5;196m├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄<…>
2022-05-30 16:24:59.479975+0530 Runner[1381:48973] flutter: ^[[38;5;196m│ ⛔ Error scan WiFi network NoSuchMethodError: The method 'startScanWiFi' was called on null.<…>
2022-05-30 16:24:59.480380+0530 Runner[1381:48973] flutter: ^[[38;5;196m│ ⛔ Receiver: null<…>
2022-05-30 16:24:59.480466+0530 Runner[1381:48973] flutter: ^[[38;5;196m│ ⛔ Tried calling: startScanWiFi()<…>
2022-05-30 16:24:59.480525+0530 Runner[1381:48973] flutter: ^[[38;5;196m└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────<…>

I have the same issue. It's because of they are scanning particular service uuid on ble_service file.

return _bleManager.startPeripheralScan( uuids: [TransportBLE.PROV_BLE_SERVICE], scanMode: ScanMode.opportunistic, allowDuplicates: true);

Scanning without uuid show me esp device in scan list. But it's not going further for the provisioning.

@skashok
Copy link

skashok commented May 30, 2022

Hi, I am also working on the same. after giving empty UUID list it list the my device, when I select it, It throws this exception

2022-05-30 16:24:59.478540+0530 Runner[1381:48973] flutter: ^[[38;5;196m│ ⛔ Error conencting to device NoSuchMethodError: The method 'securitySession' was called on null.<…>
2022-05-30 16:24:59.478598+0530 Runner[1381:48973] flutter: ^[[38;5;196m│ ⛔ Receiver: null<…>
2022-05-30 16:24:59.478652+0530 Runner[1381:48973] flutter: ^[[38;5;196m│ ⛔ Tried calling: securitySession(null)<…>
2022-05-30 16:24:59.478708+0530 Runner[1381:48973] flutter: ^[[38;5;196m└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────<…>
2022-05-30 16:24:59.479583+0530 Runner[1381:48973] flutter: ^[[38;5;196m┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────<…>
2022-05-30 16:24:59.479660+0530 Runner[1381:48973] flutter: ^[[38;5;196m│ #0 WifiBloc._mapLoadToState (package:esp_provisioning_example/wifi_screen/wifi_bloc.dart:50:1<…>
2022-05-30 16:24:59.479707+0530 Runner[1381:48973] flutter: ^[[38;5;196m│ https://github.com//issues/1 <asynchronous suspensio<…>
2022-05-30 16:24:59.479773+0530 Runner[1381:48973] flutter: ^[[38;5;196m├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄<…>
2022-05-30 16:24:59.479975+0530 Runner[1381:48973] flutter: ^[[38;5;196m│ ⛔ Error scan WiFi network NoSuchMethodError: The method 'startScanWiFi' was called on null.<…>
2022-05-30 16:24:59.480380+0530 Runner[1381:48973] flutter: ^[[38;5;196m│ ⛔ Receiver: null<…>
2022-05-30 16:24:59.480466+0530 Runner[1381:48973] flutter: ^[[38;5;196m│ ⛔ Tried calling: startScanWiFi()<…>
2022-05-30 16:24:59.480525+0530 Runner[1381:48973] flutter: ^[[38;5;196m└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────<…>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants