I’ve been using the Deta Grid Connect 1 and 2 gang light switches with Home Assistant for about 6 months now – as mentioned in this post. The 3 and 4 gang switches have finally arrived, and having picked one up from Bunnings, I was keen to get it setup and the firmware replaced with my own.
As mentioned in that previous post, replacing the firmware with ESPHome, your own firmware, or Tasmota has two methods. The first method is to use tuya-convert over WiFi, and the second method is to use the headers on the circuit board to plug your own leads in and upload firmware through a serial connection. Unfortunately, the good people at Deta have removed the headers on the circuit board, and changed the key used by the firmware rendering tuya-convert unusable.
It is only a matter of time though before tuya-convert is updated which will enable a wireless push of new firmware to the device. Luckily though, even without the headers, you can still use a serial connection to the board. The difficulty though, is you either need to solder your own leads on or be a little dexterous. As I mentioned on the earlier post, you need to provide power and ground to the board; you need to connect your serial programmer’s TX and RX; and you need to pull RST and GPIO0 to ground, release RST to boot the device and then release GPIO0 for programming mode.
In order to avoid soldering, or needing 4 hands, you can connect power and ground to the bottom pins on the board. You need to supply 5V though, as the pin doesn’t connect directly to VCC on the chip, rather it connects to the input side of the voltage regulator. So providing 5V on the pin gets you 3.3V on the chip. I used a bread board power supply to get the 5V, and I shared the ground on the bread board power supply to my programmer.
I then used a couple of ground connected leads to hold against RST and GPIO0 to reboot the device. Releasing RST boots the device, and then releasing GPIO0 a few seconds later enables programming mode.
Once in programming mode, I used a little header block with 2 pins bent away, and connected them to TX and RX on my programmer. I then simply held it against the TX and RX pins on the chip while pushing firmware through the programmer.
Once the firmware had uploaded, I released the TX and RX pins, and then pulled RST to ground momentarily to boot the device.
The firmware I pushed to the device supports OTA (over the air) updates, so hopefully that was only a one off activity! The good news is though, you only ever have to hold 2 pins against the chip at any one time in your hand – so its not too difficult even without the header area on the board.
This sometimes takes a few attempts. Sometimes it works first time, sometimes I might have the timing slightly off, or I may not quite have the pins in contact. So be prepared to give it a couple of attempts.
Edit (28/09/2020): a friend and I refined the process today so there are tidier instructions below. This was done using Tasmota’s Windows tool to push a Tasmota image.
- Click Flash Tasmota (or run esptool.py, or tool of choice). Actually start the upload.
- Pull RST and GPIO0 to GND
- Wait 2 seconds
- Release RST
- Wait 2 seconds
- Release GPIO0
- Connect TX and RX
So basically we clicked the upload button before we had any cables connected – although the USB programmer was already plugged in to the computer. After clicking upload, we reset the device with RST and GPIO0 both set to ground – released RST – then released GPIO0. After that, then we held TX/RX against the pins coming from the programmer, and the tool picked up and started the upload.