Creat and send a file over BLE

Hi,

I use NCS 2.4.2 and i want to save data sensor with a hight frequency in a nrf5340 device and send it over BLE to a nrf52840 dongle device. The nrf5340 is the peripheral.
The sensor data are at a ver hight frequency (more than 400Hz), that's why i need to save it in a file and send it by block.

I need help to find the right solution to perform this. I saw Throughput Service, Objet transfer service, NUS but i can't figure out what is the best solution.

I use coded phy also.

Regards,

Pierre-Yves

Parents
  • Hi Pierre-Yves,

    To efficiently send the data, I'd suggest keeping it in a RAM buffer until it is sent. I'm not sure how many bytes each measurement is, but the more you can fit into each notification packet, the better.

    I use coded phy also.

    This will greatly reduce the theoretical throughput of the connection. If possible, it would be better to increase the TX power using an external PA/LNA such as the nRF21540 and stay on 1M.

    Best regards,

    Vidar

  • Do you have example of this ? and what services do i need to use ?

    each mesurement is composed of 3 float for the 3 axes and i also need to have the time in milisecond hour per hour, it's a long uint i think. Then one mesurement should be around 20 bytes each 1ms or each 2ms .


    I use already a nrf21540 and i need to use phy coded because  i need long rang connexion

    I tried to use throughput but with the sample central and peripheral when i config in coded_s8 it's really too slow instead of when i use ble nus

    Regards,

    Pierre-Yves

  • Hi,
    Sry i was not able to test before, that's why i don't answer before.
    I succed to use ots service and use multiple object to send data in large packets.

    I don't know haw to handle the backups, do have any idea ?

    I have a dongle ble that is used as a central device. I use the bluetooth shell sample on it. The device is plug on a rasberry. I create a software that connect to my dongle nrf52840 that extract all output from my dongle. on the other hand my peripheral send many datas. I print them on my dongle with some commands and it ake the output and put it in a file. I have rally too many data, that's why i asked if it was possible to have a thread that take only the data from the acc and put it directely on a file in my pc ?
    Because i don't want to print them if possible

  • Hi,

    The simplest solution is likely just to parse the accelerometer data from your log output and then store that data in a file or a database. You didn't mention which programming language you used to create your program on the Pi.

  • i use C to programme it.
    Indeed the easiest is to parse the accelerometer data from my log, but i is it possible to do it in another way ?
    Because i have really many data in my log that i parse and if possible i want to find another way.

  • You could of course use another transfer protocol with less overhead, but I don't see the problem with parsing the data, nor what another transfer method would solve or improve. The Pi should have no problem processing the data logs to retrieve and store the sensor data. 

  • It's because i parse many other data as i said, if it's possible to i don't want to print them because i print many other data, maybe too much to be able to print them all, is there other way to do it while the other data are being parsed ,

Reply Children
Related