So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Rerode
#78819 Hello all,


I connected a nodemcu with a CCS811.
Yesterday when i tryed it for the fist time i did receive CO2, VOC and Temperatuur.
But when i recconect is i receive this:

Code: Select all⸮CCS811 test
Failed to start sensor! Please check your wiring.

Soft WDT reset

ctx: cont
sp: 3ffffda0 end: 3fffffd0 offset: 01b0

>>>stack>>>
3fffff50:  3ffee6f8 00000031 3ffee7b4 4020323c 
3fffff60:  3ffee6f8 3ffee7b4 3ffee7b4 40203385 
3fffff70:  3ffe88d8 3ffee784 3ffe850c 40203385 
3fffff80:  3ffe887c 3ffee7f0 3ffee7b4 402033b0 
3fffff90:  4020159e 00001388 3ffee7b4 402033d4 
3fffffa0:  feefeffe 3ffee7b4 00001388 402029f4 
3fffffb0:  3fffdad0 00000000 3ffee7e8 402039c0 
3fffffc0:  feefeffe feefeffe 3ffe850c 401000e5 
<<<stack<<<
H!⸮⸮⸮⸮D⸮



This is the Arduino code


Code: Select all#include "Adafruit_CCS811.h"

Adafruit_CCS811 ccs;

void setup() {
  Serial.begin(9600);
 
  Serial.println("CCS811 test");
 
  if(!ccs.begin()){
    Serial.println("Failed to start sensor! Please check your wiring.");
    while(1);
  }

  //calibrate temperature sensor
  while(!ccs.available());
  float temp = ccs.calculateTemperature();
  ccs.setTempOffset(temp - 25.0);
}

void loop() {
  if(ccs.available()){
    float temp = ccs.calculateTemperature();
    if(!ccs.readData()){
      Serial.print("CO2: ");
      Serial.print(ccs.geteCO2());
      Serial.print("ppm, TVOC: ");
      Serial.print(ccs.getTVOC());
      Serial.print("ppb   Temp:");
      Serial.println(temp);
    }
    else{
      Serial.println("ERROR!");
      while(1);
    }
  }
  delay(500);
}

I really don't understand why its not working any more.
I have also tryed a ESP-32 with the same results
Last edited by Rerode on Wed Oct 24, 2018 3:20 am, edited 2 times in total.
User avatar
By QuickFix
#78821 Where's the sketch of this example?
We really need more than this to go on.

My initial guess is (since it's a soft watchdog reset) is that there are no (or not enough) yields() or delays() in the code to give the WiFi-stack air to breath.

But again: one can only guess without an actual sketch and/or schematic. :idea:
User avatar
By Bonzo
#78827
My initial guess is (since it's a soft watchdog reset) is that there are no (or not enough) yields() or delays() in the code to give the WiFi-stack air to breath.


When I first started using a Nodemcu I had errors like that and found that when I was trying to error check my code I put in serial print statements and the errors stopped! Purely by accident I found replacing the serial prints with small delays stopped the errors.