Reconnection fail when going to "special case" using pClient->connect(advDevice, false) #847
Replies: 2 comments 3 replies
-
Bluetooth operates on a very busy frequency band that it shares with WiFi and other 2.4ghz devices, it is not uncommon for connections to fail and is usually caused by congestion of the airwaves causing missed packets. You can try to mitigate this by having looser connection parameters. |
Beta Was this translation helpful? Give feedback.
-
As mentioned above, I manipulated these values, decreasing intervals and increasing the timeout: pClient->setConnectionParams(20, 25, 0, 500); //previous 12, 12, 0, 150) and pClient->setConnectTimeout(7 * 1000); //previous (5 * 1000) Reconect Failed has stopped after these changes, however now only "Failed to connect" error appears. Look: Its is pretty much same behavior however in another part of the code: Any guess what is going on now ? Any impact from my changes ? |
Beta Was this translation helpful? Give feedback.
-
Hello, I am using nimBLE Client.ino code as a gateway to varry sensor servers. I am storing the logs to assess the gateway performance and have noticed for the first time one specific behavior of my application. The following error appears couple of times during execution:
It is curious because it fails to connect, scan again very quickly and then connect successfully to same device that failed before. Look below:
Please check it out below that there is no modification in original code.
This part of the code is returning false to "connect to server" funcion:
And then it prints Failed to connect, starting scan as shown in the log file presented above. See below:
Why my application does not connect when trying !pClient->connect(advDevice, false) ? Why it fails at this point, is there any alternative to overcome it ?
Beta Was this translation helpful? Give feedback.
All reactions