Arduino Ethernet <--> ESP8266

Hello all,

Goal : send data from Arduino Ethernet to ESP8266 wirelessly

Proposed solution : send data from Ethernet to MQTT server then reading data from MQTT server using ESP8266

Questions :
1- Which libraries should I include in each part of code (Ethernet/ESP8266) ?
2- Is there any better method to send data from ethernet arduino to ESP8266 without MQTT ?
3- I need some examples to better understand how can I do it

Thank you

1- Which libraries should I include in each part of code (Ethernet/ESP8266) ?

I use this library on ESP8266 to communicate with mosquitto (MQTT broker). The README says it works with Arduino Ethernet shield but I have not tried it.

2- Is there any better method to send data from ethernet arduino to ESP8266 without MQTT ?

One possibility is to run a webserver on the ESP8266 and web/http client on the Arduino Ethernet.

3- I need some examples to better understand how can I do it

pubsubclient library includes examples.

The following are esp8266 http/web server examples.

gdsports:
One possibility is to run a webserver on the ESP8266 and web/http client on the Arduino Ethernet.

no need to use http protocol. plain socket communication ('telnet') is simpler

Thank you gdsports and Juraj

I got several suggestions MQTT, webSockets, http , telnet

I tested MQTT with Ethernet first but it doesn't establish connection

I think the reason is that I'm using a private IP address

How can I solve this problem please ?