Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Continuous scanning mode collisions

Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Looking at your logs, there seem to be a few odd things in the channel configuration. For example, when you assign the channel, you are enabling frequency agility and background scanning channel - this is not necessary as these features cannot be used when in continuous scan mode.
Also noticed that you enabled RSSI data with the LibConfig command (0x6E), however, since you are using a USB2, RSSI measurements are not available. It would be more useful to enable the channel ID instead, as that would enable you to distinguish messages between different devices.

Now, regarding the "mangled" data, that does look like an error in the decoding. For example, in the timestamp 40.560, the log shows
40.560 { 163843341} Rx - [A4][0E][4E][00][50][80][01][02][C0][85][C0][A1][40][10][00][69][00][2A]
The page number in this message ix 0x50, which means common pages are being incorrectly decoded as a beacon.

The log also shows a few instances of messages received very closely together (e.g. at 1031.744). The names that appear in those two consecutive messages are seen in other places throughout the log, and do not really look mangled. As OMB suggested, it is very possible you are running into a concurrency issue in your application, mixing the two messages together inadvertently when decoding them. Enabling the channel ID in the extended messages should help a lot too.      
Rank

Total Posts: 22

Joined 0

PM

Thanks for the reply - what I'm doing is I'm working off of the ANT channel response event and whenever that's being raised, I have a routine that deals with it. I've got a mutex on that routine and I guess the obvious question from here is whether or not that routine within the library has its own concurrency protection which I'll be honest, I haven't investigated yet.      
Rank

Total Posts: 22

Joined 0

PM

Thanks for looking at the logs. I don't think I'm explicitly enabling frequency agility or bg scanning channel (I've attached the code I use to open the channel below) and I do remember trying to get the RSSI out just to realize that I couldn't, but thanks. I'll look into cleaning up the channel init.

Channel init code:
ANT_Channel workerchn;
ANT_Device workerant; ...

workerchn = workerant.getChannel(0);
if (
!workerant.setNetworkKey(0, ANT_PLUS_NETWORK_KEY, ANT_PLUS_TIMEOUT) || // Set ANT+ network key
!workerant.enableRxExtendedMessages(true, ANT_PLUS_TIMEOUT) || // Enable extended messaging
!workerant.setLibConfig(ANT_ReferenceLibrary.LibConfigFlags.MESG_OUT_INC_RSSI_0x40, ANT_PLUS_TIMEOUT) || // enable RSSI
!workerchn.assignChannel(ANT_ReferenceLibrary.ChannelType.BASE_Slave_Receive_0x00, 0, ANT_PLUS_TIMEOUT) || // Set to slave Rx channel
!workerchn.setChannelFreq(57, ANT_PLUS_TIMEOUT) || // Set channel freq.
!workerchn.setChannelID(0, false, 19, 0, ANT_PLUS_TIMEOUT) || // Set channel ID
!workerant.openRxScanMode(0) // Open channel in continuous scanning mode
)
{
// If none of the above configuration worked, null everything out and throw an exception; keep looking
workerant = null;
workerchn = null;
throw new Exception();
}
// Add event handler to listen to the channels
workerchn.channelResponse += new dChannelResponseHandler(workerchn_channelResponse);
// Wait for ...5 minutes?
workerant.openRxScanMode(5 * 60 * 1000);

As far as the message being flagged as 0x50 and that being invalid - good to know. I'll try to enable channel ID in extended messaging and we'll see what comes up.

Thanks everyone      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Small correction - the channel assignment is OK. That was my mistake in interpreting the log. Sorry for the confusion.      
Rank

Total Posts: 22

Joined 0

PM

Question - when you asked to enable channel ID, did you mean enable Device ID (in the same place where the RSSI was configured; or it on?)      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Yes. For more details on how this works, refer to section 7.1.1 on the ANT Message Protocol and Usage document.      
Rank

Total Posts: 22

Joined 0

PM

Hi everyone

I turned on the extended messaging to display the channel information and what I'm seeing is that the "mangled" names are coming from devices with the same device number. I've attached the log, but the gist is this:

240.133 { 175673022} Rx - [A4][0E][4E][00][00][68][F8][70][00][00][00][00][80][10][B6][13][05][34]
240.133 { 175673022} Rx - [A4][0E][4E][00][00][CE][F8][70][00][00][00][00][80][10][B6][13][05][92]

The top message is the one that's "mangled" and the bottom message is the one that's the actual beacon. I'm still looking into whether or not this is a threading/concurrency issue but seeing that, I'm not sure if that makes me believe it is more or less.      

File Attachments

Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Could you confirm using either ANTware of the ANT+ simulator what is the channel ID of the chirps "SOAP" and ":--D"?

If possible, can you provide a full list of channel ID's (particularly device number) and the string associated with them?      
Rank

Total Posts: 22

Joined 0

PM

Here's the information:
Device beacon (page 0) - Device number - Name in ASCII
00-8A-50-14-00-00-00-00 - 48-B6 - BE 4
00-A2-50-12-00-00-00-00 - 5E-B6 - HE 2
00-92-1D-A9-90-00-00-00 - 79-B6 - DAVID
00-86-EB-A1-00-00-00-00 - 17-B6 - ANNA
00-CE-F8-70-00-00-00-00 - 10-B6 - SOAP
00-A0-04-40-00-00-00-00 - 20-B6 - HE 1
00-B2-90-13-00-00-00-00 - 21-B6 - LI 3
00-97-2A-63-00-00-00-00 - 4B-93 - ERIC
00-86-E9-32-97-70-00-00 - 76-B6 - ANDREW
00-A2-1C-B6-97-90-00-00 - 43-92 - HARVEY
00-8E-8C-A9-CC-00-00-00 - BD-8F - CHRIS
00-A8-00-00-00-00-00-00 - 04-B6 - J
00-00-1D-A9-90-00-00-00 - 79-B6 - (invalid)
00-68-D9-00-00-00-00-00 - 1A-B6 - :-D
00-68-D9-00-00-00-00-00 - 10-B6 - (invalid)
00-68-F8-70-00-00-00-00 - 10-B6 - (invalid)
00-68-D9-70-00-00-00-00 - 10-B6 - (invalid)
00-B2-90-63-00-00-00-00 - 4B-93 - (invalid)
00-97-2A-63-00-00-00-00 - 21-B6 - (invalid)
     
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Thanks for the additional info. The last log including the device numbers is particularly helpful. We'll need to investigate this further.      
Rank

Total Posts: 22

Joined 0

PM

Hello everyone

I ran the program that I wrote on two different computers running at the same time displaying the channel IDs and both computers displayed the different channel IDs with the mangled names. I don't know if this helps anyone with anything, but I just thought I'd add it as a note.      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

We are attempting to reproduce your setup, with 16 chirps and a USB2 in scanning mode.

One thing that caught our attention from your logs is that it looks like the chirps are transmitting at 4Hz (from the timestamps between messages). Is there any reverse direction communication going on to keep them transmitting at 4Hz? Or were the logs provided after you had just programmed them?      
Rank

Total Posts: 22

Joined 0

PM

The chirp seems to go at 4Hz when you first turn it on, then after ~30 seconds, it goes to the 0.5 Hz. The collisions are most prevalent once they're first turned on though I did notice them happening after extended periods of running.

In the most recent case that we're looking at, what I did was turn on each chirp individually with the USB running the whole time and what happened was it would collide in the beginning or every now and then, you wouldn't see a new chirp being added.

Thanks again