Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

ANT Scanning mode - master node and slave node

Rank

Total Posts: 6

Joined 0

PM

ANT Component Used: AT3 Modules
Category: ANT Hardware/embedded firmware

Issue Details:
Designing a simple system consisting of a scanning Node (fixed location) and roaming nodes called Master Nodes that roam in and out of the area of Scanning Node. Scanning Node to keep track of the master Nodes (recording the serial number/channel ID of the Master Ant Nodes) visiting the area of influence of
the Scanning Node.

I am using ANT AT3 modules for the Scanning Node and Master Nodes and adding an additional processor to communicate with these nodes over the serial channel.

My questions are as follows:

Master Node:
1. I want to use serial number as the device number in the Master NODE for channel ID and have scanning Node to use this ID to send messages back to the corresponding Master node. If I use the message 0x65 to set serial number as channel ID, do I have to add device number based on the serial number explicitly or ANT system will add the serial number as part of the message sent to scanning Node. In other words, if this command is used, then the ANT will always send the channel ID based on the serial number to the scanning Node ?

2. For every message that is sent by the Master Node, I want to send back a message from the scanning Node to the master mode.

3. What is the ID of the message that should be used to send messages from Master Node to scanning Node. Node? (0x4E, 0x5D..??)

Also, what is the format of the message that will be received by Master Node
from the Scanning Node in response to the message sent by Master Node?



Scanning Node:

1. Scanning Node is programmed with device Type and transmission type as 0 -
enabling it to receive messages from all nodes.
2. Based on ANT note AN14, the scanning Node needs to be configured for
extended messages as the ANT will not send the ID to the host, if it is not
set for extended message?

I am not clear on the format/type of Data messages (0x4E, 0x5D etc..) being exchanged between the two nodes.


I am attaching parts of the relevant code that is used to program the nodes.
Please let me know if this correct?

Attachment: antScanNode.c, antMasterNode.c
     

File Attachments

Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Hi,

Unfortunately your code samples seem to be irretrievable, could you re-attach them or post them with the "code" formatting option if you need to?

Re-posting some of my previous answers:

Master Node:
1. As described in the ANT Message Protocol and Usage document, 0x65 will use the two least significant bytes of the device's serial number to set the device number, you must still configure pairing bit, device type, and transmission type explicitly yourself when you use this command. The ANT master channel will always use this configured setting until it is overwritten/reset.

2. You can absolutely send a message in response to every received message at the scanning node, you can use the method as described in AN14 Continuous Scanning mode. You can also use acknowledged messages to check whether they were received as well or bursts if you need to transfer more than 8 bytes.

3. Feel free to use any message type available such as broadcast(0x4E), acknowledged (0x4F), or burst (0x50).

4. The message received by the master node sent from a scanning node in response from the master will be identical to it's format as specified in the ANT Message Protocol and Usage document.
For example, a broadcast in UART could look like:
[A4][09][4E][00][00][00][00][00][00][00][00][00][E3] // Ch 0, Broadcast payload 00-00-00-00-00-00-00-00 


Scanning Node:
1. You also need to wild card the device number (unless you only wish to receive from a specific device).

2. That is correct, you must enable extended messaging for the ANT scanning node to send the Device ID with every message it receives to the Host, otherwise ANT will only send the message it received.

3. The data passed over the air can vary, but typically a host using ANT can see the message payload, the device number, the device type, and the transmission type.

Cheers      
Rank

Total Posts: 10

Joined 2013-05-15

PM

Hi.
How does one go about wildcarding the device. I can only receive data from one specific device.
Any help would be appreciated.

Thanks!      
Avatar
RankRankRankRank

Total Posts: 235

Joined 2012-08-31

PM

Hi V0nni,

You can 'wildcard' any of the channel ID parameters by setting them to zero before you open the channel to search. Take a look at the info here: http://www.thisisant.com/developer/resources/tech-faq/category/pairing/

Thanks,

Kat      
Rank

Total Posts: 10

Joined 2013-05-15

PM

did my code posting get deleted?      
Avatar
RankRankRankRank

Total Posts: 235

Joined 2012-08-31

PM

I don't think so - I didn't see any code here. Maybe it didn't post successfully?

Typically it's easier to troubleshoot ANT logs than code though, so it's generally better to post logs. What is your question?      
Rank

Total Posts: 10

Joined 2013-05-15

PM

Can you tell me what is wrong here? I am able to connect to only one garmin foot pod. I have an additional one...and i cant get any data from it.
Should I replace the 0x5a with 0?
char msg0[]{0x5a0xa5000000 };
    
[[EADSessionController sharedController] writeData:[NSData dataWithBytes:msg0 length:8]]
     
Avatar
RankRankRankRank

Total Posts: 235

Joined 2012-08-31

PM

You need to set the device number and transmission type values to 0. Those will be in your Channel ID message.

I edited the code you posted to remove the ANT+ network key - please do not publish this anywhere. Also, please click through the ANT+ Adopter agreement if you haven't already done this. It is a condition for the use of the ANT+ network key and use of the ANT+ device profiles. The agreement is here: http://www.thisisant.com/my-ant/adopter

Please refer to the Device Pairing Application Note (AN02) and the ANT Message Protocol and Usage document if you don't understand the channel ID: http://www.thisisant.com/developer/resources/downloads/#documents_tab      
Rank

Total Posts: 10

Joined 2013-05-15

PM

We never specified a device # or channel number. Do i need some additional tool to figure this out?
     
Rank

Total Posts: 10

Joined 2013-05-15

PM

How does a device # automatically get assigned. Do you guys have a 1800 number?      
Avatar
RankRankRankRank

Total Posts: 235

Joined 2012-08-31

PM

Hi V0nni,

Direct telephone/email support is only available to ANT+ Members (http://www.thisisant.com/my-ant/members/). We cannot provide direct support at no cost.

The device number and transmission type are set as part of the Channel ID message - i.e. the line of the code you had posted before that had "channel ID" in the comment at the end of it. This is the line that needs fixing. If you don't understand what the code you are using is doing then I suggest you contact the developer who wrote the code.

Alternatively if you want to fix this yourself then you need to read the documents you have been pointed to in the previous replies on this and other threads. For example in the ANT Message Protocol and Usage document, section 9.5.2.3 gives you the details of how the 'Set Channel ID' message is used to set the device number and transmission type. Match this up to your code, find the values that correspond to the device number and transmission type, and set these to zero.

You do not need any additional tools to fix this. Read the documents or talk to your developer. If you have further questions that you cannot find the answer to in the documentation then you are welcome to post them here. But please read first - we put a lot of effort into making these documents and they are by far the best way for you to learn how ANT works.      
Avatar
RankRankRankRank

Total Posts: 296

Joined 0

PM

V0nni - 19 July 2013 11:34 AM
How does a device # automatically get assigned. Do you guys have a 1800 number?

Are you the very V0nni that has written the "Find the best" and "Reach your Goal" plugins for SportTracks?
If yes, drop me a PM in the SportTracks forum (same forum name as here) and I'll help you.

Cheers,
OMB      
Rank

Total Posts: 10

Joined 2013-05-15

PM

not the same vONNI, but can you still help me?