tbnobody / OpenDTU

Software for ESP32 to talk to Hoymiles/TSUN/Solenso Inverters
GNU General Public License v2.0
1.69k stars 471 forks source link

Add Support for W5500 SPI Ethernet Controller (without multiple devices using the same SPI bus) #2068

Open marvincarstensen opened 2 weeks ago

marvincarstensen commented 2 weeks ago

With the upcoming end of support of devices with 4 MB flash on OpenDTU-OnBattery (#1025) there is an upcoming problem with the ethernet support. Currently there is no S3-Version of the WT32-ETH01 and also the S3 doesn't include an Ethernet MAC anymore.

So I started to research alternatives and found the W5500. Based on #1200 I've updated to master and simplified the implementation by e.g. removing the SpiPatcher logic. This way the libraries (NRF + CMT) don't need to be modified.

As a trade-off with this branch it is only possible to connect the W5500 with NRF or W5500 with CMT or NRF and CMT without ethernet. Furthermore because SPI3_HOST is not available on e.g. C3 the W5500 will not work and a warning will be outputted.

Multiple devices using the same SPI bus (implemented in #1200) would be best option for the future, but for now I think this is the fastest way to implement the W5500 without doing changes to other libraries.

I hope we can merge this PR into the master, so that there is an option for S3 + Ethernet in the future.

D3R-ST3FAN commented 1 day ago

I can confirm this PR is working fine withe the Fusionboard and POE Hat.