No Advertisements after connection

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I have a new Problem with my application:

Sometimes my application (handset) can't receive advertisments from my sensors.

For further tests I set up a second sensor.

But if my handset is connected to one sensor, there is no callback of advertisements of my second sensor, but with a smartphone I can see the second sensor is still advertising.

Anybody a hint what I forgot to call so my handset can connect to more than one sensor?

1 Solution
Anonymous
Not applicable

After a lot of playing around I think I found the problem.

If I'm scanning all the time with HIGH_SCAN, the chip looses the ability to scan or to receive advertisements.

But if I change the scanning to LOW_SCAN, I can receive all the advertisements.

View solution in original post

0 Likes
7 Replies
Anonymous
Not applicable

Have you taken a look at hello_client?  If you search for "num_slaves" you can see all the calls that deal with connecting multiple devices.

-Kevin

0 Likes
Anonymous
Not applicable

Hi kwang,

My current application uses the hello_client as code-base.

But I compared both everything of "num_slaves" also occures on my applicatio like in the hello_client with just one difference:

on connection_down I decrement num_slaves only if role is also MASTER:

if (sensor.dev_info[con_index].role == SLAVE) {
    sensor.handle_to_master = 0;

    // restart scan
    blecm_setAdvDuringConnEnable(TRUE);
} else {
    blecli_ClientHandleReset();
    /*@-unrecog@*/
    blecen_connDown();
    /*@=unrecog@*/

    sensor.num_slaves--;
}
0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I have further information about my problem.

I started the handset and the sensor at the same time.

after about 30 seconds the handset crashed?!?

But then I can receive ADVs for about 300 seconds.

It is still possible to see the sensor with the smartphone.

As a next test, I restarted the handset, the sensor is still running,

Now I receive the ADVs again for about 500 seconds.

As a third test, I then restarted the Lamp, the sensor still running and not receiving ADVs from the sensor.

The handset won't receive ADVs from the sensor.

0 Likes
Anonymous
Not applicable

After a lot of playing around I think I found the problem.

If I'm scanning all the time with HIGH_SCAN, the chip looses the ability to scan or to receive advertisements.

But if I change the scanning to LOW_SCAN, I can receive all the advertisements.

0 Likes
Anonymous
Not applicable

Hi jaruhl

Thanks for your investigation, because I also observed exactly the same problem.

I have one question about your solution:

When you say "But if I change the scanning to LOW_SCAN, I can receive all the advertisements.", do you mean we should use LOW_SCAN all the time (never use HIGH_SCAN), or do you mean we should only use LOW_SCAN once when the problem occurs then switch back to HIGH_SCAN?

Current I set the same interval and window for HIGH_SCAN and LOW_SCAN. So they have no difference to me, I just don't know whether I should switch between these two scanning modes or stay with LOW_SCAN only to avoid such problem.

Thanks

noalac

0 Likes
Anonymous
Not applicable

Hi noalac,

I'm always scannin with LOW_SCAN.

All other devices sending ADVs undirected and directed in HIGH-Mode, so the connection is established fast enough.

Anonymous
Not applicable

Thanks

I tested the solution today, also using LOW_SCAN all the time and never had issue any more.