title: WeMos D1 Mini (ESP8266) I2C Slave Mode does not receive any incoming data
body: <p>I have spent hours trying to figure out how I can get the &quot;WeMos D1 Mini&quot; to be in slave mode.</p>
  <p>For some reason it does not acknowledge any incoming data. From all the forums I read, everyone needs to make their own &quot;special interrupt based I2C&quot; code in order to make the ESP8266 into slave mode since it is not supported officially.</p>
  <p>So I have an Arduino Nano which is the master and it will be sending data to WeMos D1 Mini, but the example is not working at all.</p>
  <p>Here is the code I'm using from &quot;Arduino IDE 1.8.13&quot; using the &quot;ESP8266 core 2.7.4&quot;, it is the example code named &quot;slave_receiver&quot;:</p>
  <pre><code>// Wire Slave Receiver
  // by devyte
  // based on the example by Nicholas Zambetti &lt;http://www.zambetti.com&gt;
  
  // Demonstrates use of the Wire library
  // Receives data as an I2C/TWI slave device
  // Refer to the &quot;Wire Master Writer&quot; example for use with this
  
  // This example code is in the public domain.
  
  
  #include &lt;Wire.h&gt;
  
  #define SDA_PIN 4
  #define SCL_PIN 5
  
  const int16_t I2C_MASTER = 0x42;
  const int16_t I2C_SLAVE = 0x08;
  
  void setup() {
    Serial.begin(115200);           // start serial for output
  
    Wire.begin(SDA_PIN, SCL_PIN, I2C_SLAVE); // new syntax: join i2c bus (address required for slave)
    Wire.onReceive(receiveEvent); // register event
  }
  
  void loop() {
  }
  
  // function that executes whenever data is received from master
  // this function is registered as an event, see setup()
  void receiveEvent(size_t howMany) {
  
    (void) howMany;
    while (1 &lt; Wire.available()) { // loop through all but the last
      char c = Wire.read(); // receive byte as a character
      Serial.print(c);         // print the character
    }
    int x = Wire.read();    // receive byte as an integer
    Serial.println(x);         // print the integer
  }
  </code></pre>