Hi. I’m trying to compile the Arduino example code for an Arduino Nano 33 Sense from a accelerometer deployment. I install the library and load the continuous accelerometer sketch with Arduino IDE 2.0. When I compile, I get the following error: ‘ei_classifier_smooth_t’ was not declared in this scope.
Yes. The same problem with Arduino 1.18.19. There is a cascade of errors, but it seems to begin on line #102 with:
nano_ble33_sense_accelerometer_continuous.ino: In function ‘void run_inference_background()’:
nano_ble33_sense_accelerometer_continuous:102:5: error: ‘ei_classifier_smooth_t’ was not declared in this scope
FWIW, It looks like this type is defined in: ei_classifier_smooth.h. I may have missed it, but just now searching the source code, I don’t see anywhere that header is included.
Public project ID#139336 exhibits this problem. To reproduce, deploy to an Arduino library, install the resulting .zip file from the IDE, then try to compile the ble33 continuous example to show the errors.
Let me know if you need anything else from me to help identify where my problem is.
@louis The first 2 arguments in the prototypes for
ei_classifier_smooth_init() and
ei_classifier_smooth_update() want
const ei_impulse_t* AND
ei_classifier_smooth_t*.
For example: void ei_classifier_smooth_init(const ei_impulse_t*, ei_classifier_smooth_t*, size_t,uint8_t,float,float)
So either these 2 functions need to be wrapped and not exposed to the Ardy user and separate calls created for the user consumption or the Impulse needs to get up into the Ardy INO.
I do not have a Nano BLE (there seems to be none for sale, what’s up Arduino?). However, I got the program to compile.
I am guessing this is how to bring the Impulse up to the Ardy INO but may be way off base here. ei_impulse_t impulse = ei_construct_impulse();
Hi @MMarcial@robertgallup
I was able to reproduce and fix the issue. Attached find the fixed version of the sketch. @louis I will make a PR to edit the sketch template.
Thanks @AIWintermuteAI@MMarcial@louis for tracking this down. The fixed sketch didn’t compile for me (missing includes), but maybe it depends on an updated library too?
@louis The doc is incorrect on #2. You cannot import a library via its extracted folder.
Original: 2. Find the folder (do not go inside the folder), and select **Choose** .
It should be more like: 2. Select the ZIP file, and then click the **Choose** button.
Also, does this update mean EdgeImpulse is supporting the ESP32 family in the Arduino IDE or just a select few like the ESP-EYE and ESP32-CAM AI Thinker. For the others in the ESP32 family, is it still recommended to use the Expressif IDE?
The ESP32 family is so big that we won’t be able to test it with all the boards. For image project, I’d recommend to use a board that has PSRAM. Other than that we now support esp-nn optimisations through Arduino IDE (which was not the case before) so you should be able to run the static-buffer example from any board.