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?
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:
- 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.
For clarification (I think the logs are not telling all):
As an example:
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.
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.
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.
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.