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 https://ingestion.edgeimpulse.com/api/training/data (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 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,
Mateusz
I tried to see the documentation you sent, I saw that for communication with the thingy 53, this occurs via the service uuids and those of the rx and tx.
I also tried to see the edge-impulse code, but it is very complicated and up to now I have not yet been able to communicate between the device and thingy 53.
I wanted to know if there are ways to read data from a specific sensor, can this be possible after establishing nus protocol communication? Are there easy examples of communication between device and thingy?
Hi @FlavioZ
If you are looking for general samples, take a look at these resources:
Zephyr Samples
nRF Connect SDK Samples
Using sensors supported by Zephyr is very simple through Zephyr’s sensor subsystem.
If you will write your own firmware to expose one sensor over BLE GATT service, then the communication with he device will be really simple.
Best regards,
Mateusz