Closed
Description
When upgrading to 2.5.0, the following problems occur when compiling:
- type ip_addr has been changed, now need to change it to ip4_addr and is no longer compatible with earlier versions.
- Pin D0 to D5 are defined as variables in pins_arduino.h however incorrect. Get macro expansion errors when compiling. After removing my defines and using these pins definitions, esp starts to reboot all the time. D0 is 0, D1 = 1, etc. This is not correct, it refers to the wrong GPIO.
This is the correct mapping I have used all of the time and works just fine:
// ESP8266 Pin names to GPIO, weird pin mapping correction.
// https://github.com/esp8266/Arduino/blob/master/variants/nodemcu/pins_arduino.h#L37-L59
// Pin numbers written on the board itself do not correspond to ESP8266 GPIO pin numbers.
// The defines below make using this board easier (If you want to use esp pin 5,
// use D5 for pin number, and it will be translated to 'real' GPIO pin 14):
#define D0 16 // supports PWM
#define D1 5 // I2C Bus SCL (clock)
#define D2 4 // I2C Bus SDA (data)
#define D3 0
#define D4 2 // Same as "LED_BUILTIN", but inverted logic
#define D5 14 // SPI Bus SCK (clock)
#define D6 12 // SPI Bus MISO
#define D7 13 // SPI Bus MOSI
#define D8 15 // SPI Bus SS (CS)
#define D9 3 // RX0 (Serial console)
#define D10 1 // TX0 (Serial console)
#define SD0 7
#define SD1 8
#define SD2 9
#define SD3 10
#define SDCMD 11
Metadata
Metadata
Assignees
Labels
No labels