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

How to setup data / data layout for transmitting time series?

Hello All,

my application should record acceleration data and time stamps.

After recording the data block from start to end should be transmitted.

I only know that BLE transmits the as is (current) data.

How can I request a timestamped data?

How to efficiently transmit the data without application specific acknowledge after each data set?

I think this topic is addressed by weather station or activity monitor apps.

But I can't find how.

Thanks for any hints.

Adib.

--

  • Hi Adib

    Are you using a mobile phone on the central side?

    If so you can set up the phone to host the BLE Current Time Service (CTS), and use it to provide accurate time information to the connected BLE peripheral. Then you need to keep track of time locally on the nRF52 side by running the RTC timer, and keeping track of how many seconds has passed since the last time the phone sent the current time information. 

    In order to keep somewhat accurate time on the nRF52 in between phone sync you should consider using an external LF crystal. This is not needed for most Bluetooth applications, but makes a difference if you need to keep track of time over days or more. 

    Once you have a relatively accurate clock running locally you can embed a timestamp to your sensor data and send it back to the phone. 

    Best regards
    Torbjørn

  • Hello Torbjorn,

    I do not have problems on having valid timestamp.

    But my data are organized as timeseries.

    And I only know BLE data are as is organized.

    i.e. the temperature,

    I only reuest that ID from temperature and I get temperature.

    But how do I get the temperature from a specific timestamp?

    Regards, adib.

  • Hi Adib

    If I understand you correctly you want to request the temperature recorded at a specific point in time, and the nRF52 device will store multiple temperature readings in memory taken at different times?

    This is not supported by the standard temperature service, so you will need to implement something proprietary. 

    For instance you can add an additional characteristic that allows you to tell the nRF52 device what point in time you are interested. Then you can change the code in the nRF52 to update the temperature characteristic with the temperature recorded at that time, allowing you to read it back on the central side. 

    Best regards
    Torbjørn

  • Hi Torbjorn,

    Yes you are correct.

    After the device finished with measurement I need all values of that timeseries.

    I think that is not new. bcs activity tracker and weather stations should support time series.

    But I did not understand how they do this using BLE GATT dictionary.

    Regards, Adib.

  • Hi Adib

    Normally the activity tracker would store all the updates in a database as they are received from the sensor device, so that you can check the data locally without having to inquire the sensor. 

    The sensors typically have limited memory and won't be able to store old data for a long time. 

    To transfer a log of information over time I am pretty sure the activity tracker and weather station apps will use a proprietary service of their own design. 

    To check the features available in the standard services you can download the service specifications here:
    https://www.bluetooth.com/specifications/gatt/services/

    Best regards
    Torbjørn

Related