Hello @ScottO,
Most of the time it is due to an error in the init or the classification/detect function.
It could also be due to using the knowledge of another library than the one deployed, so make sure that all your linked files from NanoEdge are correct.
For my first point, please call the function like that
neai_state = neai_anomalydetection_init();
neai_state = neai_anomalydetection_knowledge(...);
neai_state = neai_anomalydetection_learn(...);
neai_state = neai_anomalydetection_detect();
and print the neai_state to see if you have any issue.
Here is the neai_state possible value and meaning:
enum neai_state {
NEAI_OK = 0,
NEAI_INIT_FCT_NOT_CALLED = 123,
NEAI_BOARD_ERROR,
NEAI_KNOWLEDGE_BUFFER_ERROR,
NEAI_NOT_ENOUGH_CALL_TO_LEARNING,
NEAI_MINIMAL_RECOMMENDED_LEARNING_DONE,
NEAI_UNKNOWN_ERROR
};
#endif
Make also sure to do enough learning:
for (uint16_t iteration = 0 ; iteration < LEARNING_ITERATIONS ; iteration++) {
fill_buffer(input_user_buffer);
printf("learning %d/%d!\r\n",iteration,LEARNING_ITERATIONS);
neai_anomalydetection_learn(input_user_buffer);
}
Have a good day,
Julian