I am trying to build a fire alarm detection system by analysing the sound.
For this, I am using the Nordic nRF9161 DK with IKS02A.
I created a public project (585872), used Audio (MFE) as a processing block, and Classification as a learning block.
When I tried to run the model in a web browser, it worked fine. But when I try to deploy the impulse to Nordic nRF9161 DK + IKS02A1 (binary output), its not working. Always showing the same result.
If this is how you are running it I will try to give some debugging steps for you, but if I’m correct this iks02a1 is on an additional board you have connected to the devkit? If so you may need Nordics help here, did you ask on their forum?
I am not using ‘edge-impulse-run-impulse’ command to run the impulse, instead of this, I am connected to the devkit through minicom using the command ‘minicom -C communication.log -b 115200 -D /dev/ttyACM0’
I used the github repo to get the result, but the result was same as described.
after using this code, I tried acquiring the sound data to ensure the code and hardware setup worked. From this, I can eliminate my doubt about the hardware setup. The same setup was used to acquire the sound data for training.
In the GitHub repo code, I believe that the fun ‘inference_sampling_work_handler’ is used to get the samples for the classification, and ‘dmic_read’ (dmic_read(mic_dev, 0, &buffer, &size, READ_TIMEOUT)) is the fun to capture the sound data from the mic. While checking the buffer data, after a few cycles of dmic_read, the data is :- Buffer Data (3200 bytes): 07 00 07 00 07 00 07 00 07 00 07 00…
Thanks for reporting this issue, I will look into it. I will try to reproduce it with my audio model, and see if I have a same problem, if not I will ask you for your project ID so i can take a look.
Thanks for your replay.
I also found the issue and fixed it for my code.
It was due to the configuration issue in the channel selection.
In the ‘ei_microphone_inference_start’ function, it was PDM_CHAN_LEFT. But actually it should be PDM_CHAN_RIGHT. The same configuration is used in the ‘ei_microphone_sample_start’ function. But there it was correct. Because of that, data acquisition was working correctly.
That’s why I did not suspect any configuration issue in the first place.
Yes, that was the issue!
You can continue building locally with C++ deployment until we have the fix in prod after that you will be able to use nRF9161dk deployment again!
Hi @vojislav
I am using Nordic nRF9161 DK, and I already have an Embedded C program running on it.
So, is there any way to download the Edgeimpulse library as a C library instead of a C++ library?
So EI only supports C++ deployment but for pure C applications there is a way to resolve this.
This is done by compiling the impulse as a shared library then link to it from a C application.