Replies: 1 comment 1 reply
-
|
I tried all sorts of things on both the client and the server. After the server and client have connected once, the client remembers the ID of that server, and will stay connected forever, and will attempt to connect to it from then on if it reboots or looses the connection. It reliably connects and stays connected when the server boots. When the client is reset the server recognizes the connection loss, and starts advertising (just like it does from a boot). The two connect OK, the client gets the service quickly, and the server sends notifications that are received by the client. But after a many seconds, it will disconnect. From then on the client will connect to the server quickly, but the call to getService takes many seconds and fails. The server thinks it has a connection, and do its notification every second, which the client never receives, but the server will recognize it has no connection many seconds later and resume advertising and the cycle repeats. I tried getServices(true) on the client before getService. (an issue suggested this as a solution) I finally gave up and do an esp_reset() on the server when it looses a connection. Ultimately, a reset is fine for my application, but this seems pathetic. Should I file an issue? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have up to 8 servers and 1 client. All are running on ESP32. The servers are identical using esp-nimble-cpp. The client uses Nimble-arduino.
The client runs a task that wakes every second to find any unknown servers that it should have. It also connects any known servers that have disconnected.
If the server is not connected, it advertises. When connected, it sends a data every 2 seconds with notify(), with a light sleep in between.
This works, except when I restart the client. It remembered the clients, so it connects with each, get the service and characteristic so that it can listen for the notify. Sometimes it fails to get the service. It connects to the server quickly, then waits many seconds and finally fails to return the service. The server behaves for a short while as if it is connected, sending the notify, then concludes it has no connection and advertises.
I could use some clues as to what might be going on. It feels like there might be some state information in the server that needs to be reset.
Beta Was this translation helpful? Give feedback.
All reactions