Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Bluetooth: read failed, socket might closed or timeout, read ret: -1



Permlink Replies: 4 - Last Post: Oct 27, 2016 8:37 PM Last Post By: Wirianta Tan
ioan ghip

Posts: 40
Registered: 3/16/00
Bluetooth: read failed, socket might closed or timeout, read ret: -1
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 28, 2016 7:44 PM
I want to connect to a Bluetooth Serial Module like this one: http://makezine.com/projects/connect-an-arduino-to-a-7-bluetooth-serial-module/

I tried all examples that come with Delphi 10 Seattle for Bluetooth and every time I tried to connect to the device I get the following error:

java.io.ioexception: read failed, socket might closed or timeout, read ret: -1


Any idea what could be wrong?

Thanks.
RUS BANDI

Posts: 1
Registered: 2/23/15
Re: Bluetooth: read failed, socket might closed or timeout, read ret: -1
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 14, 2016 7:12 PM   in response to: ioan ghip in response to: ioan ghip
Same case. I tried example "Classic Bluetooth Basic app" but not work.
Almost 7 months..
Oh no. is not there anyone who can help? Developers .. please help!

ioan ghip wrote:
I want to connect to a Bluetooth Serial Module like this one: http://makezine.com/projects/connect-an-arduino-to-a-7-bluetooth-serial-module/

I tried all examples that come with Delphi 10 Seattle for Bluetooth and every time I tried to connect to the device I get the following error:

java.io.ioexception: read failed, socket might closed or timeout, read ret: -1


Any idea what could be wrong?

Thanks.

Edited by: RUS BANDI on Sep 14, 2016 7:14 PM
SOFtran Informá...

Posts: 2
Registered: 4/26/14
Re: Bluetooth: read failed, socket might closed or timeout, read ret: -1
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 25, 2016 7:01 AM   in response to: RUS BANDI in response to: RUS BANDI
Hi everyone,

I went through the same problem.
So I created a project by Android Studio, following an example of simple Bluetooth communication, which worked perfectly.
I transcribed this example in Delphi project and also worked!
The secret was to create a thread to communicate with the bluetooth, its sockets, Input and Output.

When using the transcribed Thread, communication between the devices worked perfectly.
In this case, my project was to communicate with a Bluetooth printer.

RUS BANDI wrote:
Same case. I tried example "Classic Bluetooth Basic app" but not work.
Almost 7 months..
Oh no. is not there anyone who can help? Developers .. please help!

ioan ghip wrote:
I want to connect to a Bluetooth Serial Module like this one: http://makezine.com/projects/connect-an-arduino-to-a-7-bluetooth-serial-module/

I tried all examples that come with Delphi 10 Seattle for Bluetooth and every time I tried to connect to the device I get the following error:

java.io.ioexception: read failed, socket might closed or timeout, read ret: -1


Any idea what could be wrong?

Thanks.

Edited by: RUS BANDI on Sep 14, 2016 7:14 PM
Dominic Ko

Posts: 8
Registered: 5/29/15
Re: Bluetooth: read failed, socket might closed or timeout, read ret: -1
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 27, 2016 7:45 AM   in response to: SOFtran Informá... in response to: SOFtran Informá...
I have the same problem too. Android to Android, classic bluetooth apps is OK.
But HC-05 to android is not working.

Would you show me the source?

SOFtran Informática do Transporte wrote:
Hi everyone,

I went through the same problem.
So I created a project by Android Studio, following an example of simple Bluetooth communication, which worked perfectly.
I transcribed this example in Delphi project and also worked!
The secret was to create a thread to communicate with the bluetooth, its sockets, Input and Output.

When using the transcribed Thread, communication between the devices worked perfectly.
In this case, my project was to communicate with a Bluetooth printer.

RUS BANDI wrote:
Same case. I tried example "Classic Bluetooth Basic app" but not work.
Almost 7 months..
Oh no. is not there anyone who can help? Developers .. please help!

ioan ghip wrote:
I want to connect to a Bluetooth Serial Module like this one: http://makezine.com/projects/connect-an-arduino-to-a-7-bluetooth-serial-module/

I tried all examples that come with Delphi 10 Seattle for Bluetooth and every time I tried to connect to the device I get the following error:

java.io.ioexception: read failed, socket might closed or timeout, read ret: -1


Any idea what could be wrong?

Thanks.

Edited by: RUS BANDI on Sep 14, 2016 7:14 PM
Wirianta Tan

Posts: 1
Registered: 12/23/12
Re: Bluetooth: read failed, socket might closed or timeout, read ret: -1
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 27, 2016 8:37 PM   in response to: SOFtran Informá... in response to: SOFtran Informá...
Hi SOFtran Informática,

I faced the same problem with the communication with a bluetooth printer using Delphi Firemonkey.

Really apreciate if you can help me with the source code to show how to do it.

Thx.
Best Regards,
WT.

SOFtran Informática do Transporte wrote:
Hi everyone,

I went through the same problem.
So I created a project by Android Studio, following an example of simple Bluetooth communication, which worked perfectly.
I transcribed this example in Delphi project and also worked!
The secret was to create a thread to communicate with the bluetooth, its sockets, Input and Output.

When using the transcribed Thread, communication between the devices worked perfectly.
In this case, my project was to communicate with a Bluetooth printer.

RUS BANDI wrote:
Same case. I tried example "Classic Bluetooth Basic app" but not work.
Almost 7 months..
Oh no. is not there anyone who can help? Developers .. please help!

ioan ghip wrote:
I want to connect to a Bluetooth Serial Module like this one: http://makezine.com/projects/connect-an-arduino-to-a-7-bluetooth-serial-module/

I tried all examples that come with Delphi 10 Seattle for Bluetooth and every time I tried to connect to the device I get the following error:

java.io.ioexception: read failed, socket might closed or timeout, read ret: -1


Any idea what could be wrong?

Thanks.

Edited by: RUS BANDI on Sep 14, 2016 7:14 PM
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02