chrome.bluetoothLowEnergy API write without response

302 views
Skip to first unread message

K.C. Chang

unread,
May 14, 2015, 3:32:44 AM5/14/15
to chromi...@chromium.org
Hello, 

Does anyone know how to specify characteristic property "WriteWithoutResponse" when using writeCharacteristicValue ?

My app returns error when I call the following write API more than once:

chrome.bluetoothLowEnergy.writeCharacteristicValue(string characteristicId, ArrayBuffer value, functioncallback)

In my case, the functioncallback returns chrome.runtime.lastError and console.log(chrome.runtime.lastError.message) prints out "In Progress".

I think this error is due to the fact that my BLE device only provides service/characteristic with "WriteWithoutResponse".

I can write to my BLE device successfully only once. 

Any additional write call returns "In Progress" error message as if it is waiting for the response from the first write call.

I'm stuck and any help is appreciated!

Thanks.

--kc


Jakub Pawlowski

unread,
May 14, 2015, 4:28:50 AM5/14/15
to K.C. Chang, chromi...@chromium.org
Hi,

ChromeOS internally uses BlueZ to do bluetooth stuff, and it should
handle WriteWithoutResponse correctly. Here's a procedure that decides
which write method to use:

http://git.kernel.org/cgit/bluetooth/bluez.git/tree/src/gatt-client.c?id=992e7f5cb288cee42453fa018c381984c86fd217#n884

And here's "write_without_response" case handled:

http://git.kernel.org/cgit/bluetooth/bluez.git/tree/src/gatt-client.c?id=992e7f5cb288cee42453fa018c381984c86fd217#n949

Please check that characteristic that you're writing to have proper
properties set, otherwise BlueZ might pick wrong method.
> --
> You received this message because you are subscribed to the Google Groups
> "Chromium Apps" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to chromium-app...@chromium.org.
> To post to this group, send email to chromi...@chromium.org.
> Visit this group at
> http://groups.google.com/a/chromium.org/group/chromium-apps/.
> For more options, visit https://groups.google.com/a/chromium.org/d/optout.

K.C. Chang

unread,
May 14, 2015, 5:29:56 AM5/14/15
to Jakub Pawlowski, chromi...@chromium.org
Hello, 
Thanks for answering quickly.
I looked at the links you emailed to me.

The following is my characteristic object:

Object {instanceId"/org/bluez/hci0/dev_F7_41_CD_BB_55_A3/service000e/char000f"isLocalfalsepropertiesArray[1]serviceObjectuuid"0000a006-9c80-11e3-a5e2-0800200c9a66"}
  1. instanceId"/org/bluez/hci0/dev_F7_41_CD_BB_55_A3/service000e/char000f"
  2. isLocalfalse
  3. propertiesArray[1]
    1. 0"writeWithoutResponse"
    2. length1
    3. __proto__Array[0]
  4. serviceObject
  5. uuid"0000a006-9c80-11e3-a5e2-0800200c9a66"
  6. __proto__Object

As you can see, it has property "writeWithoutResponse". 
This BLE device works properly under OS X.
Do you have any insight about chrome.runtime.lastError.message "In progress" when calling writeCharacteristicValue() more than once?
Do you know what "In progress" means?

Thanks.

--kc

Jakub Pawlowski

unread,
May 14, 2015, 6:38:27 AM5/14/15
to K.C. Chang, chromi...@chromium.org
Can I ask what is the BLE device at the other hand ? And if it's phone
what app ?

Please note that if device at other end handles both write and
write_without_response, BlueZ would pick write method, see code I
pointed you at.

By saying "Please check that characteristic that you're writing to
have proper properties set, otherwise BlueZ might pick wrong method."
I meant you should check that write without response is set, and
regular write is not.

You can use some bluetooth debugging tool, i.e. btmon. I think there's
bluetooth scanner android app that would show you all properties, or
some iOS app.

K.C. Chang

unread,
May 15, 2015, 3:49:39 PM5/15/15
to Jakub Pawlowski, chromi...@chromium.org
Hello,
I am building a small robot communicating via BLE.
This robot only handles WriteWithoutResponse.

