Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

You are here: Forum Home → ANT+ Forums → ANT+ Heart Rate Monitor → Thread

   

searching master nodes and strange module behaviour

RankRankRank

Total Posts: 54

Joined 2013-05-15

PM

Hi,
I am implementing a stand alone microprocessor gateway system built with an Arduino Mini connected to a nRF24AP2 module.
I successfully connect with a single HRM device and I can read all data from it.
I am trying to implement a searching routine according to documentation.
I trying to search 2 HRM masters.
This routine follow this step to perform a fully search:
0) wait for startup message from module, it gets 0x6F message like this
RX <<< [ A4 1 6F 81 4B ]
1) GETTING CAPABILITIES
TX >>> [ A4 2 4D 0 54 BF ] len=6
RX <<< [ A4 6 54 1 3 0 32 32 0 F4 ]
Max module channels available :1
2) LIB CONFIG
TX >>> [ A4 2 6E 0 0 C8 ] len=6
RX <<< [ A4 3 40 0 6E 0 89 ]
3) CHANNEL ASSIGN - channel #: 0 - channel type: 0 - network #: 0
TX >>> [ A4 3 42 0 0 0 E5 ] len=7
RX <<< [ A4 3 40 0 42 0 A5 ]
4) SET CHANNEL - channel #: 0 - device number: 0 - device type: 120 - transmission type: 0
TX >>> [ A4 5 51 0 0 0 78 0 88 ] len=9
RX <<< [ A4 3 40 0 51 0 B6 ]
5) SET NETWORK KEY - network #: 0 ...
TX >>> [ A4 9 46 0 ANT+ NETWORK KEY ] len=13
RX <<< [ A4 3 40 0 46 0 A1 ]
6) SET CHANNEL TIMEOUT - channel #: 0 - timeout: 12
TX >>> [ A4 2 44 0 C EE ] len=6
RX <<< [ A4 3 40 0 44 0 A3 ]
7) SET CHANNEL FREQUENCY - channel #: 0 - frequency: 57
TX >>> [ A4 2 45 0 39 DA ] len=6
RX <<< [ A4 3 40 0 45 0 A2 ]
8) SET CHANNEL PERIOD - channel #: 0 - period: 32280
TX >>> [ A4 3 43 0 18 7E 82 ] len=7
RX <<< [ A4 3 40 0 43 0 A4 ]
9) OPEN CHANNEL - channel #: 0
TX >>> [ A4 1 4B 0 EE ] len=5
RX <<< [ A4 3 40 0 4B 0 AC ]
10) waiting for at least one broadcast message
RX <<< [ A4 9 4E 0 84 0 B 16 83 19 85 44 21 ]
11) GETTING SENDER ID
TX >>> [ A4 2 4D 0 51 BA ] len=6
RX <<< [ A4 5 51 0 53 C5 78 1 1F ]
ANT+ Master : 50515
12) CLOSE CHANNEL - channel #: 0
TX >>> [ A4 1 4C 0 E9 ] len=5
RX <<< [ A4 3 40 0 4C 0 AB ]
13) CHANNEL UNASSIGN - channel #: 0
TX >>> [ A4 1 41 0 E4 ] len=5
RX <<< [ A4 3 40 0 41 15 B3 ]

The first ANT+ is found but when channel unassing command was performed the module give me back a 0x15 error status....
so the system continue searching:

14) LIB CONFIG
TX >>> [ A4 2 6E 0 0 C8 ] len=6
RX <<< [ A4 3 40 0 6E 0 89 ]
15) CHANNEL ASSIGN - channel #: 0 - channel type: 0 - network #: 0
TX >>> [ A4 3 42 0 0 0 E5 ] len=7
RX <<< [ A4 3 40 0 42 15 B0 ]
16) SET CHANNEL - channel #: 0 - device number: 0 - device type: 120 - transmission type: 0
TX >>> [ A4 5 51 0 0 0 78 0 88 ] len=9
RX <<< [ A4 3 40 0 51 0 B6 ]
17) SET NETWORK KEY - network #: 0 ...
TX >>> [ A4 9 46 0 ANT+ NETWORK KEY ] len=13
RX <<< [ A4 3 40 0 46 0 A1 ]
18) SET CHANNEL TIMEOUT - channel #: 0 - timeout: 12
TX >>> [ A4 2 44 0 C EE ] len=6
RX <<< [ A4 3 40 0 44 0 A3 ]
19) SET CHANNEL FREQUENCY - channel #: 0 - frequency: 57
TX >>> [ A4 2 45 0 39 DA ] len=6
RX <<< [ A4 3 40 0 45 0 A2 ]
20) SET CHANNEL PERIOD - channel #: 0 - period: 32280
TX >>> [ A4 3 43 0 18 7E 82 ] len=7
RX <<< [ A4 3 40 0 43 0 A4 ]

