Export to GitHub

android-developer-preview - issue #589

BLE advertising is failing


Posted on Jul 5, 2014 by Swift Horse

* Which version of the SDK are you using? SKD Platform Android L Preview (v.20)

* Which Android build are you using? (e.g. LPV79) LPV79

* What device are you using? Nexus 7 with Wifi only

* What steps will reproduce the problem? (Please provide the minimal reproducible test case.)

AdvertiseSettings.Builder asBuilder = new AdvertiseSettings.Builder(); asBuilder.setAdvertiseMode(AdvertiseSettings.ADVERTISE_MODE_BALANCED); asBuilder.setTxPowerLevel(AdvertiseSettings.ADVERTISE_TX_POWER_HIGH); asBuilder.setType(AdvertiseSettings.ADVERTISE_TYPE_SCANNABLE);

AdvertisementData.Builder adBuilder = new AdvertisementData.Builder();

AdvertiseCallback advertiseCallback = new AdvertiseCallback() { @Override public void onSuccess(AdvertiseSettings advertiseSettings) { System.out.println("advertising"); }

@Override
    public void onFailure(int i) {
        System.out.println("err: " + i);
}

};

bluetoothLeAdvertiser.startAdvertising(asBuilder.build(), adBuilder.build(), advertiseCallback);

* How frequently does the issue occur? (e.g. 100% of the time, 10% of the time) 100% of the time

* What is the expected output? BLE advertising will successfully start

* What do you see instead? ADVERTISE_FAILED_TOO_MANY_ADVERTISERS

* Relevant logcat output.

07-05 16:49:23.693 6728-6745/com.schizofreny.test I/art﹕ Profiler disabled. To enable setprop dalvik.vm.profiler 1 07-05 16:49:23.766 6728-6746/com.schizofreny.test D/BluetoothLeAdvertiser﹕ onClientRegistered() - status=0 clientIf=5 07-05 16:49:23.767 6728-6745/com.schizofreny.test I/System.out﹕ err: 2 07-05 16:49:23.809 6728-6728/com.schizofreny.test I/am_on_resume_called﹕ [0,com.schizofreny.test.MyActivity] 07-05 16:49:23.817 6728-6760/com.schizofreny.test D/CanvasContext﹕ Render dirty regions requested: true 07-05 16:49:23.821 6728-6728/com.schizofreny.test I/am_on_paused_called﹕ [0,com.schizofreny.test.MyActivity] 07-05 16:49:23.853 6728-6760/com.schizofreny.test W/Adreno-GSL﹕ <ioctl_kgsl_device_getproperty:663>: mmap failed: errno 22 Invalid argument 07-05 16:49:23.853 6728-6760/com.schizofreny.test I/Adreno-EGL﹕ <qeglDrvAPI_eglInitialize:320>: EGL 1.4 QUALCOMM Build: I10246dbd022c719c705be805d5642cc8fdfbd2a2Date: 03/10/14 07-05 16:49:23.854 6728-6760/com.schizofreny.test I/CanvasContext﹕ Initialized EGL, version 1.4 07-05 16:49:23.881 6728-6760/com.schizofreny.test D/OpenGLRenderer﹕ Enabling debug mode 0

* Optional: Other information that would be helpful in resolving the issue.

I might be doing something wrong, but I'm not able to resolve this issue on my own . . . I haven't found any specific documentation that would help me resolve this error status.

Comment #1

Posted on Jul 7, 2014 by Happy Panda

(No comment was entered for this change.)

Comment #2

Posted on Jul 8, 2014 by Happy Panda

Thank you for reporting this issue. We have passed this on to the development team and will update this issue with more information as it becomes available.

Comment #3

Posted on Jul 29, 2014 by Helpful Kangaroo

I guess you didn't stop your advertiser carefully. If you happen to restart your advertiser, please make sure you stop the advertiser first. What I know now, maybe it is wrong: Android allows only one advertiser for one app.

