ESP32 with Arduino IDE and library

I was wondering if anyone had any advice about using an ESP32 board with Arduino IDE and libraries. I have deployed a working ML model from edge impulse as a library to an Arduino Nano 33 BLE Sense. I do this all in Arduino IDE using an accelerometer and a PPG signal. In Arduino, my code collects a set amount of raw data samples to fill the buffer (from 4 sensors), then the buffer runs through the edge impulse .h to perform ML.
I want to switch over from the Nano to an ESP32-based board however I have run into some issues.
The first was some errors in the IDE which I solved by downgrading the ESP32 Board manager to 1.0.5. Now that I can verify the same code I use for the Nano for ESP32, Ideally, I could just flash it to the ESP32. This however causes no output to the serial monitor.
Does anyone have any advice for this particular use case? Such as board restrictions, edge impulse limits, etc?

Hello @jsindorf,

I worked on an image classification example using the ESP32-CAM a while ago: https://github.com/edgeimpulse/example-esp32-cam/
I did not notice any particular issues with the print but you can always use the Serial.print/write function or you can set your ei_printf implementation as the following:

void ei_printf(const char *format, ...) {
   static char print_buf[1024] = { 0 };

   va_list args;
   va_start(args, format);
   int r = vsnprintf(print_buf, sizeof(print_buf), format, args);
   va_end(args);

   if (r > 0) {
       Serial.write(print_buf);
   }
}

Note that github repo above is now deprecated as we now fully support the ESP32 using IDF (not Arduino IDE). The reason behing that is because the ESP32 board implementation in Arduino IDE does not leverage the neural network hardware acceleration.

Regards,

Louis

Ill look into that. I had some trouble with the data forwarder as I am using an external PPG sensor so I found that downloading it as an Arduino library and running everything in the Arduino IDE was the best solution. Does the IDF work in a similar fashion as this?

Hello @jsindorf,

Sorry for my late reply.

ESP-IDF is Espressif IoT Development Framework. It does not come with an IDE but you can install the plugins in VSCode or Eclispe (I am sure there is one for Platform.io too).
You can also use the command line to compile your code.

I haven’t checked but I am sure you can reuse some Arduino libraries with small adaptions.

Best,

Louis

ei has good git code base for camera with esp32. but i’m looking for something to capture the accelerometer, data of which might be {dat1, dat2, dat3, dat4} kind of. I’m trying to port the ESP32-EYE based code by removing anything irrelevant such as ei_camera etc. but with no luck. too many different things in the firmware-espressif-esp32.
without ei, i’m able to get data in above format. now i’m looking for an approach to ingest data into ei project. ingestion api document is quite simple. not sure if there is any good git references.

thanks!