Android Question Bluetooth Sampling

Lee Ingram

Member
Licensed User
Longtime User
  1. I am a newbie to this Great B4A. I am having a lot of fun. I have been playing with Bluetooth and AsyncStreamsText. I have 4 sensors that I am trying to read. I have been successful in communicating with and getting the text data I need from one sensor. Now I am ready to repeat this same type of communication with three other Bluetooth sensors. I need to monitor the data from all 4 Bluetooth sensors. I need to get at least 10 samples per second from each sensor. I don't how to proceed.

Thanks, Lee
 

Cableguy

Expert
Licensed User
Longtime User
This is interesting... But isn't Bluetooth a one to one type of connection?
I don't see how it is possible to connect 4 devices at the same time to the device, even if toggling from on connection to the other... 10 samples per second per device?
There are not many devices that allow for multiple (2 as a possible max) connections...

Can you elaborate on the hardware specs of your project?
 
Upvote 0

Lee Ingram

Member
Licensed User
Longtime User
This is interesting... But isn't Bluetooth a one to one type of connection?
I don't see how it is possible to connect 4 devices at the same time to the device, even if toggling from on connection to the other... 10 samples per second per device?
There are not many devices that allow for multiple (2 as a possible max) connections...

Can you elaborate on the hardware specs of your project?


I have four BT measuring sensors that output a string of characters: "+- 1.234 mm A0>".
I need to be able to make adjustment based on the readings displayed.
 
Upvote 0

stari

Active Member
Licensed User
Longtime User
This is interesting... But isn't Bluetooth a one to one type of connection?
I don't see how it is possible to connect 4 devices at the same time to the device, even if toggling from on connection to the other... 10 samples per second per device?
There are not many devices that allow for multiple (2 as a possible max) connections...

Can you elaborate on the hardware specs of your project?
I have 2 BLE devices ( HM-10) connected at the same time (BLeExtExt) and is working OK.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I have 2 BLE devices ( HM-10) connected at the same time (BLeExtExt) and is working OK.
As I had said, I know 1 master to 2 slaves connection are possible but that not all devices support them, but 1 master connecting 4 slaves at the same time?
 
Upvote 0

stari

Active Member
Licensed User
Longtime User
As I had said, I know 1 master to 2 slaves connection are possible but that not all devices support them, but 1 master connecting 4 slaves at the same time?
I will try. In 2 weeks i receive 10 pcs of HM-10.
 
Upvote 0

Lee Ingram

Member
Licensed User
Longtime User
As I had said, I know 1 master to 2 slaves connection are possible but that not all devices support them, but 1 master connecting 4 slaves at the same time?

Can you share any kind of a code sample? I have been all over this trying to glean some way of doing a master/slave, and trying to understand Classes.
My head hurts!
 
Upvote 0

Lee Ingram

Member
Licensed User
Longtime User
I have had quite a struggle trying listen to two BT sensors. I was finally successful in connecting to two different devices. But, I can only read the data from one device at a time. I now understand that the

StartActivity(ChatActivity) will cause a Activity_Pause (UserClosed AsBoolean) when I try to get data from the newly connected device.


I really need the data from both devices for the whole time they are connected.

I am using the Serial example with a modify ChatActivity to read a text data stream.

The reading of data work perfectly. I need to read both devices continuously.

Can anyone Help Please.
 
Upvote 0
Top