Arduino BLE Sense libraries "invalid model for current sensor"

Every Arduino library example program includes the last 3 lines:
#if !defined(EI_CLASSIFIER_SENSOR) || EI_CLASSIFIER_SENSOR != EI_CLASSIFIER_SENSOR_ACCELEROMETER
#error “Invalid model for current sensor”
#endif

I am wondering how this works because I cannot compile any of the examples, due to this error message.

Hi @pbalesparks,

If you cannot compile this means that the model you’ve exported does not match the sensor (in the example applcation).
See EI_CLASSIFIER_SENSOR in model-parameters/model_metadata.h. In your case it should read EI_CLASSIFIER_SENSOR_ACCELEROMETER.

1 Like

Hello I have the solution

just follow the instructions

After including the library in the sketch

Then go to file and then copy the path of the library from preference

Go to the Library–> (Your edge impulse file ) → scr → Model-Perameters–>Model metadata…

Open the Model metadata file, and then find ( EI_CLASSIFIER_SENSOR )

in front of ( EI_CLASSIFIER_SENSOR ) you will find ( EI_CLASSIFIER_SENSOR_FUSION ) this

you need to change (EI_CLASSIFIER_SENSOR_FUSION) this to this ( EI_CLASSIFIER_SENSOR_ACCELEROMETER )

and then see this ( “accX + accY + accZ + gyrX + gyrY + gyrZ + magX + magY + magZ” )

change this to ( “accX + accY + accZ” )

and then

( #define EI_CLASSIFIER_RAW_SAMPLES_PER_FRAME ) in front of this there is 9 do change 9 to 3 and then

SAVE now you can use it.

It will not show any error.

refresh it and use it.

2 Likes

Thank you, sir. Extremely helpful