User Tools

Site Tools


detectesp8266chipsetandpullup
void setup() {
  Serial.begin(115200);
  delay(3000); // Give time to open Serial Monitor
  
  Serial.println("\n\n=== ESP8266 Board Detective ===");
  Serial.println("Run this sketch to identify your board");
  
  // Method 1: Board type
  identifyBoard();
  
  // Method 2: Chip info
  printChipInfo();
  
  // Method 3: Test common pins
  testCommonPins();
}

void identifyBoard() {
  Serial.println("\n1. BOARD IDENTIFICATION:");
  
  #if defined(ARDUINO_ESP8266_NODEMCU)
    Serial.print("✓ NodeMCU ");
    #if defined(ARDUINO_ESP8266_NODEMCU_V2)
      Serial.println("v1.0 (or v2)");
    #else
      Serial.println("v0.9 or v3");
    #endif
  #elif defined(ARDUINO_ESP8266_WEMOS_D1MINI)
    Serial.println("✓ WeMos D1 Mini");
  #elif defined(ARDUINO_ESP8266_GENERIC)
    Serial.println("✓ Generic ESP8266");
  #else
    Serial.println("✗ Unknown ESP8266 board");
  #endif
}

void printChipInfo() {
  Serial.println("\n2. CHIP INFORMATION:");
  Serial.printf("Chip ID: %08X\n", ESP.getChipId());
  Serial.printf("Flash Size: %d bytes\n", ESP.getFlashChipSize());
  Serial.printf("Core Version: %s\n", ESP.getCoreVersion().c_str());
}

void testCommonPins() {
  Serial.println("\n3. PIN TEST (with pull-up):");
  int pins[] = {D0, D1, D2, D3, D4, D5, D6, D7, D8};
  const char* names[] = {"D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8"};
  
  for(int i = 0; i < 9; i++) {
    pinMode(pins[i], INPUT_PULLUP);
    delay(10);
    int val = digitalRead(pins[i]);
    Serial.printf("  %s (GPIO %d): %d\n", names[i], pins[i], val);
  }
}

void loop() {
  // Nothing here
}

Result something like:

=== ESP8266 Board Detective ===
Run this sketch to identify your board

1. BOARD IDENTIFICATION:
✗ Unknown ESP8266 board

2. CHIP INFORMATION:
Chip ID: 00CB316D
Flash Size: 4194304 bytes
Core Version: 3.1.2

3. PIN TEST (with pull-up):
D0 (GPIO 16): 1
D1 (GPIO 5): 1
D2 (GPIO 4): 1
D3 (GPIO 0): 1
D4 (GPIO 2): 1
D5 (GPIO 14): 1
D6 (GPIO 12): 1
D7 (GPIO 13): 1
D8 (GPIO 15): 0
detectesp8266chipsetandpullup.txt · Last modified: by jwan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki