Which is the best way of sending the data read from a sensor?

Hi,

I need to read the data from an acceleration sensor. I tried with a custom program of mine to simulate some data, but it is delaying too much.

I tried reducing the notification interval, but sometimes it just jumps numbers so to say, it should show 1,2,3. But now it shows 1,3,5.

Am I missing something?

Thank you!

Parents
  • Hello,

    I need to read the data from an acceleration sensor. I tried with a custom program of mine to simulate some data, but it is delaying too much.

    Could you elaborate on what you are doing here, and which delay you are referring to here?
    Are you reading out the sensor data over I2C for instance, and then sending it over BLE, where the mentioned delay applies to the BLE communication?


    If you are just starting out with the nRF Connect SDK then I highly recommend taking a look through the nRF Connect SDK Fundemental course to quickly familiarize with the SDK! :) 


    Best regards,
    Karl

  • Hi Karl, 

    I am still not reading any sensor, for now it is just dummy values, and supposedly they should be increasing in 1 unit each time the loop comes. But sometimes it is being increased in more than one unit. 
    I think maybe sending each time the sensor is being "read" is not the best. Is it possible to send maybe an array? Or which is the best way to send the most amount of the "read" sensor?

    Thank you!

  • Hello Adrian.

    Thank you for clarifying - I am glad to hear that you are having progress on the throughput!

    The next step in figuring out where the bottleneck in the communication is would be to gather a sniffer trace, so that we can verify that the application always have data ready to send, and whether there is anything hampering the data from being sent.
    It could for instance here be that the application is not supplying the data fast enough due to other tasks taking time away from the data generation.
    Have you had a look at my suggestion for sniffer in my previous comment?

    Best regards,
    Karl

  • Hello Karl,

    Sorry for the late response. I have been trying to install it, but I ran into this problem:
    "The term 'nrf_sniffer_ble.bat' is not recognized as
    the name of a cmdlet, function, script file, or operable program."

    I have already checked and I have python installed. Do you know what is the problem?

  • Hello again, Adrian

    Thank you for your patience with this - I have been out of office due to the public easter holiday last week, but now I am back.

    Please make sure that you have followed all the steps in the Installing the sniffer guide - especially the part on Installing the sniffer capture tool. Please do this, and let me know if the issue persists!

    Best regards,
    Karl

  • Hi Karl,

    I am really sorry for the delay. I had to focus also on the reading of the sensor, the app for displaying the data and got stuck for a really long time. Now I had the chance to return and have a look at this issue again. 

    I see that now I am obtaining again .02 MB/s. I tried making 2 different threads, one that reads the values from the sensor ands stacks them in an array, and other one that sends the data. It is also not working.

    Having a look at the sniffer tool that you mentioned, I receive some things which I don't know if it is helpful to know, or how to interpret them. I see for example, that the updates in parameters to 2M and data length are being made. 

    But when I subscribe to the notifications, I see that the master is also taking quite some time to send something and it is empty, is this normal?

    Also, I don't see any warnings or errors.

    I attach some screenshots of the wireshark. If there is a better way to share the logs, please let me know.

    This first image is before any connection event

    This second image is when the connection happened

    This third image is before I subscribe

    This fourth image is during the subscription

    If there is any other information that might be useful, please let me know.

    Best regards, 

    Adrian Lopez

  • Now I figured out what to send, an apology.
    sniffer1.zip

    Best regards,

    Adrian Lopez

Reply Children
No Data
Related