Now I add to a list the first master found in previous search
21) ADD LIST - channel #: 0 - device number: 50515 - device type: 120 - transmission type: 1 - list index: 1
TX >>> [ A4 6 59 0 53 C5 78 1 1 15 ] len=10
RX <<< [ A4 3 40 0 59 28 96 ]

I configure the list like EXCLUSION
22) LIST CONFIGURE - channel #: 0 - list size: 1 - exclude #: 1
TX >>> [ A4 3 5A 0 1 1 FD ] len=7
RX <<< [ A4 3 40 0 5A 28 95 ]

and open the channel
23) OPEN CHANNEL - channel #: 0
TX >>> [ A4 1 4B 0 EE ] len=5
RX <<< [ A4 3 40 0 4B 15 B9 ]
and the module give me back error 0x15
the routine continue:
24) RX <<< [ A4 9 4E 0 4 0 83 19 42 1D 86 43 E7 ]
25) GETTING SENDER ID
TX >>> [ A4 2 4D 0 51 BA ] len=6
RX <<< [ A4 3 40 0 1 7 E1 ]
Wrong waiting message: 0x40 - it was attended : 0x51
so the routine perform again the request
25) GETTING SENDER ID
TX >>> [ A4 2 4D 0 51 BA ] len=6
RX <<< [ A4 5 51 0 0 0 78 0 88 ]
ANT+ master found : 0

END SEARCHING
0 ID=50515 Type=120 Transmissi
---------------------------------------------

My question is:
What was wrong in unassing / open channel command? What give me back the error 0x15?
And is correct my add / configure list command sent to module?

If I am wrong what is the best method to search multiple ANT+ HRM masters with a single channel available on the module nRF24AP2?

Many thanks.
Why the searching routine      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Please do not post the ANT+ network key in public forums - I've edited your post to remove it.

You need to wait for the EVENT_CHANNEL_CLOSED message from ANT before unassigning the channel.
The sequence would be
Tx: Close Channel
Rx: RESPONSE_NO_ERROR to Close Channel
Rx: EVENT_CHANNEL_CLOSED
Tx: Unassign Channel

If you are trying to obtain the IDs of multiple sensors that are in range, background scanning channel and continuous scanning mode may be helpful.

http://www.thisisant.com/developer/resources/tech-bulletin/demystifying-ant-topologies/

http://www.thisisant.com/resources/an11-ant-channel-search-and-background-scanning-channel/
http://www.thisisant.com/resources/an14-continuous-scanning-mode/
     
RankRankRank

Total Posts: 54

Joined 2013-05-15

PM

ok, many thanks.
Excuse me for network key, it was my fault. Many thanks for your response.
I will try your solution.      
RankRankRank

Total Posts: 54

Joined 2013-05-15

PM

Hi,
I tryed to implement a continuous searching mode.

When I send commands to nRF24AP2 module I get an invalid message event on Open Rx Scan Mode command.
This is the command sequence and response:

100) SET NETWORK KEY - network #: 0 ...
TX >>> [ A4 9 46 0 - NETWORK KEY - ] len=13
RX <<< [ A4 3 40 0 46 0 A1 ]
101) CHANNEL ASSIGN - channel #: 0 - channel type: 64 - network #: 0
TX >>> [ A4 3 42 0 40 0 A5 ] len=7
RX <<< [ A4 3 40 0 42 0 A5 ]
102) SET CHANNEL - channel #: 0 - device number: 0 - device type: 120 - transmission type: 0
TX >>> [ A4 5 51 0 0 0 78 0 88 ] len=9
RX <<< [ A4 3 40 0 51 0 B6 ]
103) SET CHANNEL FREQUENCY - channel #: 0 - frequency: 57
TX >>> [ A4 2 45 0 39 DA ] len=6
RX <<< [ A4 3 40 0 45 0 A2 ]
104) SET RX EXT MESSAGE ENABLE - enable: 1
TX >>> [ A4 2 66 0 1 C1 ] len=6
RX <<< [ A4 3 40 0 66 0 81 ]
105) OPEN SCAN MODE (CONTINUOUS)
TX >>> [ A4 2 5B 0 0 FD ] len=6
RX <<< [ A4 3 40 0 5B 28 94 ]

