I'm using an ESP12-E module with an I2C device (H3LIS331DL). I hooked everything up and used the I2C scanner code, which you can see here:
byte error, address;
nDevices = 0;
for(address = 1; address < 127; address++ )
error = Wire.endTransmission();
if (error == 0)
Serial.print("I2C device found at address 0x");
else if (error==4)
Serial.print("Unknow error at address 0x");
if (nDevices == 0)
Serial.println("No I2C devices found\n");
delay(5000); // wait 5 seconds for next scan
It basically just scans for I2C devices in your lane and if it found something you'll get a message. Anyway when I upload it onto my board I get this error instead.
The reason I used
https://www.kloppenborg.net/images/blog/esp8266/esp8266-esp12e-specs.pdf the pins on SDA and SCL are 19 and 20. If I leave it blank it wont work. I actually get the message "No I2C device found" on the serial monitor.
I also tried to solder a wire bridge from GPIO 4 to GPIO 2 and GPIO 5 to GPIO 14 and changed the arguments of Wire.begin accordingly. Because the datasheet on page 12 said that its using that I2C lane. Unfortunately that didnt help either. I get the same error as in
I also attached a picture of how I wired everything up.
I also checked that the Wire.h library supports ESP8266 boards.
These are my Arduino IDE settings:
- Windows 10 64bit
- Arduino IDE 1.8.5
- Flash Size: 4M
- CPU Frequency: 80Mhz
- Upload Speed: 115200
I also tried changing upload speed and choosing another ESP8266 board. But I keep getting the same error.
At this point I dont know if it's a hardware issue or a software issue.
I hope I didnt forget to mention anything important.
Any help would be appreciated
Thanks in advance.