Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Is that possible to connect more devices by plug in multiple usb sticks on Android

Rank

Total Posts: 8

Joined 2017-04-26

PM

I am developing an Android app over ant+ protocol, which expected to read from up to 24 heart rate sensors synchronously, at least 1 sample/second from each sensor.

If I understood it correctly, only 8 channels available with single usb stick. So I'm wondering, if it is possible to extend channels by plug in second/third usb ant+ stick? Or is there other way to connect to so many sensors?

Any information would be greatly appreciated.      
Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

If the device supports USB Host, you could use multiple ANT USB sticks to add more channels to the device, although you'll likely also need a powered USB Hub as most Android devices are not designed to carry much power over the port.

Another alternative is to use either Continuous Scan Mode or Background Scanning to pick up all messages from multiple devices. CSM is available on all ANT USB sticks, and Background Scanning is only able to pick up every message if the device also supports high duty search (such as the USB-m). This would involve not using the ANT+ API/Plugins but instead use the ANT API to parse the raw messages yourself. If you would prefer to go down this path, please contact support @ thisisant.com for a solution.      
Rank

Total Posts: 8

Joined 2017-04-26

PM

thanks for reply.

In actually, I've made it by using background scanning with Ant SDK.

Thanks again.      
Rank

Total Posts: 5

Joined 2021-02-12

PM

Hello! I have the same problem. How did you solve it?      
RankRankRankRank

Total Posts: 370

Joined 2012-06-27

PM

This is related to https://www.thisisant.com/forum/viewthread/7477/ in that it requires functionality on the ANT+ network beyond the plugin support      

Signature

Ian Haigh

Rank

Total Posts: 5

Joined 2021-02-12

PM

I got theandroid_antlib-restricted_4-15-0.jar library from support. Please help me implement the simultaneous connection of 24 heart rate sensors to Android device.      
RankRankRankRank

Total Posts: 370

Joined 2012-06-27

PM

You need to implement background scanning by following section 5 of https://www.thisisant.com/resources/an11-ant-channel-search-and-background-scanning-channel/      

Signature

Ian Haigh

RankRankRankRank

Total Posts: 370

Joined 2012-06-27

PM

You will receive data from all heart rate sensors in the area by running a background search for any device number and transmission type that matches the HRM device type on the ANT+ network with extended messages enabled. You can filter out sensors you don't want, and keep data from sensors separate by parsing the channel id in the extended message data.      

Signature

Ian Haigh

Rank

Total Posts: 5

Joined 2021-02-12

PM

Thank you for your reply!
Probably i forgot to mention that i have ANT+ HRM sensor Wahoo Tickr Fit. After spending a whole day experimenting with the ANT Background Scanning Example and getting no result, I came across a forum branch https://www.thisisant.com/forum/viewthread/4577 It sa.ys here that the ANT Sample_BackgroundScan does not allow detection of ANT+ devices. Is this really true?      
RankRankRankRank

Total Posts: 370

Joined 2012-06-27

PM

With the restricted sdk you are able to use the ANT+ network without the restrictions mentioned. You can do a background search on the ANT+ network.      

Signature

Ian Haigh

Rank

Total Posts: 5

Joined 2021-02-12

PM

Thank you!
As I mentioned earlier, I'm using the Sample_BackgroudScan Android ANT SDK example along with the android_restricted library on my Samsung A51 with an internal ANT+ module. But the example doesn't work. When I turn on the heart rate sensor, I don't see it on the screen and in the app logs. I tried to change the example according to section 5, but it didn't work. Here is the part of the code with the configuration. Please, help me determine the reason.
ExtendedAssignment extendedAssign = new ExtendedAssignment();
extendedAssign.enableBackgroundScanning();

mBackgroundScanChannel.assign(ChannelType.create(0x10), extendedAssign); 

ChannelId channelId = new ChannelId(0,0,0);
mBackgroundScanChannel.setChannelId(channelId);

LibConfig libconfig = new LibConfig();
 
libconfig.setEnableChannelIdOutput(true);
mBackgroundScanChannel.setAdapterWideLibConfig(libconfig);

mBackgroundScanChannel.setSearchPriority(5); 
     
RankRankRankRank

Total Posts: 370

Joined 2012-06-27

PM

You need to select the network for the channel. Public is the default. If you have used the rest of that example verbatim you need to modify "AntChannel antChannel = acquireChannel();" to acquire a channel on the ANT+ network. See "mAntChannel = mAntChannelProvider.acquireChannel(this, PredefinedNetwork.PUBLIC);" in Sample_AcquireChannels. You specify the network as the ANT+ network in your case. The restricted SDK gives you access to PredefinedNetwork.ANT_PLUS.      

Signature

Ian Haigh

Rank

Total Posts: 5

Joined 2021-02-12

PM

Thank you very much!!!! It worked!
In addition to PredefinedNetwork. ANT_PLUS, I set the frequency to 57 and ChannelType.SLAVE_RECEIVE_ONLY.
Thank you again for your support!