Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

AP1 device search best practices

Avatar
RankRank

Total Posts: 40

Joined 2009-03-20

PM

Hi,

I'm thinking about the best way to search for devices with an AP1. The AP2 has much better support for searching and pairing, but we are stuck with AP1 for now.

We have used two algorithms in the past:

Random search:
1. Open ANT channel with device_id=0.  
  2. Find device
  3. request ID
.  
  
4. Close channel
  5. go to 1 


All-channel search:
1. Open channel #1 with device_id=0
  
2. Find device
  3. Request ID
  4. Open channel 
#2 with device_id=0
  
5. Find device
  6. Request ID
  7. Open channel 
#3 with device_id=0
  
8. Find device
  9. Request ID
  10. Open channel 
#4 with device_id=0
  
11. Find device
  12. Request ID 


(in both searches, the "find device" step has a timeout that
terminates the search)

This will let us find up to four devices, without tripping over
previously-found devices.

So, assuming there are four devices in range, which search
strategy has the lower expected time to find all four devices?
How can I calculate the worst-case time?      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

The use of multiple channels on the AP1 for searching does not result in a faster search operation, however, there are a few considerations that make this option preferrable.

1. If you use a single channel for the search, closing it after each acquisition and then opening it again, there is no guarantee that you will find a different device the next time. You might need more than four searches to find different devices, as the AP1 does not support exclusion lists. If you have four channels open in search mode, each channel will synchronize to a different device.

2. If you intend to stay connected to one of the sensors, there is no need to search for it again; you can just close the other three channels.

3. If your devices are all in the same network and radio frequency, but have different device types (e.g., looking for a bike power and heart rate sensor), you could open multiple search channels at a time and the searches can take place concurrently (i.e. the first device found will be acquired, if it matches either of the device types). If you only used one channel, you could only find one device type at a time.

For worst case acquisition times, depending on the channel period, see here
http://www.thisisant.com/component/option,com_fireboard/Itemid,146/func,view/id,35/catid,25/#35