Connect ESP32 to host pc with ethernet
Posted: Thu Dec 22, 2022 3:06 pm
Hello,
I am trying to connect my ESP32 device (OLIMEX ESP32-POE-ISO-EA-IND) to my PC (host machine) with Ethernet. I have looked to examples (eth2ap and tcpclient) and was able to install the ETH driver and also attach the ETH to netif using esp_eth_new_netif_glue().
But I am not able to have a communication (like socket) between my PC and the ESP. Every time I try to have a socket connection with the localhost (host PC) at port 3333, the connection fails, and I am getting an errno 104 (Socket unable to connect: errno 104).
Also, there is no IP address allocated to the ESP board when I connect it to my PC, however the ESP device gets an IP if I connect it to my router. I do not know whether this is an expected behavior, or do I even need an IP address to start a communication.
I would be grateful if you can help me overcome this issue.
Thank you for your help
----------------------Examples Link------------------------------
eth2ap - https://github.com/espressif/esp-idf/tr ... net/eth2ap
tcpclient - https://github.com/espressif/esp-idf/tr ... tcp_client
I am trying to connect my ESP32 device (OLIMEX ESP32-POE-ISO-EA-IND) to my PC (host machine) with Ethernet. I have looked to examples (eth2ap and tcpclient) and was able to install the ETH driver and also attach the ETH to netif using esp_eth_new_netif_glue().
But I am not able to have a communication (like socket) between my PC and the ESP. Every time I try to have a socket connection with the localhost (host PC) at port 3333, the connection fails, and I am getting an errno 104 (Socket unable to connect: errno 104).
Also, there is no IP address allocated to the ESP board when I connect it to my PC, however the ESP device gets an IP if I connect it to my router. I do not know whether this is an expected behavior, or do I even need an IP address to start a communication.
I would be grateful if you can help me overcome this issue.
Thank you for your help
----------------------Examples Link------------------------------
eth2ap - https://github.com/espressif/esp-idf/tr ... net/eth2ap
tcpclient - https://github.com/espressif/esp-idf/tr ... tcp_client