I want to add ethernet capabilities to my board (STM32F411CEU6 blue pill) and connect to an MQTT broker. I have two modules: ENC28J60 and W5500. The goal was riched using UIPEthernet library and MQTT library that uses UIPEthernet, however, it is not the best approach.
As I understand, the correct way is to use a driver that implements an Mbed ethernet interface. This is the trickiest part, I’ve found a lot of drivers for W5500: W5500Interface, W5500, wiznet-eth-driver and the latest one on GitHub w5500-eth-driver but no one works.
Did I miss somethings? Wiznet W5500 is a quite popular chip and, strangely, Mbed OS doesn’t have the correct driver for it.
UPD:
I’ve opened an issue for the latest driver but it is unclear who supports it and whether it’ll be fixed or not.
After a lot of googling one more library has been found: WIZnetInterface.
I don’t know whether it is okay or not that it is so hard to find the correct library but at least it works (only when reset pin isn’t connected or reset functionality is commented out, but it’s a separate issue).
Summary. WIZnetInterface has been improved and PR was created.
I managed to compile W5500Interface library with some fixes but it doesn’t work (unable to get IP using DHCP).
Thanks for that @strange_v, the setup has been pretty reliable for me, but I don’t have the reset pin connected to my STM32 so guess I haven’t seen this bug.
I can recommend to use a F407 and a LAN8720. This combination with chinese boards / modules is about 15 € and the F407 has enough resources for a HTTP server and a MQTT client.
The Wiznet chip has its own interpretation of network api and the Mbed implementation had more bugs. In the wiznet forum I was told that they work on a better library, but for month nothing happened. With an integrated MAC, you’ll get a solution that is fast and reliable by using the lwIP stack.
@JojoS I’ve already bought STM32F407 based board and DP83848 ethernet module. It should be easy to use this combination because it is used in Seeed Arch Max. But… I never tried (haven’t used Mbed for a long time, but still have plans for that board).
Both, LAN8720 and DP83848 work fine with STM32F407VE. An alternative to W5500 could be the ENC28J60. It doesn’t have RMII but works fine over SPI (using less wires than RMII) with STM32F103 and STM32F407VE too. However, the speed is only 10Mbit/s and requires an Ethernet crossover cable for direct connection between two Mbed boards. But no crossover cable is needed when connected to a present day Ethernet switch or rooter (since it can automatically swap the pins on its side).