This is the output from I2CexpDiag in the hd44780_I2Cexp i/o class in the hd44780 library (Kind of says most of this in the output -
)
@ArakelTheDragon
One thing I noticed is that some board symbols changed in the boards.txt file the recent esp8266 core
The NODEMCU ESP-12 and ESP-12E both used to define a single symbol now they have separate symbols.
I2Cexpdiag has been updated to support these new symbols. This will be available in the next hd44780 library release.
This does not affect the issue of not seeing the i2c slave.
It only affects the output where it prints the digital pint for SDA and SCL.
What is missing on that line is that the SDA is D2 and SCL is D1
i.e.
The current I2CexpDiag code doesn't print the Dx pin symbol for the NODEMCU boards with the newer ESP8266 core.
i.e. it should have printed:
SDA digital pin: 4 (GPIO4) D2
SCL digital pin: 5 (GPIO5) D1
So on the nodemcu board you selected
SDA is digital pin 4 which is GPIO4 which is mapped to symbol D2
SCL is digital pin 5 which is GPIO5 which is mapped to symbol D1
i.e. D2 is the same pin as digital pin 4 and D1 is the same pin as digital pin 5
Given that no slave is not seen, my guess would be one or multiple of these:
- incorrect i2c bus voltage (connecting Nodemcu to 5v bus)
- incorrect board type selected (this affects the pin mappings)
- connection issue (bad / incorrect wiring)
I would not recommend hooking up an ESP part directly to a 5v i2c bus since it is a 3v part.
I ALWAYS use a level shifter to avoid any logic level issues and avoid any potential damage to the ESP part by connecting it to a 5v bus.
The correct board type must always be selected since the board selected affects how the pin numbers are mapped to the physical pins on the board.
The Arduino pin mapping and labeling on the ESP parts can be confusing.
This is due to how the ESP core does is mapping and the often poor and inconsistent labeling on the ESP modules.
Because of this it isn't always obvious that the wires are connected to the incorrect pins.
i.e there is a difference between D2 and 2 as those are not the same physical pin on the module.
This can get even more confusing depending on how the board is labeled.
Some boards will label the digital pins D1, D2, D3, ....
And some just use numbers, 1, 2, 3 ....
And on some boards that have just a number (not Dx) the numbers are Dx numbers and some boards that just have a number are showing GPIO numbers.
So that means a pin labeled might be D1 or it might be GPIO1 which is digital pin 1and those are not the same pin since D1 is not necessarily the same pin as GPIO1 or 1
But pin N is always the same as GPIOn
i.e. digital pin 1 is GPIO1
The cause of the D1 vs 1, etc... not being the same pin
The ESP core does is pin mapping using constants. This is WAY more efficient than the goofy multiple table lookups that the Arduino.cc cores do. The ESP way allows the mappings to be done at compile time with ZERO overhead at runtime, whereas the Arduino.cc way requires multiple table lookup which is a a dramatic slow down (particularly on the AVR core) since the mapping has to be looked every single time the pin is used.
The draw back to the ESP way is it creates some potential confusion due to the use of Dx symbols and the different and inconsistent ways board makers label their boards.
--- bill