Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

startAdvertising and startAdvertisingIBeacon, Command Dissallowed #393

Open
lastmjs opened this issue Jun 8, 2018 · 2 comments
Open

startAdvertising and startAdvertisingIBeacon, Command Dissallowed #393

lastmjs opened this issue Jun 8, 2018 · 2 comments

Comments

@lastmjs
Copy link

lastmjs commented Jun 8, 2018

Hi there,

I am advertising both iBeacons and plain advertisements. I have an interval of 100 milliseconds setup, where I switch between each type of advertisement. It works very well most of the time. Every once in a while, I will get one of the following errors when I try to start advertising one of the advertisement types:

bleno.startAdvertisingIBeacon Error: Command Disallowed
    at Gap.onHciLeAdvertiseEnableSet (/home/pi/development/portal-blue/door-device/node_modules/bleno/lib/hci-socket/gap.js:201:15)
    at emitOne (events.js:115:13)
    at Hci.emit (events.js:210:7)
    at Hci.processCmdCompleteEvent (/home/pi/development/portal-blue/door-device/node_modules/bleno/lib/hci-socket/hci.js:669:10)
    at Hci.onSocketData (/home/pi/development/portal-blue/door-device/node_modules/bleno/lib/hci-socket/hci.js:540:12)
    at emitOne (events.js:115:13)
    at BluetoothHciSocket.emit (events.js:210:7)

or

bleno.startAdvertising Error: Command Disallowed
    at Gap.onHciLeAdvertiseEnableSet (/home/pi/development/portal-blue/door-device/node_modules/bleno/lib/hci-socket/gap.js:201:15)
    at emitOne (events.js:115:13)
    at Hci.emit (events.js:210:7)
    at Hci.processCmdCompleteEvent (/home/pi/development/portal-blue/door-device/node_modules/bleno/lib/hci-socket/hci.js:669:10)
    at Hci.onSocketData (/home/pi/development/portal-blue/door-device/node_modules/bleno/lib/hci-socket/hci.js:540:12)
    at emitOne (events.js:115:13)
    at BluetoothHciSocket.emit (events.js:210:7)

I understand that you cannot advertise both at the same time, which is why I always call bleno.stopAdvertising before starting to advertise the other advertisement. I start up the advertising in the callback of the bleno.stopAdvertising call, which I would think waits until the system is ready for any other type of advertisement to begin, but that doesn't seem to be the case.

Usually the errors happen once or twice and my interval then continues to work properly. At least once though, the errors get into some kind of infinite loop and don't stop occurring until I completely cycle the bluetooth interface.

@icarus31
Copy link

icarus31 commented May 5, 2022

@lastmjs , i know it's been a while, but do you remember if you figure out something?

@rzr
Copy link

rzr commented Jun 30, 2023

May I suggest to try @abandonware fork and report at:
Relate-to: abandonware#17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants