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

Best way to send data from many sensors

Hi,

For an application I have a nRF51 at my disposal and I need to transfer about 3'000Bytes. I found in the documentation that the nRF51 can use the S130 SoftDevice which support BLE 4.2. The data I have to transfer come from 1 to 50 sensors and are divided in 2 categories with 3 respective 6 parameters each as follow:

Sensor No1

  • Data type A
  • --Parameter A1
  • --Parameter A2
  • --Parameter A3
  • Data type B
  • --Parameter B1
  • --Parameter B2
  • --Parameter B3
  • --Parameter B4
  • --Parameter B5
  • --Parameter B6

Sensor No2

  • Data type A
  • --Parameter A1
  • --Parameter A2
  • --Parameter A3
  • Data type B
  • --Parameter B1
  • --Parameter B2
  • --Parameter B3
  • --Parameter B4
  • --Parameter B5
  • --Parameter B6

Sensor NoX

  • Data type A
  • --Parameter A1
  • --Parameter A2
  • --Parameter A3
  • Data type B
  • --Parameter B1
  • --Parameter B2
  • --Parameter B3
  • --Parameter B4
  • --Parameter B5
  • --Parameter B6

I thought that a way to transfer these results would be to use 2 customized services (a service for type A and a service for type B) with 3 respective 6 characteristics (A1-A3 and B1-B6) each. Each characteristic should have up to 50 values. The number of values in each characteristic would indicate the number of sensors.

Has someone a better / a more suitable solution for this use case?

Thanks in advance for you ideas.

Parents
  • (oh no:)

    I would never flood (G)ATT stack with dozens of handles when the only thing you need to do is transport some data. Simply define single service with single characteristic and define structured protocol on top of that which will clearly identify what sensor data you are currently transporting. Yes, you will have some formatting overhead but unless you don't pair these two devices only once and perform typically "hanging" connection without disconnecting/reconnecting after every transfer you don't want to deal with (G)ATT overhead when having large number of objects on the stack to enumerate, enable etc.

    Simply define some reasonable (ASN.1 BER-TLV?:) structure where you say by TAG values what type of data are going through the pipe and it should be easy to format it on one side and decode on the other.

Reply
  • (oh no:)

    I would never flood (G)ATT stack with dozens of handles when the only thing you need to do is transport some data. Simply define single service with single characteristic and define structured protocol on top of that which will clearly identify what sensor data you are currently transporting. Yes, you will have some formatting overhead but unless you don't pair these two devices only once and perform typically "hanging" connection without disconnecting/reconnecting after every transfer you don't want to deal with (G)ATT overhead when having large number of objects on the stack to enumerate, enable etc.

    Simply define some reasonable (ASN.1 BER-TLV?:) structure where you say by TAG values what type of data are going through the pipe and it should be easy to format it on one side and decode on the other.

Children
No Data
Related