it is a D1 R2.
it is called a boards support package, not 'library'.
in D1 R2 you have to use D2 instead of 2 for board pin labeled D2.
D2 and other Dn names are constants mapped to the right esp8266 io pin number.
some pins of the esp8266 are boot config pins. they require a HIGH or LOW on boot.
1 Like