-
Notifications
You must be signed in to change notification settings - Fork 7.6k
feature(BluetoothSerial): add pinCode function #2765
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
Conversation
esp_bt_gap_set_pin(pin_type, 4, pin_code); | ||
return true; | ||
} | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the limit 4 chars?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#define ESP_BT_PIN_CODE_LEN 16 /*!< Max pin code length */
typedef uint8_t esp_bt_pin_code_t[ESP_BT_PIN_CODE_LEN]; /*!< Pin Code (upto 128 bits) MSB is 0 */
What is the reason for the limitaton?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@me-no-dev
Sorry for the late reply, I will modify the code, rebase and submit again.
@xiongyumail will you address my question? |
Hi @me-no-dev do you plan to add a select menu in ide to choose which bt lib need to be used (with or without pairing)? Or pairing enabled lib will become the new default and only choice ? |
Hi Luc :) I need to check this out. I really do not like to provide two libs and an IDE option, because that option will then need to be propagated to all other boards. And they are quite a few now :D |
Hi, I have no issue to have pair enabled lib as default ^_^. I am just curious and want to anticipated big change. |
this option does not exist on the 3.2 branch... i'll leave this here in case it pops out |
latest example_spp_initiator_demo.c shows how to provide default pin codes for 16 and 4 length when challenged in Master mode. I would upload bigger work to allow Pins, SSP and most important Master mode connection in BluetoothSerial[.h|.cpp]. Maybe a better option is to wait a little bit. As this small change would be incorporated in upcoming changes in https://github.com/IonicEV/arduino-esp32/tree/master/libraries/BluetoothSerial/src , although it looks like the progress is very slow with pull requests. There is another issue with when you call this method. You really want to set pin code before you started to accept connections in case of slave, but you can not because of this code would only work after BT stack is initialized with begin(), the default pin_code is not really the answer as you blocking others who are not using any pins. |
@me-no-dev I saw 4.0 idf is released, does it will be integrated in next coming update ? Is this will allow pin integration? |
@luc-github IDF v4 is only a beta and has breaking changes to v3.x. it will be a while before it is integrated. |
I just pushed the initial code changes (20190916 - initial: support for Master mode, Pin and SSP) to the: https://github.com/IonicEV/arduino-esp32/tree/master/libraries/BluetoothSerial/src |
@atanisoft thank you. So future update to be able to have bt pairing should be more the 3.3 right ? |
If that functionality is in IDF v3.3 yes, if not no... |
I took the sources from Heltec-esp8266 which just a copy of this repo it seems. I did not need to recompile/rebuild anything. It is possible you are referring to slave mode pin handling (when it is your ESP32) that request remove master to provide the pin for security. For Master mode - pins worked out of the box without any changes (preset or when challenged for a pin by remote), the discussion about pins are dated Nov 30, 2018 on other forums, so it is being around for quite some time. |
Not sure why Master mode did not receive any attention. ESP32 is way better gear vs. ESP8266 + HC05 "dongle", but by some irony nobody bothered to "show the way" with Master mode, despite the fact all the support was there. I think Master mode would push ESP32 over the top. I saw many folks are struggling with this all over the forums, pretty sure many just gave up on ESP32 BT Master option. |
With which ESP-IDF version this solution will work? I've made this changes at my ESP-IDF V3.3 installation and had no success with PIN. There are no compiling errors, but still no PIN on pairing. |
hello is there any option to use static pin for classic bluetooth pairing?I'm using eps32-arduinio core 1.0.5.The disable ssp is working only in 1.0.1 version.Thanks in advance |
Hello, a lot of people also me, we are trying to find an option to set static PIN on Bluetooth classic serial connection when pairing. A way to input custom PIN not the default 123456.An old way was created for 1.0.1 version adding a custom libbt.a file that was disabling ssp as far as i know .We want to be able to have this option on newer versions. I'll appreciate anyone who really want to help |
Bump |
|
Bump... Still looking for the option to set a custom pin code. It would save a lot of headaches! |
Agreed. Still not got a simple solution.
…On Wed, 19 May 2021, 21:28 muellerryan, ***@***.***> wrote:
Bump... Still looking for the option to set a custom pin code. It would
save a lot of headaches!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2765 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABFNDZYDWFA7X3KP5SJ7MK3TOQNO5ANCNFSM4HL7XQAQ>
.
|
Any news?,Fixed PIN for Classic BT on 1.0.6 version? Can someone compile libbt.a library with the proper settings to make it finaly worked???? |
Closing this PR because it is outdated - suggested functionality was implemented in different PR and is already merged. |
@me-no-dev
Hi,
This change enables Bluetooth Serial to use password pairing.
libbt.a requires you to recompile the build library to support simple pairing.
kconfig: // SSP (Secure Simple Pairing ) disable