Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

If you’re having trouble compiling code for your ESP32 or ESP8266 boards using Arduino IDE due to an error downloading the boards’ URLs, you can follow this guide to help you fix the Arduino IDE installation on a Windows PC.

  • Installing ESP32 Board in Arduino IDE (Windows, Mac OS X, Linux)
  • Installing ESP8266 Board in Arduino IDE (Windows, Mac OS X, Linux)

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

If you see a similar error in your Arduino IDE or any error related to downloading URLs, cleaning your Arduino IDE installation folder usually solves this issue.

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

If your Arduino IDE doesn’t launch (you click the Arduino icon and nothing happens) this trick might also solve the issue.

1. In your Windows PC, open the File Explorer, select View menu and enable “Hidden items“:

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

2. Go to your Windows device (for example C:), open Users and find the hidden AppData folder:

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

3. Select the AppData folder and open Local.

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

4. Open the Arduino15 folder, then I recommend deleting all files in this folder.

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

5. That’s it! Now, you just need to re-install the ESP32 and ESP8266 board add-ons.

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

Installing ESP32 and ESP8266 Board Add-on in Arduino IDE

Finally, you need to re-install the ESP board add-ons, you can either continue reading this guide or open one of the next links for more detailed instructions:

  • Installing ESP32 Board in Arduino IDE (Windows, Mac OS X, Linux)
  • Installing ESP8266 Board in Arduino IDE (Windows, Mac OS X, Linux)

1. In your Arduino IDE, go to File > Preferences.

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

2. Enter the following URLs into the “Additional Board Manager URLs” field as shown in the figure below.

https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json, http://arduino.esp8266.com/stable/package_esp8266com_index.json

Then, click the “OK” button:

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

3. Open the Boards Manager. Go to Tools > Board > Boards Manager…

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

4. Search for ESP32 and press the install button for the “ESP32 by Espressif Systems“:

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

5. Search for ESP8266 and press install button for the “ESP8266 by ESP8266 Community“:

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

Testing the ESP32 and ESP8266 Board Add-on Installed in Arduino IDE

Plug the ESP32 or ESP8266 board to your computer. With your Arduino IDE open, follow these steps:

1. Select your Board in Tools > Board menu (in my case it’s the DOIT ESP32 DEVKIT V1)

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

2. Select the Port (if you don’t see the COM Port in your Arduino IDE, you need to install the CP210x USB to UART Bridge VCP Drivers):

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

3. Open the following example (or any other example) under File > Examples > WiFi (ESP32) > WiFiScan

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

4. A new sketch opens in your Arduino IDE:

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

5. Press the Upload button in the Arduino IDE. Wait a few seconds while the code compiles and uploads to your board.

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

6. If everything went as expected, you should see a “Done uploading.” message.

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

If you get the “Timed out waiting for packet header” error, follow this guide: [SOLVED] Failed to connect to ESP32: Timed out waiting for packet header.

7. Open the Arduino IDE Serial Monitor at a baud rate of 115200:

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

8. Press the ESP on-board Enable button and you should see the networks available near your ESP32:

Lỗi board generic platform esp8266 package esp8266 is unknown năm 2024

Wrapping Up

We hope this guide fixed your Arduino IDE installation. Now, you’re ready to start building your IoT projects with the ESP32 and ESP8266 boards!