max30100 get zero value when i connect to esp8266

Description of the issue

After take out the SDA,SCL cable and take it in

Without "take out and in SDA.SCL cable", we are unable to get heartrate value. it stuck like pic 1.

Details of my setup
Arduino hardware: NodeMCU ESP8266
MAX30100 breakout: GY-Max30100
Arduino framework version: 1.8.12
MAX30100 library version: 1.2.1

Please post text rather than pictures of text

[color=#050505]#include <ArduinoJson.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <WiFiUdp.h>
#include <Wire.h>
#include <NTPClient.h>
#include "MAX30100_PulseOximeter.h"
#include "Memo.h"
#include <FirebaseArduino.h>
#include <MPU6050.h>
#include "WorkScheduler.h"
#include "Timer.h"
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET     -1
int16_t ax;
unsigned long milli;
int nguTrua = 0;
int Avg = 55;
int tg = 450;
int ledc = D3;
int ledx = D4;
int SCL_PIN = D1;
int SDA_PIN = D2;
float bpm;
#define REPORTING_PERIOD_MS     1000
#define FIREBASE_HOST "thiet-bi-ho-tro-giac-ngu.firebaseio.com"
#define FIREBASE_ID "F5imijFRow1RXDAYuegsZb6Uh1QLAfotCwmWtKzP"
#define LED_PIN 13
PulseOximeter pox;
ESP8266WebServer sv(80);
MPU6050 mpu;
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
WorkScheduler *beatScheduler;
WorkScheduler *getAxScheduler;[/color]
[color=#050505]uint32_t tsLastReport = 0;[/color]
[color=#050505]void onBeatDetected()
{
  Serial.println("Beat!");
}
void getAx() {
  Vector normGyro = mpu.readNormalizeGyro();
  ax = normGyro.XAxis;
}
void setup()
{
  Serial.begin(115200);
  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
    Serial.println(F("SSD1306 allocation failed"));
    for (;;);
  }
  display.setCursor(0, 0);
  display.print("Wifi Connecting");
  WiFi.begin("1C5F6_MaxisBroadband", "75H522713S");
  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
    delay(500);
  }
  display.println( WiFi.localIP());
  Firebase.begin(FIREBASE_HOST, FIREBASE_ID);
  sv.begin();
  sv.on("/index", [] {
    sv.send(200, "text/html", readData("index.html"));
  });
  sv.on("/hrUp.html", [] {
    Avg += 1;
    sv.send(200, "text/html", " ");
  });
  sv.on("/hrDown.html", [] {
    Avg -= 1;
    sv.send(200, "text/html", " ");
  });
  sv.on("/timeDown.html", [] {
    tg -= 30;
    sv.send(200, "text/html", " ");
  });
  sv.on("/timeUp.html", [] {
    tg += 30;
    sv.send(200, "text/html", " ");
  });
  sv.on("/Bat.html", [] {
    nguTrua = 1;
    sv.send(200, "text/html", " ");
  });
  sv.on("/Tat.html", [] {
    nguTrua = 0;
    sv.send(200, "text/html", " ");
  });
  sv.on("/upLoad", HTTP_ANY, [] {
    sv.send(200, "text/html",
    "<meta charset= 'utf-8'>"
    "<html>"
    "<title>"
    "
"
    "Chọn file để gửi lên server"
    "</title>"
    "
"
    "<Form method='POST' action= '/upLoad' enctype= 'multipart/form-data'>"
    "<input type= 'file' name = 'chonFile'>"
    "<input type= 'submit' value = 'guiFile'>"
    "</Form>"
           );
  }, [] {
    HTTPUpload& file = sv.upload();
    if (file.status == UPLOAD_FILE_START) {[/color]
[color=#050505]    }
    else if (file.status == UPLOAD_FILE_WRITE) {
      saveData("index.html", (const char*)file.buf, file.currentSize);
    }
  });
  if (!pox.begin()) {
    Serial.println("FAILED");
    for (;;);
  } else {
    Serial.println("SUCCESS");
  }
  while (!mpu.beginSoftwareI2C(SCL_PIN, SDA_PIN, MPU6050_SCALE_2000DPS, MPU6050_RANGE_2G))
  {
    Serial.println("Khong tim thay cam bien!");
    delay(500);
  }
  display.clearDisplay();
  mpu.calibrateGyro();
  mpu.setThreshold(3);
  pox.setOnBeatDetectedCallback(onBeatDetected);
  Timer::getInstance()->initialize();
  getAxScheduler = new WorkScheduler(100UL, getAx);
}
void loop()
{
  pox.update();
  display.setCursor(0, 0);
  display.print("Wifi Connected");
  Serial.print("Heart rate:");
  Serial.print(pox.getHeartRate());
  Serial.print("bpm / SpO2:");
  Serial.print(pox.getSpO2());
  Serial.print("%");
  Serial.print(" Xnorm = ");
  Serial.println(ax);
  ledMode();
  delay(10);
  bpm = pox.getHeartRate();
  sv.handleClient();
  if (millis() - milli > 60000 && bpm > 20) {
    Firebase.pushFloat("HeartRate", bpm);
    Firebase.pushFloat("AX", ax);
    milli = millis();
    ESP.restart();
  }
  Timer::getInstance()->update();
  getAxScheduler-> update();
  Timer::getInstance()->resetTick();
}
void Tones() {
  int buzzerPin = D6;
  {
    tone(buzzerPin, 150);
    delay(500);
    noTone(buzzerPin);
    tone(buzzerPin, 250);
    delay(500);
    noTone(buzzerPin);
  }
  noTone(buzzerPin);
  delay(1000);
}
void ledMode() {
  digitalWrite(ledc, LOW);
  digitalWrite(ledx, LOW);
  if (bpm >= 55) {
    digitalWrite(ledx, HIGH);
    digitalWrite(ledc, LOW);
  }
  else {
    digitalWrite(ledc, HIGH);
    digitalWrite(ledx, LOW) ;
  }
}[/color]

UKHeliBob:
Please post text rather than pictures of text

here the code

here the code

Where ?

UKHeliBob:
Where ?

[color=#050505]#include <ArduinoJson.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <WiFiUdp.h>
#include <Wire.h>
#include <NTPClient.h>
#include "MAX30100_PulseOximeter.h"
#include "Memo.h"
#include <FirebaseArduino.h>
#include <MPU6050.h>
#include "WorkScheduler.h"
#include "Timer.h"
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET     -1
int16_t ax;
unsigned long milli;
int nguTrua = 0;
int Avg = 55;
int tg = 450;
int ledc = D3;
int ledx = D4;
int SCL_PIN = D1;
int SDA_PIN = D2;
float bpm;
#define REPORTING_PERIOD_MS     1000
#define FIREBASE_HOST "thiet-bi-ho-tro-giac-ngu.firebaseio.com"
#define FIREBASE_ID "F5imijFRow1RXDAYuegsZb6Uh1QLAfotCwmWtKzP"
#define LED_PIN 13
PulseOximeter pox;
ESP8266WebServer sv(80);
MPU6050 mpu;
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
WorkScheduler *beatScheduler;
WorkScheduler *getAxScheduler;[/color]
[color=#050505]uint32_t tsLastReport = 0;[/color]
[color=#050505]void onBeatDetected()
{
  Serial.println("Beat!");
}
void getAx() {
  Vector normGyro = mpu.readNormalizeGyro();
  ax = normGyro.XAxis;
}
void setup()
{
  Serial.begin(115200);
  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
    Serial.println(F("SSD1306 allocation failed"));
    for (;;);
  }
  display.setCursor(0, 0);
  display.print("Wifi Connecting");
  WiFi.begin("1C5F6_MaxisBroadband", "75H522713S");
  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
    delay(500);
  }
  display.println( WiFi.localIP());
  Firebase.begin(FIREBASE_HOST, FIREBASE_ID);
  sv.begin();
  sv.on("/index", [] {
    sv.send(200, "text/html", readData("index.html"));
  });
  sv.on("/hrUp.html", [] {
    Avg += 1;
    sv.send(200, "text/html", " ");
  });
  sv.on("/hrDown.html", [] {
    Avg -= 1;
    sv.send(200, "text/html", " ");
  });
  sv.on("/timeDown.html", [] {
    tg -= 30;
    sv.send(200, "text/html", " ");
  });
  sv.on("/timeUp.html", [] {
    tg += 30;
    sv.send(200, "text/html", " ");
  });
  sv.on("/Bat.html", [] {
    nguTrua = 1;
    sv.send(200, "text/html", " ");
  });
  sv.on("/Tat.html", [] {
    nguTrua = 0;
    sv.send(200, "text/html", " ");
  });
  sv.on("/upLoad", HTTP_ANY, [] {
    sv.send(200, "text/html",
    "<meta charset= 'utf-8'>"
    "<html>"
    "<title>"
    "
"
    "Chọn file để gửi lên server"
    "</title>"
    "
"
    "<Form method='POST' action= '/upLoad' enctype= 'multipart/form-data'>"
    "<input type= 'file' name = 'chonFile'>"
    "<input type= 'submit' value = 'guiFile'>"
    "</Form>"
           );
  }, [] {
    HTTPUpload& file = sv.upload();
    if (file.status == UPLOAD_FILE_START) {[/color]
[color=#050505]    }
    else if (file.status == UPLOAD_FILE_WRITE) {
      saveData("index.html", (const char*)file.buf, file.currentSize);
    }
  });
  if (!pox.begin()) {
    Serial.println("FAILED");
    for (;;);
  } else {
    Serial.println("SUCCESS");
  }
  while (!mpu.beginSoftwareI2C(SCL_PIN, SDA_PIN, MPU6050_SCALE_2000DPS, MPU6050_RANGE_2G))
  {
    Serial.println("Khong tim thay cam bien!");
    delay(500);
  }
  display.clearDisplay();
  mpu.calibrateGyro();
  mpu.setThreshold(3);
  pox.setOnBeatDetectedCallback(onBeatDetected);
  Timer::getInstance()->initialize();
  getAxScheduler = new WorkScheduler(100UL, getAx);
}
void loop()
{
  pox.update();
  display.setCursor(0, 0);
  display.print("Wifi Connected");
  Serial.print("Heart rate:");
  Serial.print(pox.getHeartRate());
  Serial.print("bpm / SpO2:");
  Serial.print(pox.getSpO2());
  Serial.print("%");
  Serial.print(" Xnorm = ");
  Serial.println(ax);
  ledMode();
  delay(10);
  bpm = pox.getHeartRate();
  sv.handleClient();
  if (millis() - milli > 60000 && bpm > 20) {
    Firebase.pushFloat("HeartRate", bpm);
    Firebase.pushFloat("AX", ax);
    milli = millis();
    ESP.restart();
  }
  Timer::getInstance()->update();
  getAxScheduler-> update();
  Timer::getInstance()->resetTick();
}
void Tones() {
  int buzzerPin = D6;
  {
    tone(buzzerPin, 150);
    delay(500);
    noTone(buzzerPin);
    tone(buzzerPin, 250);
    delay(500);
    noTone(buzzerPin);
  }
  noTone(buzzerPin);
  delay(1000);
}
void ledMode() {
  digitalWrite(ledc, LOW);
  digitalWrite(ledx, LOW);
  if (bpm >= 55) {
    digitalWrite(ledx, HIGH);
    digitalWrite(ledc, LOW);
  }
  else {
    digitalWrite(ledc, HIGH);
    digitalWrite(ledx, LOW) ;
  }
}[/color]

What does get zero value mean?

You should simplify the circuit to just the MAX30100 connected to ESP8266.
Then view what it is sending to the ESP8266 on the Serial Monitor.

hello sir did you solve this issue? can i see your circuit diagram and code sir thank you