ESP32-EVB - Sending data to a computer over ethernet

Started by cpppy, October 29, 2020, 03:57:24 PM

Previous topic - Next topic

cpppy

I am currently attempting to send data over ethernet between an ESP32-EVB Rev.I board and a PC over ethernet. Unfortunately, I cannot even get the basic Arduino ETH_LAN8720 example working. Due to another part of what I'm working with, it would be preferable to make it work using Arduino code. At this point, if I use the example as is, the board never gets an IP, so I am guessing I would need some sort of DHCP server, but my attempts have as of yet not worked out. I have tried assigning a static IP using the config function (including DNS, which I have read might be the issue), but that is not working either. Here is my output:

[D][WiFiGeneric.cpp:337] _eventCallback(): Event: 21 - ETH_STOP
ETH Started
[D][WiFiGeneric.cpp:337] _eventCallback(): Event: 25 - MAX
[D][WiFiGeneric.cpp:417] _eventCallback(): ETH IP: 192.168.0.90, MASK: 255.255.255.0, GW: 192.168.0.1
AC:67:B2:46:5A:EB, IPv4: 192.168.0.90, FULL_DUPLEX, 100Mbps
[D][WiFiGeneric.cpp:337] _eventCallback(): Event: 25 - MAX
[D][WiFiGeneric.cpp:417] _eventCallback(): ETH IP: 192.168.0.90, MASK: 255.255.255.0, GW: 192.168.0.1
192.168.0.90, FULL_DUPLEX, 100Mbps

connecting to http://www.google.com
[E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for http://www.google.com
connection failed

connecting to http://www.google.com
[E][WiFiGeneric.cpp:654] hostByName(): DNS Failed for http://www.google.com
connection failed

My knowledge of IP and DNS and such is quite limited, so I'm wondering if I need specific addresses and if there's something more I need to do on the PC side. Is there a way to make it work similarly to connecting a Raspberry Pi, where I just assigned it a host name and get its IP that way? Also, I am wondering if the ETH.h library supports sending packets using UDP, since speed is more important than accuracy for my specific application.
I hope that someone might be able to point me in the right direction here.

LubOlimex

Technical support and documentation manager at Olimex

cpppy

As far as I can tell, yes. I do get the choice of revisions for the Gateway board, not for the EVB board, though. I don't know if that's how it's supposed to be or not. Otherwise, I don't know what I should be doing differently. I also wonder whether the difference between LAN8710 and LAN8720 could have something to do with it, as the schematic on the shop page (which says latest, but also says it's for Revision F) shows LAN8710. I would try an example for LAN8710, but cannot find any, and don't know what changes to the 8720 example would be necessary.

cpppy

The problem has been solved with some help. Seems I just didn't understand static IP at all. Still requires me to set a static IP on the PC, so it's not entirely optimal, but it's something, at least.

LubOlimex

Hmm, then it is network configuration issue. Make sure your network equipment (e.g. router, switch, etc) has DHCP enabled on its Ethernet ports. This would allow automatic IP acquisition by ESP32-EVB.

Just search for the model of router and "how to enable DHCP" in internet.
Technical support and documentation manager at Olimex

cpppy