Advertising connectable: false stops advertising (nrf52832 dev board). #7302
Replies: 1 comment
-
Posted at 2019-04-04 by @gfwilliams That should work - is it just that you're connected to the device via Bluetooth LE to upload code? That stops advertising until you disconnect. Posted at 2019-04-04 by billsalt Hi @gfwilliams, I assure you I'm disconnected from the IDE. Here's a portion of the code (setup), since there's a bit more involved. If you know DMX lighting protocols, this is advertising code for DMX over Bluetooth. I've tested this with the last line commented out (turn off connectability), and there is no advertising. I've also tried changing the 'connectability' parameter in the initial setAdvertising with the same results: once I turn off conductibility, the device ceases to advertise.
Posted at 2019-04-04 by @gfwilliams I just tried here on an nRF52DK - completely fresh - and entered So it appears to be something to do with the contents of your first Posted at 2019-04-04 by billsalt Hi @gfwilliams, just to simplify; I eliminated the second setAdvertising (it was added for debugging) and went back to changing the initial setup. In the following code, when the parameter is set to true, everything works. When it is set to false, the board ceases to advertise. Please try it for yourself... The only other thing I'd add is that I'm uploading to flash (save on send = directly to flash). Thanks for checking this out.
Posted at 2019-04-04 by @gfwilliams Yes, I get that. However since this isn't an official board it'd be good if you could help me by narrowing it down to the bare minimum. So we know this does it:
And this doesn't (on its own):
What lines can be removed such that it still breaks? Posted at 2019-04-04 by billsalt I'm sorry that I have confused you. The first case you show does NOT work. I removed the 2nd call: I added for debugging when the simpler case did not work, but is confusing the issue. Anytime I turn off connectable (through either set of code) it stops advertising. Posted at 2019-04-04 by @gfwilliams By 'does it', I meant 'stops advertising'.
Posted at 2019-04-04 by @gfwilliams Ok, I just commented out lines and uploaded until I found what was causing the problem. It's I don't know why, but remove that or set it to 100 or above and you'll be fine. Posted at 2019-04-04 by @gfwilliams https://devzone.nordicsemi.com/f/nordic-q-a/25344/ble-adv-interval I'll make it throw an error Posted at 2019-04-04 by billsalt Hi @gfwilliams, I tested the following on a Pixl running released 2v01 code. It ceases to advertise. When set to true for connectable, it works fine. It is reproducible. Help? Bill
Posted at 2019-04-04 by @gfwilliams I'm not sure we're really on the same wavelength here - please can you read my last 2 posts? It isn't possible to do what you want, the spec forbids it. The issue here was Espruino not throwing an error to tell you that, but I just fixed it so latest builds will now throw an exception (and the limitation is now documented). But please - if you have issues in the future, can you just take a few minutes to try and get down to a reasonably minimal bit of code that has the problem. It means I can fix the issue far more quickly. Posted at 2019-04-04 by billsalt Apologies @gfwilliams. It has been that kind of day for me. I was spending multitasking cycles with other projects and replicating it on a supported platform as was suggested. I wasn't aware of this specification limitation, so thank you. Interestingly, this has been eliminated for 5.0 since it is something that we actually want to do. Looks like a new softdevice to enable that capability :-{ Posted at 2019-04-05 by billsalt Thank you @gfwilliams! REALLY appreciate your help. The code is part of a DMX lighting protocol over Bluetooth to on-stage lighting effects. The show has its final dress rehearsal tonight and I made the appropriate changes and everything is working, just in time! I'll send you some photos of the result when the show pics are posted. It will run about 80 performances over the summer. I was concerned about someone in the audience connecting and stopping the advertising which would be a show-stopper (literally). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2019-04-04 by billsalt
Hi @gfwilliams,
I'm using the espruino_2v01.10_nrf52832.hex load of firmware on a Nordic Dev board. I'm trying to turn off connectability, but keep advertising (this is a beacon application). Looking at https://www.espruino.com/BLE+Security and am using
in my code. The device then stops advertising completely (I'm sniffing with nRFConnect to verify).
Is there something I'm missing?
Thanks,
Bill
Beta Was this translation helpful? Give feedback.
All reactions