Giter Site home page Giter Site logo

esp32-ethgate's Introduction

ESP32-Ethgate

This is an ESP32 (ESP32-WROOM-32 module) with LAN8720A PHY project intended to be an ESP-NOW to (wired) MQTT gateway.

Photo of working board

It was designed to be produced in my PCB mill. If your PCB mill can handle QFN24 footprints and double-sided PCB's then you might be able to duplicate this. Or you can just order a PCB from pretty much anywhere. I had a few made by Oshpark.

Oshpark After Dark PCB

Oshpark After Dark PCB

Design

For simplicity, it uses the GPIO17 PLL clock technique rather than the GPIO0-based crystal, and includes a second 3.3v regulator to control the entire ethernet power rail independently. It needs stable USB power, although at some point I might take a stab at a PoE version.

The CH340C runs off the first regulator along with the ESP32. The HT7233 is rated for 300mA, which is just marginal for an ESP32, but so far I haven't noticed any power issues (power consumption for the whole board averages maybe 250mA). I've thrown in some USB ESD protection, a fuse, and some reverse protection (I know that's not supposed to be a problem with USB... things happen, don't ask). ESD protection for the Ethernet port would be a nice-to-have at some point.

The CH340C supports the usual auto-programming. Note that you may need to dial back the default upload baud rate.

I've added a small (1.25mm pitch) header with 3V3, GND, and two GPIO's to allow for things like environmental sensors. Note that temperature sensors will need to stay a minimum of 10cm off the board to avoid the heat thrown by this board. I've also broken out the USB interface with a small header (uUSB connectors can be brittle pieces of junk).

BOM

Most of the components are from LCSC. There's an interactive BOM page which should tell you what you need. Passives are 0603 with a few 0805 for the larger capacitors.

Firmware

The Arduino-ESP32 ETH_LAN8720 sketch should work with the following configuration:

#define LED_BUILTIN 2	// or use a NodeMCU-type of board definition
#define ETH_CLK_MODE    ETH_CLOCK_GPIO17_OUT
#define ETH_POWER_PIN   12
#define ETH_TYPE        ETH_PHY_LAN8720
#define ETH_ADDR        1
#define ETH_MDC_PIN     23
#define ETH_MDIO_PIN    18

ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN,
	ETH_TYPE, ETH_CLK_MODE)

I flash mine with the ESP32 clock set at 80MHz, which seems to be more stable at 100Mbps connection speeds and draws approximately 25% less power.

esp32-ethgate's People

Contributors

c- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

esp32-ethgate's Issues

Internal REG on or off?

Hi,
thanks for sharing this project.
I was checking it and there is someting that seems to be a bit off, could you please help me to understand what I am missing?

I can see from the schematic that VDDCR is left floating, thus I assume that you are using the internal regular of LAN8720A, however, the pin LED1/REGOFF is pulled up at VDD2A.
From the datasheet, http://ww1.microchip.com/downloads/en/DeviceDoc/8720a.pdf section 3.7.3.1 it states:"To disable the +1.2V internal regulator, a pull-up strapping resistor should be connected from the REGOFF configuration strap to VDD2A".

So it is not clear if the internal regular is on or off in your solution, I believe that the correct design for that led should be as it is in section 3.8.1.1;

Let me know what I am missing.

Kind regards
Z.

code help

Hi I am a noob about code, how do I code this project using Arduino, better be more detailed! Thanks a lot @c-

License

Hi,
would you mind adding a license? Preferably MIT license.

Best regards,

Max

Working example of MQTT over LAN

First of all, congratulations on this amazing project, and thank you so much for sharing it online. You mentioned that you intended to use this as an ESP-NOW to (wired) MQTT gateway. Could you please share a working example code for MQTT?? It will be really helpful. Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.