Open wallem89 opened 1 year ago
You dont say how long you have to wait before you experience a disconnect. Although I am not completely surprised, no connection (certainly not BT) is going to reliable for long periods of time and dealing with disconnects should be expected.
I dont think its the responsibility of the btcomm API to maintain long term connections, however I dont think it would be too difficult to amend the calling program to deal with disconnects and reconnect as appropriate.
I would probably do 2 things:
Describe the bug I am running this software on two Raspberry Pi's and one is the server an the other Pi is the client. Both are used to send and receive data. I am getting both issues randomly at the client side. Both programs are quite identical since both are waiting for new data to come in with the
data_received_callback
and both are sending data with thesend
function. But the server with thesend
function fromBluetoothServer
and the client fromBluetoothClient
.ConnectionAbortedError
in receive thread:Transport endpoint is not connected
error during sending:To Reproduce Steps to reproduce the behavior:
BluetoothAdapter
on both client and server sideBluetoothServer
and the client with theBluetoothClient
data_received_callback
function on both sides waiting for new data to comesend
functions.Expected behavior A reliable connection that even when the bluetooth connection disconnects or the other side is outside range the program doesn't crash. I want a clear error message and be able to connect the client to the server after they have disconnected.
System (please complete the following information):
Additional context Both programs using the build-in Bluetooth adapter of the Raspberry Pi 4.