0x28 = invalid message parameters...

what happens?


I tryed 0x00 channel type during assignment but without success:
101) CHANNEL ASSIGN - channel #: 0 - channel type: 0 - network #: 0
TX >>> [ A4 3 42 0 0 0 E5 ] len=7
RX <<< [ A4 3 40 0 42 0 A5 ]
102) SET CHANNEL - channel #: 0 - device number: 0 - device type: 120 - transmission type: 0
TX >>> [ A4 5 51 0 0 0 78 0 88 ] len=9
RX <<< [ A4 3 40 0 51 0 B6 ]
103) SET CHANNEL FREQUENCY - channel #: 0 - frequency: 57
TX >>> [ A4 2 45 0 39 DA ] len=6
RX <<< [ A4 3 40 0 45 0 A2 ]
104) SET RX EXT MESSAGE ENABLE - enable: 1
TX >>> [ A4 2 66 0 1 C1 ] len=6
RX <<< [ A4 3 40 0 66 0 81 ]
105) OPEN SCAN MODE (CONTINUOUS)
TX >>> [ A4 2 5B 0 0 FD ] len=6
RX <<< [ A4 3 40 0 5B 28 94 ]
     
RankRankRank

Total Posts: 54

Joined 2013-05-15

PM

I try at step 105 this:
105) OPEN SCAN MODE (CONTINUOUS)
TX >>> [ A4 1 5B 0 FE ] len=5
RX <<< [ A4 3 40 0 5B 28 94 ]
but I get the 0x28 error....

but if I try to change lenght to 2 I have no response from the module:
105) OPEN SCAN MODE (CONTINUOUS)
TX >>> [ A4 2 5B 0 FD C1 ] len=6

I have no idea.....

please...
help me

How do I use the open rx scan mode command?
thanks      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Hello,

The sequence that you are using is correct - the continuous scan mode command requires one parameter, set to 0. Using USB2 (based on nRF24AP2-USB) and ANTware, the sequence works as expected:

338.163 { 49401460} Tx - [A4][09][46][00][00][00][00][00][00][00][00][00][EB][00][00]
338.163 { 49401460} Rx - [A4][03][40][00][46][00][A1]
345.230 { 49408527} Tx - [A4][04][42][00][40][00][00][A2][00][00]
345.230 { 49408527} Rx - [A4][03][40][00][42][00][A5]
357.429 { 49420726} Tx - [A4][05][51][00][00][00][78][00][88][00][00]
357.429 { 49420726} Rx - [A4][03][40][00][51][00][B6]
362.546 { 49425843} Tx - [A4][02][45][00][39][DA][00][00]
362.546 { 49425843} Rx - [A4][03][40][00][45][00][A2]
461.622 { 49524919} Tx - [A4][02][66][00][01][C1][00][00]
461.622 { 49524919} Rx - [A4][03][40][00][66][00][81]
471.950 { 49535247} Tx - [A4][01][5B][00][FE][00][00]
471.950 { 49535247} Rx - [A4][03][40][00][5B][00][BC]

Have you tried sending an ANT reset prior to the configuration sequence?
Are you using an AP2 module? Which version of the module? The Revision History document here can help you identify the version
http://www.thisisant.com/resources/ant-ap2-module-revision-history/

     
RankRankRank

Total Posts: 54

Joined 2013-05-15

PM

Hi,
I am not sure what version is the nRF24AP2 that I have.
It is a 1 channel version.
I attach a picture and a link where I buyed it.

http://www.goodluckbuy.com/nrf24ap2-networking-module-zigbee-module-with-ant-transceiver-.html      

Image Attachments

2014-11-20_09.25.19.jpg

Click thumbnail to see full-size image

