Skip to main content
Visitor II
August 24, 2020
Solved

pb with code pin BLE for windows 10 connexion

  • August 24, 2020
  • 5 replies
  • 3216 views

since last mounth, i cannot connect anymore to my sensor (TILE.BOX) by ble with windows 10 because the code are automaticaly generated. I suspect last update

windows don't let me write the std code (123456). So did you know the issue? do you have contermesure? Without BLE, i cannot use Unicleo gui from laptop.

Thanks for your help

    This topic has been closed for replies.
    Best answer by niccolò

    I'm using allmems2 V2.1.0 as an example (many fw are similar in that section, because they all links to the same app), but here are specific instructions:

    • in main.c, around line 2010 you should add a aci_gap_set_io_capability(IO_CAP_DISPLAY_ONLY), see the code below
     if(ret){
     ALLMEMS2_PRINTF("\r\naci_gatt_update_char_value failed\r\n");
     while(1);
     }
     
    ////////////////////// BEGINNING OF CODE TO ADD //////////////////////////
     aci_gap_set_io_capability(IO_CAP_DISPLAY_ONLY);
     ////////////////// END OF CODE TO ADD ////////////////////////
     
     ret = aci_gap_set_authentication_requirement(BONDING,
     MITM_PROTECTION_REQUIRED,
     SC_IS_SUPPORTED,
     KEYPRESS_IS_NOT_SUPPORTED,
     7, 
     16,
     DONOT_USE_FIXED_PIN_FOR_PAIRING,
     123456,
     0x00);
    • in sensor_service.c you should add the aci_gap_pass_key_req_event , so at the end of the file just add
    void aci_gap_pass_key_req_event(uint16_t Connection_Handle)
    {
     status = aci_gap_pass_key_resp(CurrentConnHandle, 123456)
    }

    If you have any more problem coding, please, tell me which errors warning you encounter

    5 replies

    ST Employee
    August 25, 2020

    Hi @david binkowski​ ,

    I think that the problem is due to some windows update, On my PC the pin has to be typed as before (Windows10 Version 10.0.17763 build 17763).

    I can give you some pointers to the Microsoft support page for Bluetooth ( https://support.microsoft.com/en-us/help/14169/windows-10-fix-bluetooth-problems ), or you can try to use the older interface, instead of the newer Windows 10 Bluetooth pairing interface. (open the Control Panel, then Devices and Printers -> Click Add A Device at the upper left, then follow the pairing process).

    Can I ask you How did you use the SensorTile.box with BT and Unicleo? I mean, which fw do you use and how do you connect it to the software?

    Visitor II
    August 25, 2020

    Hi @niccolo.ruffini​ 

    Thanks for your help

    I have always try with old interface but this is the same way, windows generate a code instead of ask me to write the mine...

    The use of unicleo.gui is very simple when the connection are etablisheed ;) . You need to pairing TILE.BOX with windows and open unicleo. if you have activated the BLE fonction in option menu, normaly unicleo detect automaticaly the sensor (with BLE adress in select device). It work with Fonction Pack allmems2,etc...

    ST Employee
    August 26, 2020

    Hi @david binkowski​ ,

    I looked into the problem and I found that the allmems2 function pack (like others) are supposed to be paired only with the ST BLE Sensor App. For this reason, the Function pack was not coded to be paired with windows, and because of a check for I/O capabilities (probably introduced with the latest update, but I'm not sure), the pairing procedure cannot be completed.

    To fix this, the firmware should be modified to adapt to the request:

    you should set the I/O capabilities with aci_gap_set_io_capability(IO_CAP_DISPLAY_ONLY) before setting the autentication requirement, and add the call back to aci_gap_pass_key_req_event in case the request arrives, with a aci_gap_pass_key_resp(CurrentConnHandle, 123456).

    This should fix the pairing problem.

    Let me know if this fixes your problem.

    Visitor II
    August 28, 2020

    Hi @niccolo.ruffini​ 

    Please could you be more accuracy for the firmware modification, my knowledge about prog with STM32CubeIDE are limited. by exemple the name of the files that i need to modify.

    Thanks

    Visitor II
    September 22, 2020

    Thanks for your reply i try asap the solution (not the time yet) and come back to you if needed

    Visitor II
    October 9, 2020

    Hi Niccolo,

    I encountered couple of error

    first 0693W000004JFfTQAW.jpg

    and second when i try to change CurrentConnHandle to Connection_Handle

    0693W000004JFnlQAG.jpg

    I suppose that i need to declare some variables. I precise that i use the same FW version like you ALLMEMS2 V210

    Thanks for you help

    Regards

    ST Employee
    October 9, 2020

    Hi @david binkowski​ ,

    status is a variable that is there for debugging purposes, you can either

    • get rid of it, so that the function becomes:
    void aci_gap_pass_key_req_event(uint16_t Connection_Handle)
    {
     aci_gap_pass_key_resp(Connection_Handle, 123456);
    }
    • or declare status as a uint8_t the line before, so it becomes:
    void aci_gap_pass_key_req_event(uint16_t Connection_Handle)
    {
     uint8_t status;
     status = aci_gap_pass_key_resp(Connection_Handle, 123456);
    }

    in the latter option, you have a variable that can be checked during debug, but in the end it should not be a problem for you.

    Let me now if this solves your problem.

    Visitor II
    May 12, 2021

    Hi Niccolo

    Sorry for the late answer. I confirm that the solution solve my issue. I can connect with my laptop.

    Windows ask me to write the pairing code as usual. 123456 work well!

    Many thanks for your support

    Best regards