Client disconnected, reason 22

Hello,

we were using the HRS example as a starting point and modified it for our application. Everything works fine, we can see our custom characteristics, control our device and get sensor data back. But... after about 1..2 minutes we get disconnected. The message on the Nordic serial debug output is

<info> app: --> disconnected, reason 22

I searched here on the forum and my understanding is that the client has initiated this disconnection. Most threads have no solution what the problem was. We are not aware of doing any disconnection.

So what could be causing this? Where could we look to solve the problem?

Kind Regards,

Parents
  • Hello Einar,

    are your error codes on the serial debug interface displayed in hex? I thought the error code is 22 or 0x16. Please clarify.

    The changes to the base example are too many to list but we have not changed the basic structure or any of the timing parameters.

    I am not sure if the problem is related to your link, we are not using multiple connections. And the links in the solution reply are broken. I will try the suggested changes and report back.

    I tried the original HRS example and it does not show this behaviour.

    I am not sure what you mean by "what is running on the server side". This is our software based on the hrs example. On the client side we are using a Ublox Nina module; our customer is using an iphone.

    Kind Regards,

  • Hello

    Yes it seems you are correct, the error code is more likely to be 0x16. You can probably disregard the link I sent before then.

    This means the connection is closed by your application. There could be many reasons for this, see for example this blog post for some of the most common ones.

    Since the original sample works, I would suggest that you add your changes to it bit by bit until you find the change that causes the error. It is much easier to debug one small change at a time than your whole program at once.

    Best regards,

    Einar

Reply
  • Hello

    Yes it seems you are correct, the error code is more likely to be 0x16. You can probably disregard the link I sent before then.

    This means the connection is closed by your application. There could be many reasons for this, see for example this blog post for some of the most common ones.

    Since the original sample works, I would suggest that you add your changes to it bit by bit until you find the change that causes the error. It is much easier to debug one small change at a time than your whole program at once.

    Best regards,

    Einar

Children
No Data
Related