Serial listen over Bluetooth: Connection timed out

mitsusdev

Member
Licensed User
Longtime User
Hi,
i've a problem on serial library over bluetooth.
During bluetooth discoverable mode, i listen for a serial connection, but at times (although I do not receive errors from B4A debug), if i remove the check mark from "Filter" logs, i see:

B4X:
GC_EXPLICIT freed 65 objects / 3896 bytes in 105ms
GC_EXPLICIT freed 145 objects / 6544 bytes in 127ms
GC_EXPLICIT freed 116 objects / 5800 bytes in 110ms
GC_EXPLICIT freed 830 objects / 82424 bytes in 155ms
request time failed: java.net.SocketTimeoutException: Connection timed out
requestTime failed
GC_EXPLICIT freed 527 objects / 123592 bytes in 151ms
request time failed: java.net.SocketTimeoutException: Connection timed out
request time failed: java.net.SocketTimeoutException: Connection timed out
request time failed: java.net.SocketTimeoutException: Connection timed out

I've tried i also tried the chat activity example...and the problems are the same. Is there an timeout settings for serial listen?

Can someone help me please?

Regards
 
Last edited:

boastrike

Member
Licensed User
Longtime User
This has come up before and at the moment I cannot remember who gave a solution that worked for me but they mentioned that they made a small loop that tried the connect three times before handling the not connecting and it made the problem you describe go away for me. At times it would connect fine the first time, but once I put the small loop to retry it never showed up again but you can see in the logs where it was handling it. If you search you can find the solution and give proper credit! Best of luck, Jim.
 
Upvote 0
Top