Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Can’t connect to more than 2 devices in continuous scanning mode

Rank

Total Posts: 17

Joined 2009-05-04

PM

I've been working with continuous scanning mode on my base station and it's been working really well overall. Unfortunately, I'm running into some bandwidth issues when multiple devices are in range.

I have four wireless nodes, each is configured as a Master on channel 0 with a 8 Hz message rate. The nodes are custom boards with the MSP430 processor communicating in async serial mode with the NRF24AP1. The base station is just the sample code that was sent with the development kit for continuous scanning and the USB wireless node that comes with the development kit.

If I turn on all four wireless nodes the base station only shows that it's receiving from two of them. I don't know how it decides which two to show, if I turn on all four I usually see a different pair working each time.

If I change the message rate from 8 Hz to 4 Hz on all four nodes, all four are visible on the base station. So there seems to be some overall message rate limit of 16 Hz. What could be causing this limitation?

Interestingly, back when I was trying to get auto shared channels working I had a similar issue. The nodes were configured with a 8 Hz message rate and the base station would only pick up two of them. I didn't try a slower message rate at the time as I was trying to work on other issues I was having the auto shared channel code but it seems like the problem I'm having is common to both configurations even though I was using a completely different USB key and channel setup.

Thanks!      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

In the case of a shared channel, the application on the master decides how frequently to poll for each slave, so there is no reason why the master would not be able to pick up transmissions for as many nodes as it can address. We have successfully connected > 30 devices (@4Hz) to an auto shared master, so bandwidth is not likely to be the issue you are running into. Four nodes at 8Hz each is well within the bandwidth that the scanning mode can manage.

Are your transmitter devices configured as Tx only? Can you provide more details on the configuration parameters of your four transmitters? Did you modify the PC application you are using as your base station (the one bundled with the Continuous Scanning Mode application note)?

You can set up a test using ANTware connected to an AP1, and opening four channels as masters, with different channel IDs, but the same RF frequency and channel period. Setup the scanning mode demo, connected to an AT3, to match the RF frequency of the masters, and wild card the channel ID. Are you able to see messages from all devices in this case? You should be seeing something like this:

[img size=585]http://www.thisisant.com/images/fbfiles/images/MultipleTx8Hz.jpg[/img]      
Rank

Total Posts: 17

Joined 2009-05-04

PM

I'll try the test you mentioned when I can.. in the meantime, the Master nodes are configured for bidirectional communication.. here's the configuration block that I'm using:

static const UCHAR aucANTAssignChannel0[] = {MESG_ASSIGN_CHANNEL_SIZE, MESG_ASSIGN_CHANNEL_ID, CHANNEL_0, CHANNEL_TYPE_MASTER, DEFAULT_NETWORK};
static const UCHAR aucANTSetChannelID0[] = {MESG_CHANNEL_ID_SIZE, MESG_CHANNEL_ID_ID, CHANNEL_0, DEVICE_NUM_LSB, DEVICE_NUM_MSB, DEVICE_TYPE, TRANS_TYPE};
static const UCHAR aucANTSetChannelPeriod0[] = {MESG_CHANNEL_MESG_PERIOD_SIZE, MESG_CHANNEL_MESG_PERIOD_ID, CHANNEL_0, MSG_PERIOD_4HZ_LSB, MSG_PERIOD_4HZ_MSB};
static const UCHAR aucANTSetChannelRFFreq0[] = {MESG_CHANNEL_RADIO_FREQ_SIZE, MESG_CHANNEL_RADIO_FREQ_ID, CHANNEL_0, DEFAULT_RF_FREQ};
static const UCHAR aucANTSetChannelSearchTimeout0[] = {MESG_CHANNEL_SEARCH_TIMEOUT_SIZE, MESG_CHANNEL_SEARCH_TIMEOUT_ID, CHANNEL_0, SEARCH_TIMEOUT};
static const UCHAR aucANTOpenChannel0[] = {MESG_OPEN_CHANNEL_SIZE, MESG_OPEN_CHANNEL_ID, CHANNEL_0};


Also, I have not modified the supplied continuous scanning mode base station.

Thanks!      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Can you post the actual channel parameters used for each node? (eg. DEVICE_NUM_MSB, DEVICE_NUM_LSB, DEVICE_TYPE, TRANS_TYPE, MSG_PERIOD_4HZ_MSB, etc...)      
Rank

