Bluetooth Device Stops Advertising After Pairing Failures in Zephyr RTOS
Hello everyone,
I have a situation
where the device tries to auto connect and then stops advertising.
the functionality is of HoG Mouse sample with a few changes
mainly changing to
bt_le_adv_start(BT_LE_ADV_CONN, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd));
my proj.conf is
22 Replies
If you need any further information to assist me, please feel free to ask!
Hey @32bitSaviour and I are doing a BLE live stream in another 30 mins if you want to join
That's nice
i reaally wanted to join but currently at work
Maybe add the link, and ill hop in during break session
Once you are free, Could you help with the above, stumbled for quite some time...
this link is on #projects-and-self-promotion 🙂 welcome, come to the stream and ask your questions. some of the basics that are explained may help this get clear
Sure
That sound perfect!
Need some way to flash the NVS at once...
@melta101 since you have settings enabled in your
prj.conf
do you make sure to call settings_load()
?yes,
Its called in bt_ready()
Major prob is even after reflashing for the particular module, it gives the same error,
meaning, i would need to 1st erase all the stuffs in settings, and then try
as per my understanding
You need to call it after the
bt_enable()
API call so if you have a bt_ready
callback you can do it inside there in case of success.it is written in this way,
if it fails,
i get a notifs
logs suggest, i got it initialized,
starts advertising,
then proceed to automatically try connecting to the address
And at that point you call settings_load? You can also error check it to make sure it loads successfully.
i have also faced this another set of problem
i sometimes, want my peripherals to to connect without password
what i do normally is not call the bt_conn_auth_cb struct
such as passkey display or entry
trying to do this,
i sometimes get it to work,(passwordless connection)
other times,
it doesnt (security change error)
what is the ideal way to get the passwordless connection to work
You can set empty callbacks in the struct and passkey_entry to NULL. That will ensure your BLE connection uses the Just Works pairing method.
tried that and got this
You are on the right path you can refer here to find out what your error codes mean https://github.com/zephyrproject-rtos/zephyr/blob/ad70ff7b9d5dbd342f53e4abd7f5cb13bf8c111d/include/zephyr/bluetooth/hci_types.h#L3220
GitHub
zephyr/include/zephyr/bluetooth/hci_types.h at ad70ff7b9d5dbd342f53...
Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures. - zephyrproject-rtos/zephyr
Sorry for the delay in reply,
Just reached back
Yea, for error code 4,
It means auth requirement mismatch
From what I see,
Seems like a smart phone cannot connect with level 1 security