Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By WereCatf
#38463
Gawan wrote:I am afraid that I am not using the right SDA and SCL ports on my NodeMCU.
On the internet I found:
- SDA/SCL are GPIO2/ GPIO0
This is Pin3 and Pin4 on my NodeMCU - does not work


No, SDA is GPIO4 and SCL is GPIO5 on Nodemcu, ie. SDA == pin D2 and SCL == pin D1 on the board. You have connected your pins wrong. Also, as others have said you can just use Wire.begin(pin_you_want_as_sda, pin_you_want_as_scl) to use any other two pins, like e.g. Wire.begin(4, 5) or Wire.begin(D2, D1).
User avatar
By borugee
#53603 I have the same problem of using a BMP280 sensor with ESP8266. I am using the I2C scanner program http://playground.arduino.cc/Main/I2cScanner. It work perfect with Arduino UNO. But no result with NodeMCU ESP8266 (No device found on ESP8266). I am using SDA - GPIO0 --> D3, SCL - GPIO2 --> D4. I verified with oscilloscope and I see signals on Pins D3, D4 similar to that of the Arduino UNO (I did not decode them but visually they look like I2C signals).

Update : This started working. Later on. Not sure how it worked. Here is some additional information.

Wire.Begin() - This is the default ; On NodeMCU dev board this defaults to D2 - SDA, D1 - SCL. (You can also specify same using Wire.Begin(D2,D1) or Wire.Begin(4,5). i.e. 4=GPIO4, 5=GPIO5. You can also use other pins if interested. Issue I had was probably how to correctly specify the PIN numbers).