Upgrade an ESP8266 Gateway with an ESP32

In early 2021 we moved on from EMS-ESP for the ESP8266 to EMS-ESP32 for the ESP32 platform.

To make use of all the great features of EMS-ESP32 you need to have a Gateway with the ESP32 chip inside. The older Gateways have the ESP8266 chip inside, however it’s possible to update your ESP8266 Gateway to the powerful ESP32.

Note

If you don’t want to upgrade your Gateway with EMS-ESP32, the ‘old’ firmware will still work as it is of course.

If you want to upgrade to an ESP32 yourself you can do so with the simple instructions below. If you already have a Gateway Premium II and would like to get one of the new Gateway models instead of replacing just the chip, send me an email via the contact form on the website and I’ll give you a discount on a new Gateway of your choice.

There is one drop-in replacement available for the Wemos D1 Mini: the MH-ET Live ESP32 D1 Mini.

EMS Gateways with ESP8266 and ESP32

Compatible Gateways: All ESP8266 Gateway models: First edition, Regular, Standard, Premium, Premium II.

This upgrade also comes with it’s downsides:

  • It’s no longer possible to power the Gateway from the bus itself. You need to use the jack or an external USB adapter.

  • The ESP32 replacement is bigger than the Wemos D1 Mini, so the side piece won’t fit anymore (or you have to cut it in two).

  • You have to modify the enclosure otherwise the top cover won’t fit anymore.

  • The LED is on a different position so it does not align anymore with the hole in the lid (but you can still see it though).

Steps to upgrade to the drop-in replacement

Get the right board

Get an MH-ET Live ESP32 D1 Mini or one of the clones. You can buy one yourself online like for instance on AliExpress 1 or get a soldered and programmed one from my webshop.

Solder on the headers

Solder on the 8-pin male headers on only the inner position like below.

MH-ET board headers 1 MH-ET board headers 2

Load the EMS-ESP firmware

Now you need to upload the correct EMS-ESP firmware to the chip. Use an ESP32 firmware version. You can use the ESP Flasher tool or build the firmware via Platform IO. See HERE.

When you load the ESP32 firmware it’s preconfigured for the MH-ET version.

Note

You need to take a note of your EMS-ESP settings. Although you can create a backup of your configuration settings, you should not load this file onto another type of Gateway, as it will screw up several settings and possibly make the Gateway unresponsive.

Modify the enclosure

The ESP32 board is to wide for the lid of the enclosure of the Gateway. You need to cut off a part or the whole of the screw bushings on the side of the JST/USB connector. Also trim off the edge of the enclosure. See below.

The lid only fits in one orientation on the bottom so make sure you are cutting the right side! You need to cut the side where the LED hole is.

Enclosure lid trim

You also have to leave out the plastic side because the board will stick out. You can trim the side piece as well and then it will fit too.

If you did it properly the lid will fit again and it looks like below;

MH-ET board in Gateway

Putting it all together

  • If you can use the service jack you can continue to reconnecting to the bus. You do not need to use a USB adapter.

  • Otherwise remove the jumper from the Gateway board. By removing the jumper you are disabling the green voltage converter. If you have a board without a jumper, you need to remove the green voltage converter.

  • Connect a USB cable and adapter to the ESP board.

  • Reconnect the bus.

  • Log in to the web interface of the Gateway and reconfigure it to your situation.

Pinout MH-ET Live D1 board

Although EMS-ESP for the is preconfigured for the MH-ET board, these are the correct GPIO settings in case you might need it:

Function

Wemos D1 Mini

MH-ET D1

LED

GPIO02

GPIO02

RX

GPIO13 (D7)

GPIO23

TX

GPIO15 (D8)

GPIO05

Dallas (DS18B20)

GPIO14 (D5)

GPIO18

Reset

NA

NA

Other replacements

In general you can use all ESP32 development boards. But none will fit inside the Gateway enclosure. But almost all will work with the Gateway circuit board! Remove the Wemos and use Dupont wires to connect your ESP32 board of choice to the pins on the header of the Wemos on the Gateway board.

You cannot use bus power anymore. Use either the jack if it’s available or use an USB adapter to power your ESP32 board. If you can use jack power then you can still use the green voltage regulator to power your ESP32 board. Do not draw more than 200mA of current!

If you cannot use the jack remove the jumper from the Gateway board. If you have a board without a jumper, you need to remove the green voltage converter.

Position your Gateway like below:

gateway Premium II internals

The pins are numbered from left to right.

Pin number

Top Wemos header

Bottom Wemos header

1

Not in use

Reset (via the on-board switch)

2

Not in use

A0 (Not in use)

3

Not in use

D0 (Not in use)

4

Not in use

D5 -> Dallas sensor input

5

Not in use

D6 (Not in use)

6

Not in use

D7 -> EMS RX IN

7

Ground

D8 -> EMS TX OUT

8

5V INPUT to ESP32 from Gateway board

3,3V OUTPUT from ESP32 to Gateway board

1

https://nl.aliexpress.com/item/32815530502.html