App connects to esp32 and perform read and write operations in respectively. But When I power off the esp app is crashing without providing any kind of exception.
Exception : W/System.err(20805): io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | com.polidea.rxandroidble2.exceptions.BleDisconnectedException: Disconnected from MAC='XX:XX:XX:XX:XX:XX' with status 0 (GATT_SUCCESS)
W/System.err(20805): at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
Please help,
App connects to esp32 and perform read and write operations in respectively. But When I power off the esp app is crashing without providing any kind of exception.
Exception : W/System.err(20805): io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | com.polidea.rxandroidble2.exceptions.BleDisconnectedException: Disconnected from MAC='XX:XX:XX:XX:XX:XX' with status 0 (GATT_SUCCESS) W/System.err(20805): at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
onConnection Function :
D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26da enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26d9 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26aa enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26ac enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26ad enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26a9 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26ae enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26af enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26b0 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26b3 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26b1 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26b2 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26b4 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26b6 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26b5 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26b7 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26ab enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26ba enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26bb enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26bc enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26bd enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26be enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26bf enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26c0 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26c1 enable: false D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26c2 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26c3 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26c4 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26c5 enable: false D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26c6 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26c7 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26c8 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26c9 enable: false D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26cd enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26ca enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26cb enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26cc enable: false D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26ce enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26cf enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26d5 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26d4 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26d7 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26d6 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26d8 enable: true D/BluetoothGatt(14231): setCharacteristicNotification() - uuid: beb5483e-36e1-4688-b7f5-ea07361b26d0 enable: true
And When I power off esp..
Lost connection to device.
Here is my code inside onConnection method: onConnectDevice(int index) { _currentConnectionStream = flutterReactiveBle.connectToAdvertisingDevice( id: foundBleUARTDevices[index].id, prescanDuration: Duration(seconds: 5), withServices: [ _UART_UUID, _CHARACTERISTIC_UUID_SPEED_INTERNAL, _CHARACTERISTIC_UUID_MAX_SPEED, _CHARACTERISTIC_UUID_AVG_SPEED, _CHARACTERISTIC_UUID_TOT_DISTANCE, _CHARACTERISTIC_UUID_RANGE, _CHARACTERISTIC_UUID_DRIVING_RANGE, _CHARACTERISTIC_UUID_PERCENTAGE, _CHARACTERISTIC_UUID_CONTROLLER_CURRENT, _CHARACTERISTIC_UUID_BATTERY_SOH, _CHARACTERISTIC_UUID_BATTERY_TEMPRATURE, _CHARACTERISTIC_UUID_BATTERY_VOLTAGE, _CHARACTERISTIC_UUID_BATTERY_CURRENT, _CHARACTERISTIC_UUID_CONTROLLER_VOLTAGE, _CHARACTERISTIC_UUID_CONTROLLER_TEMPRATURE, _CHARACTERISTIC_UUID_CONTROLLER_MAPPING, _CHARACTERISTIC_UUID_MOTOR_RPM, _CHARACTERISTIC_UUID_MOTOR_TEMPRATURE, _CHARACTERISTIC_UUID_MOTOR_ODO, _CHARACTERISTIC_UUID_CONTROLLER_POWER_TUBE_FAULT, _CHARACTERISTIC_UUID_CONTROLLER_DRIVING_POWER_FAULT, _CHARACTERISTIC_UUID_CONTROLLER_OVER_CURRENT_FAULT, _CHARACTERISTIC_UUID_CONTROLLER_OVER_VOLTAGE_PROTECTION, _CHARACTERISTIC_UUID_CONTROLLER_OVER_TEMPRATURE_PROTECTION, _CHARACTERISTIC_UUID_MOTOR_PHASE_WIRE_FAULT, _CHARACTERISTIC_UUID_MOTOR_HALL_FAULT, _CHARACTERISTIC_UUID_MOTOR_OVER_TEMPRATURE_PROTECTION, _CHARACTERISTIC_UUID_CONTROLLER_UNDER_VOLTAGE_PROTECTION, _CHARACTERISTIC_UUID_MOTOR_STALL_PROTECTION, _CHARACTERISTIC_UUID_THROTTLE_FAULT, _CHARACTERISTIC_UUID_HROTTLE_NOT_RELEASED, _CHARACTERISTIC_UUID_BMS_LOW_VOLTAGE, _CHARACTERISTIC_UUID_BMS_OVER_CURRENT_CHARGE, _CHARACTERISTIC_UUID_BMS_OVER_CURRENT_DISCHARGE, _CHARACTERISTIC_UUID_BMS_OVER_TEMPRATURE_DISCHARGE, _CHARACTERISTIC_UUID_BMS_UNDER_TEMPRATURE_DISCHARGE, _CHARACTERISTIC_UUID_BMS_CELL_OPEN, _CHARACTERISTIC_UUID_BMS_SHORT_DISCHARGE, _CHARACTERISTIC_UUID_BMS_OVER_TEMPRATURE_CHARGE, _CHARACTERISTIC_UUID_BMS_UNDER_TEMPRATURE_CHARGE, _CHARACTERISTIC_UUID_BMS_OVER_TEMPRATURE_MOSFET, _CHARACTERISTIC_UUID_BMS_TEMPRATURE_SENSOR_ERROR, _CHARACTERISTIC_UUID_DRIVING_STATE, _CHARACTERISTIC_UUID_MOTOR_GEARS, _CHARACTERISTIC_UUID_MOTOR_TIERS, _CHARACTERISTIC_UUID_CONTROLLER_THROTTLE, _CHARACTERISTIC_UUID_BMS_STATUS, _CHARACTERISTIC_UUID_VCU_STATUS, _CHARACTERISTIC_UUID_BMS_CHARGING, _CHARACTERISTIC_UUID_BMS_DISCHARGING, _CHARACTERISTIC_UUID_BMS_CHARGE_COMPLETED, ], ); _logTexts = ""; update(); _connection = _currentConnectionStream.listen( (event) { if (event.deviceId == "") return; var id = event.deviceId; switch (event.connectionState) { case DeviceConnectionState.connecting: { utility().connected_snackbar(); _logTexts = "${_logTexts}Connecting to $id\n"; print(_logTexts); break; } case DeviceConnectionState.connected: { _logTexts = "${_logTexts}Connected to $id\n";
}