How to Stream Additional Data to nRF Connect App?

Hello, All.

I am streaming sensor data from a XIAO NRF52840, to my mobile device using the nRF Connect App. In code, I am transmitting the data (as a string) using the setValue() function. This works fine, but I am quickly running out of the amount of information that I can I can transmit and view in the App.

For example, if I have the variable myString, which contains casted data from a temperature sensor, “Temp: 65.55 F”, I will send like so:

switchCharacteristic.setValue(myString);

I will see in the nRF Connect app, something like:

Value: (0x) 4E-43-2E-20-54-3A, “Temp: 65.55 F.”

This is fine, however, as I add additional sensors and attempt to transmit additional data, I quickly run out of space, to the point where my string gets cut off before I can view all of the data.

I suppose there are two possibilities:

  1. I don’t transmit the Address Bits, thus freeing up space to send my sensor data. (I don’t know if this is even possible, but I’d prefer this, as it would make the readout on the nRF Connect App cleaner).

  2. I increase the size of the buffer being sent. Again, I’m not sure if this is feasible or wise, as it may slow down transmission.

I do not know which is the better options (if my assumptions are even correct) nor, how to perform either action. So I came here, asking for advice.

Please let me know if I need to clarify anything at all. Thank you all in advance.

Best,

Joe

It would be easier to help if you posted your code.

However, I believe you need to set up a separate ‘characteristic’ for each value that you want to send/receive.

Then its just a matter of setting the value for each individual characteristic that you’ve set up.