MAX30100 sensor not working with Blynk 2.0

I am trying to use an ESP32 and MAX30100 and transmit the data through Blynk.
I’ve gone through previous posts on the problem recommending the use of a Dual-Core based code but I’ve gotten to the issue of “Guru Meditation Error: Core 0 panic’ed (Unhandled debug exception)”.
Any help would be greatly appreciated.

// Fill-in information from your Blynk Template here
#define BLYNK_TEMPLATE_ID "TMPQkp-6tI-t"
#define BLYNK_DEVICE_NAME "Syahmi Blynk"

#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG

#define APP_DEBUG
#define REPORTING_PERIOD_MS     1000
#define LED0 2
#define LED1 15

// Uncomment your board, or configure a custom board in Settings.h
//#define USE_WROVER_BOARD
//#define USE_TTGO_T7
//#define USE_ESP32C3_DEV_MODULE
//#define USE_ESP32S2_DEV_KIT

#include "BlynkEdgent.h"
#include <Wire.h>
#include "MAX30100_PulseOximeter.h"
#include "Arduino.h"

TaskHandle_t Task0;
TaskHandle_t Task1;
PulseOximeter pox;

uint32_t tsLastReport = 0;

// Callback (registered below) fired when a pulse is detected
void onBeatDetected()
{
  Serial.println("Beat!");
}

void loop0(void * parameter) {
  for (;;) {
    Serial.print("Running on core: ");
    Serial.println(xPortGetCoreID());
    BlynkEdgent.run();
    //    digitalWrite(LED0, HIGH);
    //    delay(500);
    //    digitalWrite(LED0, LOW);
    //    delay(500);
  }
}

void loop1(void * parameter) {
  for (;;) {
    Serial.print("Running on core: ");
    Serial.println(xPortGetCoreID());
    pox.update();
    if (millis() - tsLastReport > REPORTING_PERIOD_MS) {
      Serial.print("Heart rate:");
      Serial.print(pox.getHeartRate());
      Serial.print("bpm / SpO2:");
      Serial.print(pox.getSpO2());
      Serial.println("%");
    }
    tsLastReport = millis();
//    digitalWrite(LED1, HIGH);
//    delay(200);
//    digitalWrite(LED1, LOW);
//    delay(200);
  }
}

void setup()
{
  Serial.begin(115200);
  delay(100);
  Serial.println("Setup started.");
  Serial.print("Initializing pulse oximeter..");
  if (!pox.begin()) {
    Serial.println("FAILED");
    for (;;);
  } else {
    Serial.println("SUCCESS");
  }
  pinMode(LED0, OUTPUT);
  pinMode(LED1, OUTPUT);

  xTaskCreatePinnedToCore(
    loop0, /* Function to implement the task */
    "Task0", /* Name of the task */
    1000, /* Stack size in words */
    NULL, /* Task input parameter */
    0, /* Priority of the task */
    &Task0, /* Task handle. */
    0); /* Core where the task should run */

  xTaskCreatePinnedToCore(
    loop1, /* Function to implement the task */
    "Task1", /* Name of the task */
    1000, /* Stack size in words */
    NULL, /* Task input parameter */
    0, /* Priority of the task */
    &Task1, /* Task handle. */
    1); /* Core where the task should run */
  Serial.println("Setup completed.");
  pox.setOnBeatDetectedCallback(onBeatDetected);
  BlynkEdgent.begin();
}

void loop() {
  delay(1);
}

Is there any reason why you’ve used the Edgent example said your starting point?

And, if you have to use Edgent why don’t you have a board type un-commented? Have you checked for pin conflicts in the custom board type of Settings.h ?

If you’re using Edgent then I think I’d start with the basic example sketch and modify it to work with dual core and ensure that works before adding-in any additional code.

Pete.

Hi dear, I am facing the same issue. did you find the solution?

@Budhaditya instead of tagging “me too” type comments on to old topics, you should create a “Need help with my project” topic and provide ALL of the information that is requested when you do that, and any additional information (such as serial monitor output) that will help us to identify and resolve your issue.

Pete.