I needed a gateway that does not depend on a reliable WiFi connection, so Ethernet was the only option.
The ESP32 processor is already designed to be used with Ethernet, using a LAN8720 interface module, which is available from Aliexpress etc. for under €3. This combination is well supported by the Arduino universe and the ETH library. To work properly, the module needs one minor modification, as described here or here.


The MySensors website has instructions for how to build an Ethernet-based gateway (with an ATmega processor) or a gateway using an ESP8266 or ESP32 processor (with WiFi connection), but the combination of ESP32 processor and Ethernet connection requires some tweaks to the MySensors library, as I found out.
The firmware implements
- a MySensors gateway, that translates between RF24 messages and MQTT messages, like the example sketch from the MySensors library, or
- a MySensors repeater, which re-transmits RF24 messages from a node to the gateway and vice versa
In addition, a simple Web UI shows information about the amount of traffic passing through, and the “health” of the MySensors network (see the blog post on link quality estimation).

Source code and hardware schematics are available on Github.