The ESP32 is the latest and greatest wonderchip from Espressif. It’s a 32-bit, dual-core chip with WiFi, Bluetooth, and tons of peripherals such as CAN and Ethernet. For most of these peripherals, Espressif already has a few bits of example code, but [Frank Sautter] didn’t like the Ethernet implementation. The ‘stock’ code calls for a TLK110 Ethernet PHY, but that’s an expensive chip when bought in quantity one. A better chip would be the LAN8720, so [Frank] built a board to enable Ethernet on the ESP32 with this chip.
The ESP32 only needs a few components to wire it into an Ethernet network. Just a few resistors, capacitors, and an RJ45 jack will take care of most of the work, but because he’s taking the Ethernet ‘shield’ route, he needs to add his own Ethernet PHY. The Waveshare LAN8720 is the chip for this, but there’s an issue with the pin configuration of the ESP32. GPIO0 on the ESP32 has two functions — the first is pulling it low during startup for serial programming, and the second is the clock input for the EMAC function block. Some bit of circuitry must be devised to allow for both conditions to enable Ethernet on the ESP32.
[Frank]’s solution is to add a few pull-up and pull-down resistors to a breakout board, and use an unused GPIO pin to switch GPIO0 high during startup, but allows a crystal to grab it a bit later. It’s a hack, certainly, but it does allow for some much cheaper chips to be used to give the ESP32 Ethernet.
Does that mean it can connect to the internet?
£5 please
It means it can act as a very cheap gateway
LAN WiFi
It is a very useful hack.
>The ESP32 only needs a few components to wire it into an Ethernet network. Just a few resistors, capacitors, and an RJ45 jack will take care of most of the work, but because he’s taking the Ethernet ‘shield’ route, he needs to add his own Ethernet PHY
So, am i reading this correctly?
Only a few passives were needed, but somehow this design decided to plop an extra chip in there?
But…why?
Ok, I read some more.
No
There is always a need for a chip as ESP32 needs a PHY in all cases. So this writeup mainly addresses about hooking up a different PHY to it than one that espressif recommends.
Cool, and a job well done by Frank.
Yeah, the Hackaday summary makes it seem like the ESP32 already has a PHY onboard, which isn’t the case.
RIGHT! I want to know how to do it just by afdding those R’s and C’ and the port. I just need a cheap and dirty ethernet to wifi gateway…
When Arduino development for the ESP32 finally matures, it will make a very mighty Arduino compatible device. Quite possibly the most versatile one out there. MicroPython on it will also be amazing!
That is, if the team decides to add better base-libraries at some point.
Add PoE support and I’m sold !
A fully compliant POE adapter will never be cheap, as it needs a buck converter that can survive at least 55V. Once you go over 40V, they start getting expensive.
Yeah, but you can go all the way DIY and make sure you don’t use over 30V, should be cheap with ebay parts.
I have also used the passive PoE on cheap routers to make them access points, with their own original adapter. Worked fine over smallish distances, 15m.
I’ve been using those rather cheap module with my raspberry pi:
https://www.aliexpress.com/item/free-shipping-IEEE-802-3af-Standard-5V-2A-Output-10-100M-PoE-Splitter-Power-over-Ethernet/32648963285.html
But I wish I could find a similar module on a PCB, not in a case with cables…
The RT9400-5V modules are what you’re looking for and they’re cheap. You need to be able to tap into the Ethernet pairs before the transformer though so a socket with integrated magnetics won’t work.
It definitely looks like what I’m looking for :-)
Thanks a lot!
Since the ESP32 ethernet mac only supports 100Mb/s ethernet anyways (as opposed to 1000Mbps), only two of the four wire pairs of an ethernet cable are used => you can use those cheap passive “POE” injectors and splitters for 1.5$ a pair that just use the other two wire pairs for the supply voltage instead of messing with combined power+data on the same lines. It’s way cheaper and you don’t even need a POE-capable switch either but can connect it to any switch, so you also save on that end.
Well the thing is, I already have a 802.3af switch!
I don’t want a passive injector as that means I still need one (or several) external power supply at the other side…
I got my eps32 coming in any day now.
Cant wait to start playing with it.
I have about 23 esp8266 threw out the house now.
I can see this coming in very handy. I have some projects that will need a faster connection.
perfect timing.
Humm seems the chinese cloned Waveshare LAN8720 http://www.waveshare.com/lan8720-eth-board.htm and are selling them for peanuts http://s.click.aliexpress.com/e/JyrF2zB .As usual, they made modifications to the knock-offs so probably some will work and some won’t.
The ESP itself seems to be missing. Anyone found a schematic for ESP32-Bit?
guys pleas help me how to connect to the USR TS232T2 LAN connector.
what are the connection and programming with ESP32 please help me .
is there a posibility to get a enc28j60 module working with the esp32?
any update on this?
Hi.
The Microchip’s ENC28J60 web page (https://www.microchip.com/wwwproducts/en/en022889) says it is:
“a 28-pin, 10BASE-T stand alone Ethernet Controller with on board MAC & PHY, 8 Kbytes of Buffer RAM and an SPI serial interface.”
Here, it is using the ESP32’s own MAC, therefore, the ENC28J60 can’t be used this way. However, you can still use it through one of the 4 ESP32’s SPI buses.
Hope this can help, I may have not understood the question…
Any idea if there would be any reason (aside from cost or silicon real estate) for the ESP32 not to have the PHY inbuilt by itself? My pipe dream would be just to hook the RJ45 with inbuilt transformers into a chip that already comes with both Wifi and wired Ethernet using just 2 or 3 pins.
An Ethernet phy is very big in silicon. The drivers are quite high power and thus need large transistors.
I’m using a wiznet w5500 lite module with my esp32. very easy to connect over SPI and uses standard arduino ethernet libraries.
Hi, I am trying the same thing but i am not able to access the ethernet in my esp32. can you share any link or any other detail.