I have a BLE device (Arduino chip) which I connect to an Android app I've built. I can send and receive data normally and maintain the connection pretty good.
However I found a bug which I do not know how to solve or why it appear.
When the BLE device goes out of range from the phone it disconnects (which is normally because of the distance) and no data can be transferred between the device and the phone, but when the device comes back in range for the phone it kind of connect again BUT:
The phone can only send data through:
mBluetoothLeService.writeCharacteristic(characteristic);
and the Arduino chip receives the data. But when I try to send data from the Arduino chip to the phone, the phone does not receive any data.
So in summary:
- Phone and Arduino BLE device connects
- Arduino BLE device goes out of range, connection is lost
- Arduino BLE device goes back in range, connection is established again
- Arduino can receive data from the phone, but the phone can not receive data from the Arduino.
Any one got a clue why this could be?