You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:连接热点后无法在Arduino IDE串口监视器查看ESP8266的IP地址

Hey there! Let’s figure out why you’re not seeing your ESP8266’s IP address in the Arduino Serial Monitor—this is a super common issue, and I’ve fixed it dozens of times. Let’s go through the steps one by one:

1. First, Nail Down the Serial Monitor Basics

If your serial settings are off, you’ll either get gibberish or nothing at all. Here’s what to check:

  • Match the baud rate exactly: If your code uses Serial.begin(115200), the Serial Monitor must be set to 115200 (look at the bottom-right corner of the monitor window). Mismatched rates are the #1 culprit here.
  • Pick the right port: In the Arduino IDE, go to Tools > Port and select the one assigned to your ESP8266 (it’ll look like COM3 on Windows or /dev/ttyUSB0 on Linux/macOS).
  • Skip unnecessary send settings: Uncheck "Newline" or "Carriage Return" unless your code explicitly expects them—these can interfere with output.
2. Make Sure Your Code is Actually Printing the IP

A lot of times, the issue is that the code isn’t waiting for WiFi to connect before trying to print the IP, or it’s missing the print statement entirely. Try this minimal test code (replace your current code with it):

#include <ESP8266WiFi.h>

// Replace with your hotspot details
const char* ssid = "YOUR_HOTSPOT_NAME";
const char* password = "YOUR_HOTSPOT_PASSWORD";

void setup() {
  Serial.begin(115200);
  delay(10); // Give serial time to initialize

  Serial.println("\nConnecting to " + String(ssid));
  WiFi.begin(ssid, password);

  // Wait up to 20 seconds for WiFi to connect
  int waitCount = 0;
  while (WiFi.status() != WL_CONNECTED && waitCount < 20) {
    delay(1000);
    Serial.print(".");
    waitCount++;
  }

  if (WiFi.status() == WL_CONNECTED) {
    Serial.println("\nWiFi connected successfully!");
    Serial.print("IP Address: ");
    Serial.println(WiFi.localIP()); // This line is critical for showing the IP
  } else {
    Serial.println("\nFailed to connect to WiFi");
    Serial.print("WiFi Status Code: ");
    Serial.println(WiFi.status()); // Use this code to look up specific issues (e.g., wrong password = WL_CONNECT_FAILED)
  }
}

void loop() {
  // Nothing needed here for this test
}
  • Swap in your hotspot’s name and password, upload it, and open the Serial Monitor. You’ll see progress dots while connecting, and a clear IP if it works.
3. Confirm the ESP8266 is Actually Connected to Your Hotspot

Sometimes the Serial Monitor says it’s connecting, but the ESP8266 isn’t actually on your network:

  • Check your router’s device list: Log into your hotspot’s admin page (usually 192.168.1.1 or 192.168.0.1) and look for a device named something like ESP_XXXXXX. If it’s not there, the connection didn’t stick.
  • Stick to 2.4GHz WiFi: The ESP8266 doesn’t support 5GHz networks—if your hotspot is 5GHz only, switch to a 2.4GHz one.
  • Verify encryption: The ESP8266 works best with WPA/WPA2. Avoid WEP or open networks that require web-based login (those won’t work without extra code).
4. Rule Out Hardware & Driver Issues

If the above steps don’t work, it might be a physical or driver problem:

  • Swap your USB cable: Cheap cables often only carry power, not data. Grab a known-good USB data cable and try again.
  • Check power: The ESP8266 needs stable power. If you’re using a computer USB port, try a powered USB hub or an external 5V/1A power supply—low power can cause WiFi drops and serial glitches.
  • Update the ESP8266 core: Outdated core files can cause weird bugs. In Arduino IDE, go to File > Preferences, make sure the additional board URL includes http://arduino.esp8266.com/stable/package_esp8266com_index.json, then go to Tools > Board > Board Manager, search for "ESP8266", and install the latest version.
  • Reboot everything: Turn off the ESP8266, close the Arduino IDE, restart your computer, and try again. Sometimes a fresh start fixes stubborn serial issues.

Give these steps a shot—chances are one of them will get that IP address showing up in your Serial Monitor!

内容的提问来源于stack exchange,提问作者Emmanuel Enna

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 07:07:25