Data collection with the device thingy 53

Hi, I’m a university student doing an internship, my task is to create an application via Android Studio with the Kotlin language. The application connects to the thingy 53 device via ble, uses edge impulse APIs for information and more.
Except that I have a problem in data collection, as I saw that to collect data you have to connect to the websocket and then use the “start sampling” API, the latter returns to me successfully.
The next step I think is to collect the data with the device and then upload the collected data to (the format I wanted to work in is in json).
My question is, how do I collect data with the device?, I tried to see the Edge Impulse code to understand how it works, but until now I don’t really understand it.

Hi @FlavioZ,

The easiest way to get data is to either use a USB connection to your computer along with the CLI tool or the WebUSB to upload directly to Edge Impulse Studio. You can also use the nRF Edge Impulse app to get data via Bluetooth. All three of these options require running the pre-compiled firmware, which you can install by following these instructions.

If you want to write your own firmware for the Thingy53 to perform data collection, you will need to write some C++ embedded code to collect data from the sensors and send them via Bluetooth to your phone. This will likely be non-trivial. As the Thingy53 uses Zephyr, there are likely sensor drivers already built in to the Nordic SDK for that board. Here are some guides to help you get started if you wish to pursue that route:

Thank you very much for the answer, so if my device is connected to my application, the only way to collect data via ble is to have its own firmware?
Because I would like to know how Edge Impulse collects them, if I have the Edge Impulse firmware can I do something about it?

Hi @FlavioZ,

You might be able to communicate directly with the official Edge Impulse firmware running on the Thingy 53 via BLE. Your best bet would be to look at the open source firmware here: GitHub - edgeimpulse/firmware-nordic-thingy53 and see what BLE commands it is looking for. That is the extent of my knowledge around the Thingy 53 and BLE, so I would not be able to help much beyond pointing you to the code.

Hi @FlavioZ
This is just a small supplement to @shawn_edgeimpulse answer.
The communication protocol between Thingy53 with Edge Impulse firmware and the mobile app is documented here.
It is UART over BLE (called NUS - Nordic UART Service) which implements our Remote Management Protocol with a small addition to also transfer collected samples through NUS. The mobile app later uploads samples to our Ingestion Service.
I also have good news for you :slight_smile: The source code of the Nordic’s nRF Edge Impulse mobile app is fully available here (as well as the iOS version).

If you have further questions, just ask here. We will be happy to help you.

Best regards,

1 Like