ENVIII causes Core Basic to crash and restart continuously.



  • Arduino IDE 2.2.1
    ESP32 board def. ver. 2.0.13
    M5Stack board def. ver. 2.0.7
    M5Stack library ver 0.4.5
    M5_ENV ver. 0.0.8
    All recently updated.
    Sketch is the example from the Github repository:
    Unit_ENVIII_M5Core.ino
    When I comment out this:

    /*
        if (sht30.get() == 0) {  // Obtain the data of shT30.  获取sht30的数据
            tmp = sht30.cTemp;   // Store the temperature obtained from shT30.
                                 // 将sht30获取到的温度存储
            hum = sht30.humidity;  // Store the humidity obtained from the SHT30.
                                   // 将sht30获取到的湿度存储
        } else {
            tmp = 0, hum = 0;
        }
        */
    

    it does not crash, but of course it does not display the temperature!
    So...it points to the "sht30.get()" function.

    When I replace it with inline code:
    (and declare this: unsigned int data[6];)
    Wire.beginTransmission(0x44); //0x44 for M5Stack ENV (0x45 is DFRobot)
    Wire.write(0x2C); //show all the "wheels and gears"
    Wire.write(0x06);
    Wire.endTransmission();
    delay(50);
    Wire.requestFrom(0x44, 6);
    data[0] = Wire.read();
    data[1] = Wire.read();
    data[2] = Wire.read();
    data[3] = Wire.read();
    data[4] = Wire.read();
    data[5] = Wire.read();
    tmp = ((((data[0] * 256.0) + data[1]) * 175) / 65535.0) - 45;
    hum = ((((data[3] * 256.0) + data[4]) * 100) / 65535.0);

    The sensor works!



  • I has same problem. I solved it by adding sht30.init(); to the setup() function.

    SHT3X sht30;
    QMP6988 qmp6988;
    float tmp = 0.0;
    float hum = 0.0;
    float pressure = 0.0;

    void setup() {
    M5.begin();
    Wire.begin();
    sht30.init();
    qmp6988.init();
    }

    this is missing in the example