ETH01-EVO ESP32-C3 + DM9051 SPI eth

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

ETH01-EVO ESP32-C3 + DM9051 SPI eth

#1 Post by iron » 30 Dec 2023, 16:46

https://www.aliexpress.com/item/1005006257748744.html

What are the chances of supporting this soon ?
-D

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#2 Post by Ath » 30 Dec 2023, 17:27

We have the W5500 SPI Ethernet controller planned on a TODO list, and as the DM9051 is also supported by current IDF, there is a chance this might also be supported. No ETA for either boards yet, though, as Ethernet was in the ESP32-Classic domain only, for ESPEasy, there will be some structural changes needed to be able to handle this on other CPUs (possibly even on ESP8266, but I'm not sure if there is a future for new development for that platform :?).
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#3 Post by TD-er » 30 Dec 2023, 21:38

iron wrote: 30 Dec 2023, 16:46 https://www.aliexpress.com/item/1005006257748744.html

What are the chances of supporting this soon ?
Just bought it on Ali, ETA (of the board) is 12th of Jan.
However these boards with SPI Ethernet are quite different as you need to consider it as a separate IP stack.
So no idea how easy it is to implement.

At least the ETH chip seems to be supported in the latest ESP-IDF5.1

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#4 Post by iron » 31 Dec 2023, 08:56

TD-er wrote: 30 Dec 2023, 21:38 At least the ETH chip seems to be supported in the latest ESP-IDF5.1
What are the chances of that ? (while trying to resolve the "lag" issue from the other thread)
Attachments
dm9051.jpg
dm9051.jpg (146.15 KiB) Viewed 8483 times
-D

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#5 Post by TD-er » 31 Dec 2023, 12:22

Hmm if the SPI ETH modules are already included in that list, then it was by accident as those really need a different approach (and constructor with different parameters)

RMII modules have a fixed set of pins + a few pins which can be chosen from a limited set of pins.
Those are just the "layer-1" of the network stack, or in other words just the physical interface.
Layer-2 (MAC) and up are implemented in software in ESPEasy (and the ESP-IDF + Arduino code)

SPI Ethernet modules have the full IP stack upto Layer-3 (IP) running on the module.
So that needs a completely different way of interacting with the module.
Also the SPI pins are not the same as the pins you need for RMII modules.

michcfr
New user
Posts: 8
Joined: 25 Jan 2024, 01:05

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#6 Post by michcfr » 25 Jan 2024, 01:14

Hello,
When do you think ESPEASY will support the W5500 SPI Ethernet controller?
Would it be possible to plug more than one W5500 SPI Ethernet controller? very useful to build gateways between two separate Ethernet networks.

Regards,
Michel
Ath wrote: 30 Dec 2023, 17:27 We have the W5500 SPI Ethernet controller planned on a TODO list, and as the DM9051 is also supported by current IDF, there is a chance this might also be supported. No ETA for either boards yet, though, as Ethernet was in the ESP32-Classic domain only, for ESPEasy, there will be some structural changes needed to be able to handle this on other CPUs (possibly even on ESP8266, but I'm not sure if there is a future for new development for that platform :?).

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#7 Post by TD-er » 25 Jan 2024, 08:51

Yesterday I have been looking into the required changes for the SPI Ethernet controllers and indeed it should be possible to have multiple SPI Ethernet devices.
However I am not sure if I will add this support for multiple Ethernet adapters immediately since it also requires quite a lot of redesign to implement routing.

The user me-no-dev is working very hard on a complete redesign of the network/wifi related code in ESP32/Arduino and I'm following this closely.
As soon as that's available I will do the redesign in ESPEasy regarding network/wifi related code and only then it makes sense to add support for >1 Ethernet adapter.

N.B. I will only add support for SPI Ethernet adapters to ESP32-variants, very likely not to ESP8266 as I already need to spend incredible amounts of time to make it all fit on the ESP8266 and adding more features there would make this even harder.

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#8 Post by iron » 25 Jan 2024, 14:36

More than 1 bridged ETH devices (switch) or treated as separated interfaces each one with its own properties ?
-D

michcfr
New user
Posts: 8
Joined: 25 Jan 2024, 01:05

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#9 Post by michcfr » 25 Jan 2024, 14:53

Thank you TD-er for the information. Waiting for the update soon
@iron: as separated interfaces.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#10 Post by TD-er » 25 Jan 2024, 15:15

iron wrote: 25 Jan 2024, 14:36 More than 1 bridged ETH devices (switch) or treated as separated interfaces each one with its own properties ?
Not sure if layer-2 switching is even technically possible with those Ethernet adapters as I'm not sure we have layer-2 access to those.
Some (all???) SPI Ethernet adapters are running a complete IP-stack on the controller.
Anyway running it as a switch is probably extremely slow if it would even be possible.
Running as a router/gateway/access point might be feasible as there are quite a few use cases where low speed is just good enough.


TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#12 Post by TD-er » 25 Jan 2024, 22:43

Looks interesting.

michcfr
New user
Posts: 8
Joined: 25 Jan 2024, 01:05

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#13 Post by michcfr » 25 Jan 2024, 23:10

My use case: the ESP32 running as a protocol converter between two bus protocols that runs over the Ethernet.
For example: Bacnet (or ModBus) over Ethernet <=== ESP32 with two Ethernet ports ===> MQTT over Ethernet

Do you think it can be implemented with the bridge example from iron?

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#14 Post by TD-er » 25 Jan 2024, 23:34

Well that looks like it needs some translation as it isn't just IP packets. For MQTT you need to publish messages.
And Modbus is also about requesting to read a register or range of registers, so you also need to subscribe to a MQTT topic to receive the commands to start reading and then publish the results.

So this has nothing to do with a bridge, but more like reading something from one device and writing to another.
I don't even think you need 2 Ethernet ports for it.

michcfr
New user
Posts: 8
Joined: 25 Jan 2024, 01:05

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#15 Post by michcfr » 25 Jan 2024, 23:42

Correct, It is more like reading from one device to another.
But two separate Ethernet ports are needed in order to separate interfaces from each other

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#16 Post by TD-er » 25 Jan 2024, 23:54

Why do you need to separate it?
Is it in a different subnet? Need the isolation? No switch available? (Gbps switches are about the same price as an Ethernet port for ESP's these days. Bought several 5-port TP-link switches at the Action store a few months ago for < 10 euro each)

michcfr
New user
Posts: 8
Joined: 25 Jan 2024, 01:05

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#17 Post by michcfr » 26 Jan 2024, 00:04

Yes, need to be separated: different subnet, with isolation
It is in industrial context, so switches are much more expansive.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#18 Post by TD-er » 26 Jan 2024, 00:15

Well I don't think I will add the 2nd Ethernet support before the pending PR for ESP32/Arduino to redesign the network stack is merged.
No need to spend a lot of work now to add work-around only to have to redo it within a few months due to huge differences in how network stuff is being handled in Arduino.

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#19 Post by iron » 26 Jan 2024, 09:21

TD-er wrote: 30 Dec 2023, 21:38
iron wrote: 30 Dec 2023, 16:46 https://www.aliexpress.com/item/1005006257748744.html

What are the chances of supporting this soon ?
Just bought it on Ali, ETA (of the board) is 12th of Jan.
Have you received this ? Images show a very proprietary PoE doing Vcc on pin 7 and return on pin 8 when anything else in terms of PoE (either standard or passive) use both 7 and 8 for return / GND.

GND on pins 7 and 8 is PoE Mode B that is the mostly / widely used either active (48v 802.3af/at) or passive PoE injectors as e.g. those used by MikroTik

This will require a "hacked" PoE Injector and of course the risk of (most likely) frying the units those who do not pay close attention
Attachments
esp32evo.jpg
esp32evo.jpg (41.54 KiB) Viewed 6443 times
-D

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#20 Post by TD-er » 26 Jan 2024, 09:23

Yep I have received them
I do have a few PoE injectors and PoE switch and a PoE tester, so I can see what it tries to negotiate.
Hopefully I will not fry the unit.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#21 Post by TD-er » 26 Jan 2024, 09:34

Haven't found a proper schematic on these boards, but judging this hard to read (due to resolution) schematic, it seems like it only exposes the PoE pins, not doing anything else with them.

Image

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#22 Post by TD-er » 26 Jan 2024, 10:16

First glance under the microscope, the (switching) DC/DC converter seems to be connected to 5V/GND pin.
The "Link" pin next to the 5V pin seems to be connected to the link LED in the RJ45 connector.
Let's hope I can also get the link state from the Ethernet chip itself so I don't need to wire this link pin to a GPIO pin as they are already limited as we're using a C3.

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#23 Post by iron » 26 Jan 2024, 13:01

Can you use a multimeter to read what RJ45 pins actually end up on the PoE+ and PoE- ?
We are hoping for RJ45 pins 4,5 to lead to PoE+ and pins 7,8 to PoE-
Attachments
RJ45_Pinout.jpg
RJ45_Pinout.jpg (16.59 KiB) Viewed 6395 times
-D

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#24 Post by TD-er » 26 Jan 2024, 13:43

Here is a lot of info on what others already found (which isn't that much actually) about that board
https://github.com/AI6YP/eth01-evo
So it seems it is just tapping of the normal PoE pins like any other RJ45 phy does with PoE support.
Only difference here is that they already have diodes included in the phy.

It looks like the shield is also properly isolated from GND, but have to measure it to be sure.

I have it now hooked up to my PC to flash a standard C3 build of ESPEasy to it and am looking into the ETHClass::beginSPI code of the Arduino/ESP32 SDK

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#25 Post by TD-er » 26 Jan 2024, 13:47

By the way, DC/DC converter used seems to be the ETA3417
It can handle upto 2.5A continuous according to some screenshots from a datasheet I can't find 🙂
V_in can be upto 7V (9V absolute max) so you can't use it to directly connect it to the PoE input pins directly from a PoE switch or using passive injectors which typically are used along with 12-15V power adapters.
When putting in 7V on such a passive injector, I'm afraid the voltage drop over the Ethernet cable will be too much.
So you really need some external PoE module like the 9400 or something similar. (the 9400 is a really good one by the way)

Anyway, it is a funky board with lots of opportunities for users to fry the board.

I only got the board to flash when using the 5V input.

Another funky design choice is that the INT/IRQ pin for the Ethernet module is connected to GPIO-8 which looks to be connected to the LED on the WT32C3-Sx module

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#26 Post by TD-er » 26 Jan 2024, 18:40

I've got it running on my board :)
ETH01-EVO ESP32-C3 + DM9051 SPI eth

PHY addr: 1
CS pin: 9
IRQ pin: 8
RST pin: 6

I still have to add a selector/config for SPI2
Right now the SPI2 pins are hard-coded in the build for the C3
SCK pin: 7
MISO pin: 3
MOSI pin: 10

nitnoq
New user
Posts: 1
Joined: 11 Feb 2024, 18:18

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#27 Post by nitnoq » 11 Feb 2024, 18:32

Hello, do you have any idea about how to use the "ETH01-EVO ESP-32-C3 with the DM9051 SPI eth" without esp easy ? Any library available somewhere to use in an Arduino sketch ? First time with this combo card and struggling a bit ...

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ETH01-EVO ESP32-C3 + DM9051 SPI eth

#28 Post by TD-er » 11 Feb 2024, 20:00

I do seem to be one of the first to add support for it, so there are not a lot of examples out there yet.
You need ESP-IDF 5.1 code (latest Espressif/Arduino-esp32 code)

Also you really need to call ETH.begin() with the SPI bus as argument. (thus not the function call with the SPI pins as argument)
Make sure the SPI bus is already started with the SPI.begin() call.

The rest does seem to be quite like any other ETH call.

Post Reply

Who is online

Users browsing this forum: No registered users and 39 guests