hello_sensor doesn't connect if sending directed ADV for longer time

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi everybody,

I have a strange problem with my application.

My application is sending directed ADVs to a hello_client. Everything is working fine.

But if the sensor reboots and can't connect to the hello_client within some seconds, it won't connect to the hello_client. If I reboot the sensor again, it will connect.

I also tried turning on undirected ADVs, but it is also NOT visible on my Phone.

I tested with high directed ADVs (30,0), high and low directed ADVs (30,30) and low directed ADVs (0,30). Always the same problems.

I don't know what else I could change.

I'm using WICED-SDK 2.2.2 on Windows with 20936S (Module)

0 Likes
9 Replies
MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

Adding jamesle1​ on the applications team.

0 Likes
Anonymous
Not applicable

Hello.

Can you elaborate on what you mean by "But if the sensor reboots and can't connect to the hello_client within some seconds, it won't connect to the hello_client. If I reboot the sensor again, it will connect."?

Are you having problem connecting for the second time? Or are you having problem with sensor not connecting after some seconds?

Are you restarting the advertisement after it stops? Would this solve your problem?

James

0 Likes
Anonymous
Not applicable

Hi jamesle1

The sensor can connect for the first seconds.

ADV will be restarted every 30 seconds.

As you can see in the log-files, a connection is also not possible after the restart of the ADV.

0 Likes
Anonymous
Not applicable

I'm sorry, but I can't really see the problem.

It seems like there are connection ups even after the device has been on for a long time even after the ADV has been restarted.

There were some parts where there weren't any connections for a long time, but it seems like the connections happen even after that before you reset it.

For example, in the onlyHighADV.log:

11:54:49 connection_down:handle:64

  - ADV happens...

13:17:06 Connection is UP. (connection happened without any restart)

  ...

13:17:44 - connection_down:handle:64

  ...

13:17:49 - create()

I'm not sure what the problem is.

Can you tell me the steps that you are taking in a scenario where you are seeing the problem?

My only advice is to make sure that the device that the sensor is trying to connect to goes through proper connection down when the sensor goes through the connection down too.

I once had a case where the mobile app will lose a connection, but the application stayed in connection state and had never gone through proper connection process.

See if this isn't happening. Also, you might want to test different scenarios with .con_idle_timeout.

James

0 Likes
Anonymous
Not applicable

Hi James,

For clarification (I think the logs are not telling all):

As an example:

onlyHighADV.log:

After flashing, the first connection after 908 seconds is ok, after that it will send directed ADVs.

Then it is always possible to connect to the device.

But after a Reboot, there is no connection (should be after about 340 seconds, just after restarting the ADV).

If I reboot the device, it will be connected as it should do just before the reboot.

The connecting device will be turned off. So for every connection it will have a clean boot.

There is also  a other device (with another firmare) connecting to the hello_client. This device can connect always, even if the this one can't connect. So I think it's a problem of that sensor.

.con_idle_timeout is the same on both sensors. So this should be not the problem.

0 Likes
Anonymous
Not applicable

Hello.

I'm a little lost as to what to test for next.

I tried different ADV types, but I couldn't repeat the scenarios that you are seeing.

Also, I'm a little confused when you say reboot.

Step 1. You have a device A that connects to device B.

Step 2. Then A will send directed ADVs to B without any problems for any future connections.

Step 3. But if you reboot A, there is no connection ( after A restarts sending directed ADVs to B)

Step 4. If you reboot A again after the step 3, A will connect fine with B.

Is that correct?

Sorry if I'm not understanding clearly and reiterating a lot.

James

0 Likes
Anonymous
Not applicable

Hi jamesle1

You are absolute right.

0 Likes
Anonymous
Not applicable

Hello.

Is this still an issue for you?

If this is still an issue, are you rebooting the hello_sensor or hello_client?

I tried to do the steps in the above comment with hello_sensor and hello_client, and it SEEMS to be working fine.

I also looked at your log files again, and I can't help but feel that your log files only tell about half of the picture.

I see a lot occasions where you device gets connected with the other device, but only to get disconnected shortly after.

Do you know the reasons why these disconnections happen?

Also, it seems like your issue involves around reboot.

Is there a way to restrict use cases, such that reboot doesn't happen or reboot only after clean disconnection from other devices?

I feel like you are rebooting devices without clean disconnection and that's what is causing your issues.

James

0 Likes
Anonymous
Not applicable

Hi jamesle1

At the moment I reboot the sensor every 30 seconds if it is sending ADVs. With this setup, connections work fine.

In the log-files you can see that there is nothing.

My client doesn't receive anything from the sensor, so it can't connect to it.

Only a few seconds after the reboot of the sensor it can connect to the client.

I don't know why or what I could do.

0 Likes