bt_nus_client_send failed (err -120) happend in certain frequency

Hi,

I have twp device: one peripheral and one central. My peripheral is sending out high payload data continiously. And my central is sending data ()in 10Hz frequency. However, every few times  I 'll receive bt_nus_client_send failed (err -120). I noticed that 120 means Operation already in progress. How to solve this issue? Or the central can only sending data very slow.

Whether it is relative to my setting interval=320 (400 ms), latency=0, timeout=400

Thank you for your help!

	 err = bt_nus_client_send(&nus_client, nus_data.data, nus_data.len);
				 if (err) {
					 LOG_WRN("Failed to send data over BLE connection"
						 "(err %d)", err);
				 }
 

Parents
  • Hello,

    If you want to send data every 100ms, I think it also make most sense to set the interval to 100ms. Else you will get very prone to interference and packet loss, since you will depend having to send multiple packets every interval.

    If you experience operation in progress error, you can simply go to sleep and wait until for instance next connection interval and try again.

    Kenneth

  • Hi,

    Thank you for your information. I am using bt_nus_send sending out data from peripheral to central without stop and there is no error sign. However, some time when I use bt_nus_client_send sending from central to peripheral  I will got the error sign. As two ends are using same interval, why only in central side will I receive this error?

  • There are two different api's used here: bt_gatt_notify() vs. bt_gatt_write(). First is used from server->client and second client->server.

    EBUSY (-16): Indicates that the operation cannot proceed because the Bluetooth stack is busy with another transaction. This can happen if a previous GATT write is still in progress or if another BLE procedure is ongoing that prevents new writes.

    Kenneth

Reply
  • There are two different api's used here: bt_gatt_notify() vs. bt_gatt_write(). First is used from server->client and second client->server.

    EBUSY (-16): Indicates that the operation cannot proceed because the Bluetooth stack is busy with another transaction. This can happen if a previous GATT write is still in progress or if another BLE procedure is ongoing that prevents new writes.

    Kenneth

Children
Related