Comment #4

Posted on Jul 29, 2014 by Happy Horse

This happens the first time you try to start the advertiser. A call to stopAdvertising() at this point would result in error code 4 (ADVERTISE_FAILED_NOT_STARTED).

Furthermore, I have tried every possible combination of AdvertiseSettings and AdvertisementData and cannot get the device to startAdvertising without error 2 (ADVERTISE_FAILED_TOO_MANY_ADVERTISERS).

My code is attached.

Attachments

Comment #5

Posted on Jul 29, 2014 by Happy Giraffe

I was tracking this too until I saw this line in the SDK docs:

Wireless and Connectivity

The android.bluetooth.le APIs are supported only on Nexus 5 devices.

Like you I was trying this on a Nexus 7. On a Nexus 5 the same exact code works fine.

Comment #6

Posted on Aug 4, 2014 by Grumpy Monkey

Is this not supported on a Nexus 7 because it lacks the hardware, or can we expect the functionality to be added to android L for the nexus 7 at a later date?

Comment #7

Posted on Aug 10, 2014 by Happy Horse

I have tested the code with the newest developer preview for the Nexus 7 lpv81c (https://developers.google.com/fit/preview) and the problem is still there. It would be great to know if it will be fixed in the release build.

Bluetooth Low Energy scanning/discovery/central mode works with the BLE explorer app, I would assume this means the hardware is capable.

Comment #8

Posted on Aug 14, 2014 by Happy Panda

For us to be able to investigate this issue it would be helpful if you could provide the following additional information:

Android bug report

After reproducing the issue, press the volume up, volume down, and power buttons simultaneously. This will capture a bug report on your device in the “bug reports” directory. Attach this file to this issue.

Comment #9

Posted on Aug 14, 2014 by Happy Horse

here ya go. I attached the code that would produce this earlier.

Attachments

Comment #10

Posted on Sep 3, 2014 by Massive Dog

We are able to recreate this issue as well. It has caused great concern with our investors about a current BLE project and our ability to move forward with an Android release. Need this one fixed and FAST!

Comment #11

Posted on Sep 3, 2014 by Swift Camel

This is a showstopper for us as well. Would be nice to get an update. Thanks!

Comment #12

Posted on Sep 10, 2014 by Helpful Panda

The important question is Mark's #6. Will this be fixed when L is released or will the Nexus 7 never support it? And if it won't be fixed what is the missing hardware feature?

Comment #13

Posted on Sep 12, 2014 by Massive Dog

I can backup the comments in #5. It took us a few days to get a Nexus 5 w/o a phone plan (freakin Best Buy), but we did finally get it today. I installed L and ran the exact same project code from Android Studio on the Nexus 5 and Nexus 7. Nexus 5 broadcasts, 7 does not.

Comment #14

Posted on Sep 18, 2014 by Quick Kangaroo

I am facing the same issue. Invested in two new Nexus 7's and found this issue after setting up everything.

Comment #15

Posted on Oct 1, 2014 by Swift Rabbit

Thank you for submitting this issue. The development team has concluded that this is working as intended as we currently don't support advertising on N7. It was mentioned in the release notes:

Wireless & Connectivity The android.bluetooth.le APIs are supported only on Nexus 5 devices.

Comment #16

Posted on Oct 1, 2014 by Helpful Panda

Does that mean it won't be fixed in the final L release? I assumed the release notes were only for the preview release.

Comment #17

Posted on Oct 1, 2014 by Swift Camel

I think it's really important to communicate these details out. There are businesses being built on these features. Is BLE advertising going to be phone only? Is it dependent on a particular chipset? This really needs to be communicated..

Comment #18

Posted on Oct 2, 2014 by Swift Rabbit

Unfortunately, we can not comment on release plans/features at this time.

Status: WontFix

Labels:
Type-Defect defect-16159607 Restrict-AddIssueComment-Commit