Using the nRF52840 dongle to write a text file to pc

Hello, I am pretty new to using the Nordic products and was wondering if there is a simply way to write a text file from the nRF52840 to a pc.  The system is required to log data such as voltage and temperature that will be received by the nRF52840 through ble.  I am exploring my options at the moment.  I have been looking into ways to be able to use built in python modules on the dongle but I have not been very successful in finding a method for that.   Thanks for any help!

  • Hi,

    There is no standard way to access or write to files on a computer from BLE. I suspect one of the simplest methods would be to use the Nordic UART service, and implement a client for this on the PC side, and dump he received data to a file.

    Or is this a question about how to log data from a nRF that is physically connected to the PC? If so, some form of logging via UART or USB would make sense, and again, dump the data to a file.

  • Thank you, so the nRF will be physically connected through the computers USB port.  Are you aware of any examples I could play around with to get familiar with this concept?  As someone who is new to this, I really appreciate any and all help. Thanks again!

  • Hi,

    Are you using the nRF Connect SDK? If so, the USB CDC ACM Sample Application is probably the most minimal example that shows this. If you are using the nRF5 SDK you can refer to the USB CDC ACM Example.

  • Thanks! I am unable to use nRF connect. The idea behind the project would be to plug the dongle into any pc and be able to log and save the data without installing and applications.  The USB CDC ACM example was one of the first examples I looked at when starting the project; however, it seemed to only write to the serial port instead of saving the data.  I guess that is were I am getting stuck, I am struggling to understand how to actually save the data from the serial port. 

  • Hi,

    Joseph91 said:
    I am unable to use nRF connect.

    I see, so nRF5 SDK then (if you mant not able to use the nRF Connect SDK).

    Joseph91 said:
    The USB CDC ACM example was one of the first examples I looked at when starting the project; however, it seemed to only write to the serial port instead of saving the data. 

    Yes, we do not have any solution for you that will save the data on the PC. This is probably the best approach though as it gives you the data stream on the PC so that you can do whatever you want with it.

    Joseph91 said:
    I guess that is were I am getting stuck, I am struggling to understand how to actually save the data from the serial port. 

    You mentioned python before, so I would suggest that you make a small python script that interfaces with the COM port to receive the data and write it to a file. The pySerial module is nice for this.

Related