Arduino Compile Error?

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.

Any suggestion for what I might be doing wrong?

Hello @robertgallup,

Unfortunately, I have not been able to test Arduino IDE 2.0.0.

Can you tell me if you still have the issue with Arduino 1.18.19?
If so, I’ll investigate further.

Best,

Louis

@louis Thanks for the reply!

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.

@robertgallup Please upload a text file of the complete Arduino compiler output and/or make your project public so I can try and reproduce the issue.

@MMarcial thanks for looking into this!

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.

@robertgallup I was able to reproduce the error.

@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();

Then mod 2 lines in the INO:

  • ei_classifier_smooth_init(&impulse, &smooth, 10,7,0.8, 0.3);
  • const char *prediction = ei_classifier_smooth_update(&impulse, &smooth, &result);

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?

I forgot to mention you must:
#include <edge-impulse-sdk/classifier/ei_classifier_smooth.h>

OK. I just needed to replace the “inferencing” include with the one from my project and the compile/upload with the fixed sketch works! Thanks!

1 Like

Hello,

FYI, we’ve finally updated our documentation to work with Arduino IDE 2.0: Arduino library - Edge Impulse Documentation

Best,

Louis

1 Like

@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?

Hello @MMarcial,

Correct, let me fix this. This is the one screenshot and text I have not updated :D.
I am updating it now!

For the ESP32, I have just tested the camera example with the ESP32 CAM.
You can change the camera model pin definition and add you own from this file: arduino-esp32/camera_pins.h at master · espressif/arduino-esp32 · GitHub

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.