Racechrono BLE with iPhone

Hi,

i am struggling with my DIY Module with BLE and the connection with an iPhone (Android works well).

On the Iphone i dont see my device but with the App "Light Blue" i am able to connect to my Module and i see it in the Bluetooth settings of my iPhone.

Next step is to setup Racechrono and add the Module but if i want to add this module as DIY Device the device is not shown.

Is this a known problem?

Comments

  • edited May 2022
    @R1Snake The DIY BLE device needs to advertise the BLE Service in a certain way for the device to show up at the search. I don't know much details, but I think it needs to advertise the 16-bit UUID for the service, which would be 0x1FF8.

    You can test it out by configuring one of these apps as a server on a second device, and advertising this service. RaceChrono should be able to find it when properly advertising.
  • I tested your comment and with your code i am not able to find my device in the iPhone settings. Is this normal or have i use "Light Blue", and pair then in RaceChrono?

    Here is my code:

    #define RCSERVICE_UUID (uint16_t) 0x1ff8
    #define CANBUSMAINCHARACTERISTIC (uint16_t)0x01
    #define CANBUSFILTERCHARACTERISTIC (uint16_t)0x02
    #define GPSMAINCHARACTERISTIC (uint16_t)0x03
    #define GPSTIMECHARACTERISTIC (uint16_t)0x04
    #define RCCONFIGCHARACTERISTIC (uint16_t)0x05
    #define RCVALUECHARACTERISTIC (uint16_t)0x06

    NimBLEDevice::init(ble_device_id);
    /** Optional: set the transmit power, default is 3db */
    //NimBLEDevice::setPower(ESP_PWR_LVL_P9); /** +9db */
    //NimBLEDevice::setPower(ESP_PWR_LVL_P9, ESP_BLE_PWR_TYPE_ADV); /** +9db */
    //NimBLEDevice::setPower(ESP_PWR_LVL_P9, ESP_BLE_PWR_TYPE_CONN_HDL0); /** +9db */
    //NimBLEDevice::setPower(ESP_PWR_LVL_P9, ESP_BLE_PWR_TYPE_CONN_HDL1); /** +9db */
    //NimBLEDevice::setPower(ESP_PWR_LVL_P9, ESP_BLE_PWR_TYPE_CONN_HDL2); /** +9db */
    log_i("BT 1");
    //NimBLEDevice::setMTU(BLE_MTU);
    //ble_mtu = NimBLEDevice::getMTU();
    log_i("BT 2");
    log_d("BLE MTU set to: %d", ble_mtu);
    NimBLEDevice::setSecurityIOCap(BLE_HS_IO_NO_INPUT_OUTPUT);
    //NimBLEDevice::setSecurityAuth(BLE_SM_PAIR_AUTHREQ_SC);

    // Create BLE Server
    pServer = NimBLEDevice::createServer();
    pServer->setCallbacks(new MyServerCallbacks(this));

    NimBLEService *pServiceRC = pServer->createService(RCSERVICE_UUID);

    gpsMainCharacteristic = pServiceRC->createCharacteristic(GPSMAINCHARACTERISTIC, NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::NOTIFY);
    gpsTimeCharacteristic = pServiceRC->createCharacteristic(GPSTIMECHARACTERISTIC, NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::NOTIFY);

    canBusMainCharacteristic = pServiceRC->createCharacteristic(CANBUSMAINCHARACTERISTIC, NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::NOTIFY);
    canBusfilterCharacteristic = pServiceRC->createCharacteristic(CANBUSFILTERCHARACTERISTIC, NIMBLE_PROPERTY::WRITE);

    RCConfigCharacteristic = pServiceRC->createCharacteristic(RCCONFIGCHARACTERISTIC, NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::WRITE | NIMBLE_PROPERTY::INDICATE);
    RCValueCharacteristic = pServiceRC->createCharacteristic(RCVALUECHARACTERISTIC, NIMBLE_PROPERTY::WRITE_NR);

    RCConfigCharacteristic->setCallbacks(new RCConfigCallbacks(this));
    RCValueCharacteristic->setCallbacks(new RCValueCallbacks(this));

    pServiceRC->start();

    NimBLEAdvertising *pAdvertising = NimBLEDevice::getAdvertising();
    pAdvertising->addServiceUUID(pServiceRC->getUUID());
    //pAdvertising->setAppearance(5186);
    //pAdvertising->setMinPreferred(0x06);
    pAdvertising->setName(ble_device_id);
    pAdvertising->setMinInterval(160);
    pAdvertising->setMaxInterval(160);
    pAdvertising->setScanResponse(true);
    pAdvertising->start();
  • I think it's normal if you don't see the device in iPhone settings, as long as you see it in RaceChrono. I cannot comment your code unfortunately, I'd need to study and run it to do that.
Sign In or Register to comment.