Total Posts: 17

Joined 2009-05-04

PM

Ok, I just tried the ANTWare test you mentioned and it works properly. So there must be some difference between the ANTWare setup with the black USB key and the nodes that we've made with the nRF24AP1. Any ideas?      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

ANTware generates a log for each communication session with ANT. You will find a file named DeviceX.txt, where X is a number, on the working directory of ANTware. You can look at this log to see the sequence of commands that was sent from ANTware, and compare it with the configuration on your nodes.      
Rank

Total Posts: 17

Joined 2009-05-04

PM

Here's the code that I'm using. I included the 8Hz definition here instead of the 4Hz since the 8Hz is more limiting.

For the other device numbers I would change both DEVICE_NUM and DEVICE_NUM_LSB to 51 or 58, etc.

// Network Settings
#define DEFAULT_NETWORK ((UCHAR) 0x00)

// RF Frequency
#define DEFAULT_RF_FREQ ((UCHAR) 0x42)

// Channel search timeout
#define SEARCH_TIMEOUT ((UCHAR) 0x00)

// Transmission Type
#define TRANS_TYPE ((UCHAR) 0x07)

// Device Types
#define DEVICE_TYPE ((UCHAR) 0x01)

// Device Number
#define DEVICE_NUM ((USHORT) 55)
#define DEVICE_NUM_MSB ((UCHAR) 0x00)
#define DEVICE_NUM_LSB ((UCHAR) 55)

// Message Periods
#define MSG_PERIOD_8HZ ((USHORT) 0x1000)
#define MSG_PERIOD_8HZ_MSB ((UCHAR) 0x10)
#define MSG_PERIOD_8HZ_LSB ((UCHAR) 0x0)      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Another thing I would suggest is to test each of the transmitters independently, with a slave (eg. ANTware) to make sure they are transmitting when configured for 8Hz. If you are not already doing so, monitor the responses from ANT to see if you are getting any errors when configuring and opening the channel.

By the way, as the transmitters are configured as masters, you do not need to set the search timeout.      
Rank

Total Posts: 17

Joined 2009-05-04

PM

Well... it's working now at 8 Hz with more than two devices with the continuous scanning base station. I don't know what was wrong before... I compared the commands that were being sent and there was no important difference. My (embarrassing) guess is that my batteries were dying and running at a slower rate allowed them to hang on a bit longer.

So I'm going to buy a big pack of new batteries and see what I can do. Thanks again for your help!!      
Rank

Total Posts: 17

Joined 2009-05-04

PM

Well.. the batteries weren't the problem. I'm connecting to at most 2-3 nodes at a time (running at 4 to 8Hz). However, I can open up the ANTWare tool and start 4 more masters, all at 16Hz and I'll be able to see all 6 or 7 masters at once.

So I know this isn't a bandwidth issue. And from the previous debugging I know I'm configuring my nodes with the same commands and parameters as the ANTWare tool. So any other ideas?      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

Have you been able to verify that all your masters are transmitting as expected? (i.e., set up ANTware as the receiver, and use your embedded devices as the transmitters, and check each transmitter one by one)      
Rank

Total Posts: 17

Joined 2009-05-04

PM

It looks like the Masters don't always turn on correctly. The LED's blink showing that the processor is working correctly but nothing is sent out through the wireless. I'm having some trouble debugging this because the masters seem to work every time when I run them when the debugger connected. So it's obviously not a problem with the code - it's either timing or some supply issue.

I do have one LED I can control on the masters so I'll try to do some debugging with that. Do you have any ideas for additional resets or delays that I could add to make the ANT start up properly every time? I added a ANT system reset command but it didn't seem to help.

Thanks!      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

It sounds like you might have a problem with your serial communication between ANT and the host MCU.

When you send the configuration commands to ANT, please ensure you are getting a response every time (RESPONSE_NO_ERROR). It might also be helpful to use a scope to verify that the state of the serial lines is as expected after the reset.      
Rank

Total Posts: 17

Joined 2009-05-04

PM

Thanks for your help. In my older code I had a short delay (for (int i = 0; i < 10000; i++)) to allow the 32kHz crystal to stabilize. My newer code didn't have this - but adding it back solved my problems with the wireless. I just ran a test with 6 nodes and it worked perfectly!