I ran the example code for BT SPP from esp-idfv4.0 example code ? i just want to know how do i set the STATIC PIN for pairing BT ?
In the code it generate random pairing key.
Thanks
in advance
How to set STATIC pairing PIN in bt_spp_vfs_acceptor ?
Re: How to set STATIC pairing PIN in bt_spp_vfs_acceptor ?
To disconnect from the paired Bluetooth device, press and hold the Power/pairing button on your speaker for one prepaid gift balance.
Re: How to set STATIC pairing PIN in bt_spp_vfs_acceptor ?
https://github.com/espressif/esp-idf/bl ... #L102-L108
You have also change option in menuconfig, disable Secure simple pairing (or enable).
You have also change option in menuconfig, disable Secure simple pairing (or enable).
Re: How to set STATIC pairing PIN in bt_spp_vfs_acceptor ?
Secure simple pairing (disabling this throws error for esp_bt_gap_set_pin )chegewara wrote: ↑Wed May 20, 2020 12:29 pmhttps://github.com/espressif/esp-idf/bl ... #L102-L108
You have also change option in menuconfig, disable Secure simple pairing (or enable).
i added the code from link as below,
is it right ?
Code: Select all
case ESP_SPP_INIT_EVT:
ESP_LOGI(SPP_TAG, "ESP_SPP_INIT_EVT");
esp_bt_dev_set_device_name("bt_server");
esp_bt_pin_type_t pin_type = ESP_BT_PIN_TYPE_FIXED;
esp_bt_pin_code_t pin_code;
pin_code[0] = '0';
pin_code[1] = '0';
pin_code[2] = '0';
pin_code[3] = '0';
esp_bt_gap_set_pin(pin_type, 4, pin_code);
esp_bt_gap_set_scan_mode(ESP_BT_CONNECTABLE, ESP_BT_GENERAL_DISCOVERABLE);
esp_spp_start_srv(sec_mask,role_slave, 0, SPP_SERVER_NAME);
break;
Re: How to set STATIC pairing PIN in bt_spp_vfs_acceptor ?
I have bt classic project i finished 2 days ago and now checked to make sure. You have to disable
https://github.com/espressif/esp-idf/is ... -443575348
to make use of static pin code.Secure simple pairing
https://github.com/espressif/esp-idf/is ... -443575348
Re: How to set STATIC pairing PIN in bt_spp_vfs_acceptor ?
Thanks that solved it, i had to manual insert following code, i was getting error on compilations,chegewara wrote: ↑Thu May 21, 2020 9:03 amI have bt classic project i finished 2 days ago and now checked to make sure. You have to disableto make use of static pin code.Secure simple pairing
https://github.com/espressif/esp-idf/is ... -443575348
Code: Select all
#define CONFIG_CLASSIC_BT_ENABLED 1
#define CONFIG_BT_SPP_ENABLED 1
Thanks @chegewara you always provide right and accurate information.
Keep doing best work. Take care
Re: How to set STATIC pairing PIN in bt_spp_vfs_acceptor ?
Thats strange, because those flags are already there:ht_main1 wrote: ↑Sat May 23, 2020 6:22 pm
Thanks that solved it, i had to manual insert following code, i was getting error on compilations,i found from this comment https://github.com/platformio/platform ... -475671300Code: Select all
#define CONFIG_CLASSIC_BT_ENABLED 1 #define CONFIG_BT_SPP_ENABLED 1
https://github.com/espressif/esp-idf/bl ... g.defaults
Maybe try to use idf.py defconfig.
Thanksht_main1 wrote: Thanks @chegewara you always provide right and accurate information.
Keep doing best work. Take care
-
- Posts: 1
- Joined: Fri Apr 09, 2021 11:25 am
Re: How to set STATIC pairing PIN in bt_spp_vfs_acceptor ?
I'm not sure about setting a static pin, but as far as discover-ability timeout, you would edit /etc/bluetooth/main.conf and set DiscoverableTimeout = 0 and you might also want to change PairableTimeout = 0.Bushi1e wrote: ↑Wed May 20, 2020 10:52 amTo disconnect from the paired Bluetooth device, press and hold the Power/pairing button on your speaker for one Prepaid Gift Balance
.
Who is online
Users browsing this forum: Bing [Bot] and 91 guests