My app reads sensor data from the robot and sends command to the robot.
I have no problems with writing to my robot under OS X using Python and JavaScript(node.js). And WriteWithoutResponse behaves correctly.

I've checked services/characteristics using other bluetooth tools and it is consistent with my robot's spec.

So, it seems that "WriteWithoutResponse" is not working properly using chrome.bluetoothLowEnergy API under Chrome OS in Chromebook.

Have you guys experienced that "WriteWithoutResponse" behaves properly using chrome.bluetoothLowEnergy API? Are there any examples?

Thanks.

--kc

Rob Moran

unread,
Jul 13, 2015, 5:27:14 AM7/13/15
to chromi...@chromium.org, jpawl...@google.com
I am seeing exactly the same problem as described here.

When writing to a characteristic which only has the WRITE_NO_RESPONSE property, I see an 'In Progress' error in chrome.bluetoothlowenergy.

Was any further information found outlining what this error means and whether the write type was wrong?

I'm communicating with my own service built on a Nordic BLE MCU which works correctly with OSX (corebluetooth) and iOS/Android (BLE in phonegap).

Thanks

Rob

Bryce Thorup

unread,
Jan 8, 2016, 11:35:33 AM1/8/16
to Chromium-Apps-Announce, jpawl...@google.com, robert...@gmail.com
I am seeing the same effect as the others. I am trying to change the color on a Playbulb Candle device. The characteristic for the color value (hex id 0xFFFC) contains properties for 'read' and 'writewithoutresponse'. I can perform a read on it without a problem and I can write to it once and have it change color without a problem, but when I try to write again it throws the 'In Progress' error mentioned above. The only way I have found to get around it is by power-cycling the candle and restarting the app. I feel like the API is getting stuck waiting for a response, when there is none to be had. I want to echo the request for a working demo of the API writing to a 'writewithoutresponse' characteristic property. I feel like I am probably just missing something, but if it is a bug it would be nice to get it resolved. 

Vincent Scheib

unread,
Jan 8, 2016, 12:52:15 PM1/8/16
to Bryce Thorup, Chromium-Apps-Announce, Jakub Pawlowski, robert...@gmail.com
Sorry for the hang up Bryce. Please file an issue with the central device & OS you're using, device you're connecting to (we have Playbulb candles in office, so we can check with that). Also, does the Web Bluetooth API Playbulb Demo work from that computer (See implementation status for flags and supported devices/OS)?

You received this message because you are subscribed to the Google Groups "Chromium-Apps-Announce" group.

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-app...@chromium.org.
To post to this group, send email to chromi...@chromium.org.

Vincent Scheib

unread,
Jan 8, 2016, 12:53:42 PM1/8/16
to Bryce Thorup, Chromium-Apps-Announce, Jakub Pawlowski, robert...@gmail.com, François Beaufort
Also, if you can include your sample code in the issue it would speed up looking into it.

Bryce Thorup

unread,
Jan 8, 2016, 12:57:35 PM1/8/16
to Vincent Scheib, Chromium-Apps-Announce, Jakub Pawlowski, robert...@gmail.com, François Beaufort
I'll get the code posted as soon as I can.
--
Bryce Thorup

Bryce Thorup

unread,
Jan 9, 2016, 11:55:42 AM1/9/16
to François Beaufort 🇫🇷, Vincent Scheib, Chromium-Apps-Announce, Jakub Pawlowski, robert...@gmail.com
Just switched to beta channel. It seems to be working as expected now. Thank you. I look forward to 48 hitting stable.

On Sat, Jan 9, 2016 at 12:02 AM François Beaufort 🇫🇷 <fbea...@google.com> wrote:
I believe this should be fixed in Chrome OS 48. See https://code.google.com/p/chromium/issues/detail?id=531536 for some background.

According to https://googlechrome.github.io/current-versions/, you may want to switch to Beta Channel. Please let us know if that solves your issue.

--
Bryce Thorup
Reply all
Reply to author
Forward
0 new messages