requestMTU success, but still receieved 20 characters
BluetoothManager.connect(this.peripheralId) .then(() => { console.log('Connected'); BluetoothManager.requestMTU(200); setTimeout(() => { this.getNotic(); }, 500); }) .catch(error => { console.log('Connected error:', error); });
requestMTU doesn't seem to be doing anything version 7.6.1, also noticed packages are still 20 bytes. On 8.0.1 the Promise never returns... it gets stuck in that line
try setting the MTU value to 185 or less. It worked for me
I am still facing the same issue. I'm trying to set MTU to 512 it shows ok in logs but actually it still sending 20 bytes chunks. Please help if someone resolved this issue
I am still facing the same issue. I'm trying to set MTU to 512 it shows ok in logs but actually it still sending 20 bytes chunks. Please help if someone resolved this issue
Hi! Experimentally, I found that in some Android systems, the MTU of more than 185 does not work. Try to make the value no more than 185. A delay of 2000 ms is required after BleManager.connect. My code example: ... const TimePauseMTU = 2000; // необходима задержка после соединения (перед установкой MTU)
await BleManager.connect(peripheral.id);
await new Promise((resolve, _reject) => setTimeout(resolve, TimePauseMTU), );
if (Platform.OS === 'android') { await BleManager.requestMTU(peripheral.id, 185) }
await BleManager.retrieveServices(peripheral.id); ...
@AlexManSPB I tried but it didn't worked is there another solution. should i use react native ble -plex?
@AlexManSPB I tried but it didn't worked is there another solution. should i use react native ble -plex?
I think react native ble-plx won't solve your issue. A possible solution is to accept data in several smaller packets
Perhaps your peripheral device allows the MTU to be only 20, in which case you will not be able to increase it higher.