Loading...
Loading...
Train and deploy a TinyML model for the XIAO ESP32S3 (Sense) using the Edge Impulse REST API only — no edge-impulse-cli needed (its serialport dep fails to build on modern Node/Windows). Covers: dataset upload, impulse creation (audio MFCC / vision transfer-learning), training jobs, downloading the Arduino library, and the on-device fixes required to actually run it on the ESP32-S3. Use this skill whenever the user wants to train/retrain a model ("재훈련", "edge impulse", "TinyML 훈련", "모델 배포"), upload a dataset to Edge Impulse, or gets EI Arduino-library build/runtime errors (mel filterbank, objs.a, tensor arena, EI_MAX_OVERFLOW_BUFFER_COUNT).
npx skill4agent add shain1912/esp32-skills xiao-edgeimpulse-trainei_....envEI_API_KEY=...insufficient permissions (valid roles: [admin])GET https://studio.edgeimpulse.com/v1/api/projectsx-api-keyprojects[0].id$pid$projx-labelcurl.exe -s -X POST -H "x-api-key: $key" -H "x-label: $cls" `
-F "data=@$($f.FullName)" https://ingestion.edgeimpulse.com/api/training/filesPOST /v1/api/$proj/rebalancePOST /v1/api/$proj/raw-data/delete-allPOST https://studio.edgeimpulse.com/v1/api/$proj/impulseimplementationVersion: 4{"inputBlocks":[{"id":1,"type":"time-series","name":"Time series data","title":"Time series data","windowSizeMs":1000,"windowIncreaseMs":500,"frequencyHz":16000,"padZeros":true}],
"dspBlocks":[{"id":2,"type":"mfcc","name":"MFCC","axes":["audio"],"title":"MFCC","implementationVersion":4}],
"learnBlocks":[{"id":3,"type":"keras","name":"Classifier","dsp":[2],"title":"Classification"}]}{"inputBlocks":[{"id":1,"type":"image","name":"Images","title":"Image data","imageWidth":96,"imageHeight":96,"resizeMode":"squash"}],
"dspBlocks":[{"id":2,"type":"image","name":"Image","axes":["image"],"title":"Image","implementationVersion":1}],
"learnBlocks":[{"id":3,"type":"keras-transfer-image","name":"Transfer learning","dsp":[2],"title":"Transfer learning (Images)"}]}# start: returns a job id
POST /v1/api/$proj/jobs/generate-features body: {"dspId":2,"calculateFeatureImportance":false}
# poll until finished (10-15 s interval):
GET /v1/api/$proj/jobs/$jobId/status -> job.finished / job.finishedSuccessful
# on failure read newest-first logs:
GET /v1/api/$proj/jobs/$jobId/stdout -> stdout[0..] .data
# train (after features succeed):
POST /v1/api/$proj/jobs/train/keras/3
# audio body: {"trainingCycles":100,"learningRate":0.005}
# vision body: {"trainingCycles":20,"learningRate":0.0005}val_accuracyPOST /v1/api/$proj/jobs/build-ondevice-model?type=arduino body: {"engine":"tflite-eon"}
# poll job, then:
GET /v1/api/$proj/deployment/download?type=arduino -> save as <name>.ziparduino-cli config get directories.user<sketchbook>\libraries\<project>_inferencingsrc\<project>_inferencing.h--cleanobjs.a ... is not an objectFailed to allocate persistent buffer ... EI_MAX_OVERFLOW_BUFFER_COUNTsrc\edge-impulse-sdk\porting\ei_classifier_porting.h#if defined(CONFIG_IDF_TARGET_ESP32S3)EI_MAX_OVERFLOW_BUFFER_COUNT 30302048--clean--board-options PSRAM=opi#include "esp_heap_caps.h"
void *ei_malloc(size_t size) {
void *p = heap_caps_aligned_alloc(16, size, MALLOC_CAP_SPIRAM);
if (!p) p = heap_caps_aligned_alloc(16, size, MALLOC_CAP_DEFAULT);
return p;
}
void *ei_calloc(size_t n, size_t s) { void *p = ei_malloc(n*s); if (p) memset(p,0,n*s); return p; }
void ei_free(void *ptr) { heap_caps_free(ptr); }signal.get_data<I2S.h>ESP_I2S.h(r<<16)|(g<<8)|bsx = y*W/H; sy = H-1-(x*H/W)