RankRankRank

Total Posts: 54

Joined 2013-05-15

PM

I will check documentation you linked me.      
RankRankRank

Total Posts: 54

Joined 2013-05-15

PM

I retry the send / response command sequence :

started
RX <<< [ A4 1 6F 81 4B ]
1) GETTING CAPABILITIES
TX >>> [ A4 2 4D 0 54 BF ] len=6
RX <<< [ A4 6 54 1 3 0 32 32 0 F4 ]

100) SET NETWORK KEY - network #: 0 ...
TX >>> [ A4 9 46 0 -N-E-T-W-O-R-K---K-E-Y- ] len=13
RX <<< [ A4 3 40 0 46 0 A1 ]
101) CHANNEL ASSIGN - channel #: 0 - channel type: 64 - network #: 0
TX >>> [ A4 3 42 0 40 0 A5 ] len=7
RX <<< [ A4 3 40 0 42 0 A5 ]
102) SET CHANNEL - channel #: 0 - device number: 0 - device type: 120 - transmission type: 0
TX >>> [ A4 5 51 0 0 0 78 0 88 ] len=9
RX <<< [ A4 3 40 0 51 0 B6 ]
103) SET CHANNEL FREQUENCY - channel #: 0 - frequency: 57
TX >>> [ A4 2 45 0 39 DA ] len=6
RX <<< [ A4 3 40 0 45 0 A2 ]
104) SET RX EXT MESSAGE ENABLE - enable: 1
TX >>> [ A4 2 66 0 1 C1 ] len=6
RX <<< [ A4 3 40 0 66 0 81 ]
105) OPEN SCAN MODE (CONTINUOUS)
TX >>> [ A4 1 5B 0 FE ] len=5
RX <<< [ A4 3 40 0 5B 28 94 ]

I get always the 0x28 error code - incorrect parameters

     
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Can you request the version string then? (Section 9.5.7.3 of the ANT Protocol Message and Usage document) That may help identify the device.

Edit: Just noticed you mentioned this is a 1-channel AP2. Continuous scan mode is not supported by the 1-channel AP2, as this part is intended for sensors, not hubs. The 8-channel part does support this feature.
You can confirm support for continuous scan mode by requesting the capabilities (Section 9.5.7.4 of the ANT Protocol Message and Usage document).      
RankRankRank

Total Posts: 54

Joined 2013-05-15

PM

Requesting 0x3E command:
this is the response:

started
RX <<< [ A4 1 6F 81 4B ]
1) GETTING CAPABILITIES
TX >>> [ A4 2 4D 0 54 BF ] len=6
RX <<< [ A4 6 54 1 3 0 32 32 0 F4 ]

210) REQUEST VERSION STRING
TX >>> [ A4 2 4D 0 3E D5 ] len=6
RX <<< [ A4 B 3E 41 50 32 2D 31 20 31 2E 30 36 0 97 ]


how can I understand the version string?
     
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

The version string is an ASCII null terminated string.

Regarding the capabilities

RX <<< A4 6 54 1 3 0 32 32 0 F4

0x32 => Bit 2 CAPABILITIES_SCAN_MODE_ENABLED is set to zero, which means that the module you have does not support scan mode.      
RankRankRank

Total Posts: 54

Joined 2013-05-15

PM

bad news!
and how can I scan for sensors near my module?
It does support list inclusion/exclusion ?
     
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

That would be indicated by the CAPABILITIES_SEARCH_LIST_ENABLED bit. Please refer to Section 9.5.7.4 for details on interpreting the capabilities.

The 1-channel part is not intended to be used for hubs connecting to multiple sensors. Without search lists, you can keep repeating the search using wildcards, however, you may end up acquiring the same device multiple times. Make sure to unassign the channel in between search cycles.

You can consider using an 8-channel module, which does support features intended for hub devices, such as continuous scan mode.
http://www.thisisant.com/developer/components/ap2-modules/#76_tab

If your application would benefit from RSSI, you can also consider the C7 module and the N5 module (which is an SOC, but comes preloaded with network processor mode firmware).
You can find details on the different components here
http://www.thisisant.com/developer/components/      
RankRankRank

Total Posts: 54

Joined 2013-05-15

PM

Ok.
many thanks.
I will try.