This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Testing of Current time service

Hi,

I am unable to test current time service example.I followed all the steps mentioned to test CTS Example.But, below are the log messages:

Again if I try to reset and try to connect to the device.The log messages are as below:

Please suggest me to rectify the errors and also the right way to test CTS example with 1SDK and mobile application.

Thanks & Regards,

Swathi P.

Parents
  • Hello Swathi P,

    Did you follow the Setup and Testing section of the CTS Example Documentation?
    From your error logs, it seems that the Current Time Service is not found on the central device, which causes the peripheral to auto-disconnect.
    You need to make sure that the central is providing this service.
    Which smartphone application and OS are you using?
    If you are using the nRF Connect application, you will need to configure your GATT server to include the Current Time Service, with the Current Time characteristic. The initial value of the characteristic should be C2 07 0B 0F 0D 25 2A 06 FE 08, as detailed in the CTS Example documentation referenced above.

    Please let me know if this resolves your issue,

    Best regards,
    Karl

  • Hi,

    Thank you for the reply.

    In example provided it has already advertising current time service,I think this means central is provided with service.

    I am using Oppo A71,it is android.

    I have configured Server on the mobile.

    To write the initial value the service is not getting discovered.

    Can you also please let me know,what content the initial value of characteristic "C2 07 0B 0F 0D 25 2A 06 FE 08" is holding?

    Thanks & Regards,

    Swathi P

     

  • Hello Swanthi P,

    swathi p said:
    Thank you for the reply.

     No problem at all, I am happy to help!

    swathi p said:
    In example provided it has already advertising current time service,I think this means central is provided with service.

    What do you mean by this? The unmodified example will query the central for the current time, using the centrals current time service - you will have to ensure that the central you connect to has this service.

    swathi p said:

    I am using Oppo A71,it is android.

    I have configured Server on the mobile.

    To write the initial value the service is not getting discovered.

    If you are building your own BLE central application for the smartphone, then you will need to configure the server to include the CTS service.
    I do not personally have experience with developing Android applications, but you may find this github repository useful to have a look at.

    swathi p said:
    Can you also please let me know,what content the initial value of characteristic "C2 07 0B 0F 0D 25 2A 06 FE 08" is holding?

    You may see the description for the contents of all standard characteristics in the GATT Specification Supplement. Section 3.45 covers CTS and its contents.
    The value of the initial value for the CTS example from the SDK is as written in the example documentation:
    Saturday the 15th of November 1986, 13:37:42, adjusted for daylight savings time.

    Best regards,
    Karl

Reply
  • Hello Swanthi P,

    swathi p said:
    Thank you for the reply.

     No problem at all, I am happy to help!

    swathi p said:
    In example provided it has already advertising current time service,I think this means central is provided with service.

    What do you mean by this? The unmodified example will query the central for the current time, using the centrals current time service - you will have to ensure that the central you connect to has this service.

    swathi p said:

    I am using Oppo A71,it is android.

    I have configured Server on the mobile.

    To write the initial value the service is not getting discovered.

    If you are building your own BLE central application for the smartphone, then you will need to configure the server to include the CTS service.
    I do not personally have experience with developing Android applications, but you may find this github repository useful to have a look at.

    swathi p said:
    Can you also please let me know,what content the initial value of characteristic "C2 07 0B 0F 0D 25 2A 06 FE 08" is holding?

    You may see the description for the contents of all standard characteristics in the GATT Specification Supplement. Section 3.45 covers CTS and its contents.
    The value of the initial value for the CTS example from the SDK is as written in the example documentation:
    Saturday the 15th of November 1986, 13:37:42, adjusted for daylight savings time.

    Best regards,
    Karl

Children
  • Hi,

    What do you mean by this? The unmodified example will query the central for the current time, using the centrals current time service - you will have to ensure that the central you connect to has this service.

    What I did was just opened cts example from the folder  and configured gatt from .ncs file on the mobile side and started testing next step then I could see  that the BSP_INDICATE_CONNECTED state is indicated.I am unable to continue the next steps due to previously mentions erorrs.Do I need to modify the example.Then please let me know what modifications I have to do?And here central is nRF Chip,Am I right?

    Thanks & Regards,

    Swathi P

  • Hello Swathi P.

    swathi p said:
    And here central is nRF Chip,Am I right?

    No, the device that is programmed with the CTS peripheral example is the peripheral, and it will query the central device(your smartphone) for the date and time.

    swathi p said:
    I am unable to continue the next steps due to previously mentions erorrs.

    This is because your smartphone application(central) is not configured to provide the Current Time Service.
    To see this example working I would suggest downloading the nRF Connect smartphone application - just to verify that the example is working as intended on your device.

    So, if you download the nRF Connect smartphone application and go into the "Configure GATT Server" menu, then you should add the Current Time Service, and give it a Current Time characteristic - in which you input the initial value as specified in the CTS example documentation.

    Then, you connect to your nRF device running the CTS example(while having the nRF device connected to a serial monitor), and then you press button 1 to have it read out the CTS value to your serial terminal.

    After having verified this, I would go back to your custom smartphone application.
    Then you will need to setup the service in your custom application just as you configured the GATT server in the nRF Connect smartphone application.

    Best regards,
    Karl

  • So, if you download the nRF Connect smartphone application and go into the "Configure GATT Server" menu, then you should add the Current Time Service, and give it a Current Time characteristic - in which you input the initial value as specified in the CTS example documentation.

    I understood by the CTS Document  that I should set initial value after step3. 

    • After the security procedure is complete, verify that the Current Time Service on the server has been discovered. The message "Current Time Service discovered on server." will be printed on the UART.
    • On the connecting device, set the values of the Current Time characteristic (UUID 0x2A2B) to 'C2 07 0B 0F 0D 25 2A 06 FE 08' and click 'Write'.

    I have already configured gatt server on my mobile.Do I need to give on to the characteristic value before connection i.e while creating gatt server itself?

    Thanks & Regards,

    Swathi P

  • Hello again,

    swathi p said:
    I have already configured gatt server on my mobile.

    That is good to hear.
    Have you tested your implementation against the device running the CTS example?
    Could you provide the log of the serial output by the device, when you connect it to your application(like you did when you submitted the ticket?).
    The important part would be that the message "Current time service discovered on server" is printed on the UART - that would mean you have configured the GATT server to have the CTS service correstly.

    swathi p said:
    Do I need to give on to the characteristic value before connection i.e while creating gatt server itself?

    I do not understand you question. You will also need to give the Current Time Service a Current Time characteristic, if the device is to query for the current time.

    Best regards,
    Karl

  • Hi,

    Have you tested your implementation against the device running the CTS example?
    Could you provide the log of the serial output by the device, when you connect it to your application(like you did when you submitted the ticket?).
    The important part would be that the message "Current time service discovered on server" is printed on the UART - that would mean you have configured the GATT server to have the CTS service correstly.

    Below is the log capture:

    if you download the nRF Connect smartphone application and go into the "Configure GATT Server" menu, then you should add the Current Time Service, and give it a Current Time characteristic - in which you input the initial value as specified in the CTS example documentation.

    I didn't understand that whether we have to give initial value after discovering Service or we have to give while configuring server like while setting properties and giving value.According to the CTS Document we have to write initial value after discovering service.

    Please let me know what does the error in the log exactly mean?

    Thanks & Regards,

    Swathi P

Related