CCS811 wemos: Failed to start sensor

Hi all,
I connected the CCS811 sensor to an arduino nano like this:
image

and used this sketch:

//Arduino nano con scheda ethernet ENJ28J60
//SI connette al server mqtt
//usata libreria ethernet <EthernetENC.h> perchè è più leggera ho disattivato UDP: #define UIP_CONF_UDP  0 (libraries\EthernetENC-master\src\utility\uipethernet-conf.h )

#include <EthernetENC.h> //più leggera rispetto UIPEthernet
//#include <UIPEthernet.h>
#include <PubSubClient.h>   
#include "Adafruit_CCS811.h"
unsigned long mytime = 0;

byte mac[] = {0x80, 0x7D, 0x3A, 0x69, 0x20, 0x99 }; //physical mac address
byte mqtt_ip[] = {ip }; // ip in lan
const char* mqttUser = "";
const char* mqttPassword = "";

char buf[4]; // Buffer to store the sensor value
int updateInterval = 5000; // Interval in milliseconds

EthernetClient espClient;
PubSubClient client(espClient);
Adafruit_CCS811 ccs;
void reconnect() {
  // Loop until we're reconnected
  while (!client.connected()) {
    Serial.print("Attempting MQTT connection...");
    // Attempt to connect
    if (client.connect("gas",mqttUser, mqttPassword)) {
      Serial.println("connected");
    } else {
      Serial.print("failed, rc=");
      Serial.print(client.state());
      Serial.println(" try again in 5 seconds");
      // Wait 5 seconds before retrying
      delay(5000);
    }
  }
}

void sensors() {

   if(ccs.available()){
    if(!ccs.readData()){
      int co2 = ccs.geteCO2();
      int tvoc = ccs.getTVOC();
      Serial.print("CO2: ");
      Serial.print(co2);
      Serial.print("ppm, TVOC: ");
      Serial.println(tvoc);
      client.publish("home-assistant/sensorgas/co2", itoa(co2, buf, 10));   //e'il sensore fumo
      client.publish("home-assistant/sensorgas/tvoc", itoa(tvoc, buf, 10));   //e'il sensore fumo
    }
    
    else{
      Serial.println("ERROR!");
      while(1);
    }
  }
    
}
 
void setup()
{
  Serial.begin(115200);
  delay(100);
  Ethernet.begin(mac,{ip },{ip },{ip }); //Ethernet.begin(mac, ip, dns, gateway);
  client.setServer(mqtt_ip, 1883);

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

  while(!ccs.available());
}
 
void loop()
{
  if (!client.connected()) {    reconnect();  }
  client.loop();
  if (millis()-mytime>updateInterval)
      { mytime=millis(); 
        sensors();
      }
}

Everything is ok.

But if I try to connect the same sensor to a wemos D1mini like this:
image

and using this code:

#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);
}

the result is: "Failed to start sensor! Please check your wiring."

If I perform a scan of the I2C bus I obtain the address of the sensor...

What could I check?

As it says: the wiring! You must connect VIN to the voltage of the I2C bus (3.3V for the Wemos) otherwise the I2C pullups don't work.

BTW, the two boards in the wiring diagrams are not the same. My comment above is based on the Adafruit board the other one might have another circuit.

sorry the sensor is different. my sensor is the first... so i connected the vcc/gnd/scl/sda/wak to 3.3/gnd/d1/d2/gnd....

And why isn't there a link to that sensor? We must know the schematics of the sensor board, otherwise we cannot help.

You are right...
This Is my wiring:

And doesn't work

There still no link to that board!

As I have no clue how the board is wired you have to check everything yourself! RESET must be pulled high and ADDR must be in a defined state (either pulled high or low, if pulled high you must adapt the code!). Some of that stuff may be done on the board but you decided to keep that a secret.

sorry but don't you see the schematics?

That's your wiring. We need the schematics of the CCS811 board you're using. Some of the stuff I mentioned in my last post might be implemented on that board but we simply don't know without the schematics. If you don't have schematics of the board you have to check that list yourself using reverse engineering or buy a documented board.