Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

ANT for an interactive WSAN?

RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

Hi!



I'm currently planning an application that incorporates a varying number of nodes with different peripherals like sensors or actuators. These nodes are supposed to connect wirelessly to each other and share their ressources. Each of the nodes runs a small application that interacts with other nodes.



Random example:



NODE_A: LED, GYROSCOPE || LED color indicates temperature of NODE_B



NODE_B: TEMPERATURE SENSOR, BUZZER || BUZZER active if button on NODE_C pressed



NODE_C: BUTTONS, DISPLAY || DISPLAY shows motion data of NODE_A and temperature of NODE_B



So basically every node has to be able to communicate wich each other node in a bidirectional fashion. Above that we have a mix of constant data streams (for example the motion data of NODE_A) and event-based data (Button pressed on NODE_C).





1.: Do I want to use a shared channel so every node gets every data or do I want to set up the channels depending on the application? Like[NODE_A.Gyroscope -> NODE_C.Display],

[NODE_C.Button -> NODE_B.Buzzer],

...



2.: General Question: If I want to send data from a master to a slave in non-periodic invervals, let's say sometimes once a second, sometimes once a minute, sometimes nothing for a whole day. Imagine for example a wireless light switch.

I guess I do not keep the channel open for the whole time while transmitting some data all the time (channel period). I want to send the data only once. But then how do I assure that if I reopen the channel and send the data once, the slave will receive it? If I understood the protocol correctly, the slave searches for channels that match it's configuration in a certain intervall. Doesn't that result in quiet a huge latency, worst case the maximum search interval plus the time for the data-transfer? What if the slave is in a sleep mode, can I wake it up by sending a data message? Is this message then received instantly or to I have to resend it a few times?

In other words: Can ANT handle single data transmissions as well as it handles streams? Is there a concept of a disposable channel that is only used for a single message?



Thanks for your help and my apologies for this slightly chaotic post.      
Avatar
RankRankRankRank

Total Posts: 213

Joined 2011-05-02

PM

Hello,

1.: Do I want to use a shared channel so every node gets every data or do I want to set up the channels depending on the application?


A shared channel does not really allow every node to get all the data, rather the master node has the ability to poll every slave node for reverse channel data, and can send data to all slaves in the shared channel. For more information refer to AN07 Auto Shared Channel - Master Example. That being said, it is totally up to you how you want to set up your system, based on your system requirements etc.

2.: General Question: If I want to send data from a master to a slave in non-periodic invervals, let's say sometimes once a second, sometimes once a minute, sometimes nothing for a whole day. Imagine for example a wireless light switch.

...I want to send the data only once. But then how do I assure that if I reopen the channel and send the data once, the slave will receive it? If I understood the protocol correctly, the slave searches for channels that match it's configuration in a certain intervall. Doesn't that result in quiet a huge latency, worst case the maximum search interval plus the time for the data-transfer?...


You are correct that that can result in a rather large latency, with a worst case being the maximum search interval plus the time for the data transfer

That being said, ANT provides for the ability to use continuous scanning mode on the slave side. Basically, continuous scanning mode keeps a slave scanning all the time, so it will receive any message that comes from a master that matches its channel criteria, regardless of channel period.

This does come at a trade off of increased power consumption.

For more information on the continuous scanning mode, please see AN14 Continuous Scanning Mode for Asynchronous Topologies.

Hope this helps,

Kassandra      
RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

Hi,I am a chinese and a new in using ANT ,so I have some problems ,could you help me ? I don't know the time series in shared channel,In my project contain a central node and three sensor nodes.I want to confirm three questions:

(1)The time series in shared channel,but not auto-shared channel.
(2My chip is nRF24AP2,can it use auto-share channel?
(3)Do you have some reference codes(c or c++)?


Thanks you very much.



A friend from china

fu dongsong      
Avatar
RankRankRankRank

Total Posts: 213

Joined 2011-05-02

PM

Hello,

(1)The time series in shared channel,but not auto-shared channel.


I'm not really sure what you mean by this, could you clarify?

(2My chip is nRF24AP2,can it use auto-share channel?


Auto-shared channel is done at the application level, so yes you can do auto-shared channel.


(3)Do you have some reference codes(c or c++)?


There is an Aut-Shared-Channel master example available available in AN-07, here. There is some embedded code for an auto-shared slave available here.

Cheers,

Kassandra      
RankRankRankRank

Total Posts: 523

Joined 2012-11-15

PM

Hi,
(1)I use shared channel but notauto-shared channel,because the central node knows the sensor node’s address,my project contains one central node and three sensor nodes,In ANT_Message_protocol_and_usage (8.2) said in order to maintain this application-level channel period, each node in the shared channel actually needs to be set to a 12Hz channel period. This is the sum of the desired message rates of each slave node and will allow the master to service each node at a rate of 4Hz. For example, Node A may choose to cycle through the slaves, addressing Node B on the first channel period, Node C on the next channel period, Node D on the next period, then back to Node B and so on. This will result in each node being addressed once every 4Hz. Similarly, the slaves will only be able to communicate back to the master at the time that they are serviced (i.e. also at 4Hz).I have question as follows:
how to cycle ?In my project I do like this:
While(1)
{
if(wdNodeTmr == 21)// ablout 1/3s
{
//wdNodeTmr = 20;
aucNodeBuf[0] =ADDR_B;//one bytes channel address
ANT_SendBroadcastData(0,aucNodeBuf);//broadcast the address of B
}
if(wdNodeTmr == 14)
{
aucNodeBuf[0] =ADDR_C;
ANT_SendBroadcastData(0,aucNodeBuf);// broadcast the address of C
}
if(wdNodeTmr == 7)
{
aucNodeBuf[0] =ADDR_D;
ANT_SendBroadcastData(0,aucNodeBuf);// broadcast the address of D
}
if(wdNodeTmr == 0)
{
wdNodeTmr = 21;
}
…………………..
}
Is it ok?
(2) On the slave side, once the channel is opened, the host should send a single broadcast message to ANT with the first one or two bytes indicating Node B’s shared channel address. This configures ANT to listen to messages that are addressed to Slave.
The question is just need to send the address once?and the ANT will listen to forever?

Thank you
Your friend from china
fu dongsong      
Avatar
RankRankRankRank

Total Posts: 213

Joined 2011-05-02

PM

Hello,

1. If your nodes are able to support 1 byte shared addressing, that looks okay to me, of course you'll have to test it and make sure.

2. In a shared channel, you will always reserve the first 1 or 2 bytes for the shared address. If you are addressing a particular slave, the first 1 or 2 bytes will be the shared address of the slave node. If you want to address all nodes, you will use the 'Address all' address in the first 1 or 2 bytes.

You only need to send the broadcast message once for the slave to save its shared address.

Cheers,

Kassandra