How to use ESP8266WiFi.h library with arduino mega board (megaatmega2560)?

Sorry this topic looks so basic, this is my first attempt using platformio IDE, btw this is my platformio.ini content

platform = atmelavr
board = megaatmega2560
framework = arduino

As far as I know esp8266 base library (GitHub - esp8266/Arduino: ESP8266 core for Arduino) are automatically included on platform = espressif8266, but megaatmega2560 board are not supported on platform espressif8266. Is there any way to use esp8266 base library with megaatmega2560 board?

The ESP8266-Arduino Core can not be used with the ATmega board. These are two entirely different types of chips.

Do you expect WiFi functionality on the Mega board when using the ESP8266 core? Or do you want to use a library written for the ESP8266 on the ATmega?

1 Like

I want to use a library written for the ESP8266 on the ATmega, because I’m using ESP8266 module with arduino mega, not programming ESP8266 as an independent platform, here is a connection sketch between arduino and ESP8266 to explain what I mean


Thanks for this question, because your question I began looking for the ESP8226 modules, all this time I’m only using ESP-01 and what I know that very device are what every people call ESP8266, turns out there are a few type.

I’ll try this out, thank you very much :+1:

Eh sorry I was missing the word “library” here. But anyways yeah, you might find working with a NodeMCU (ESP-12F) way more confortable and might not actually need the Mega at all depending on your application.