Hacking the Silvercrest (Lidl/Tuya) Smart Home Gateway

I get: 056b37c63254d398e0d8a6be5fc4e80a serialgateway.bin so your downloaded copy looks correct.

Windows shell pipes interfere with the data stream (I’ve got bitten by that before at work.). I’ll boot up a Windows VM now and run a test to find a way…

Thanks mate, much appreciated.

This worked for me in CMD.EXE (not Powershell):

type .\serialgateway.bin |  ssh [email protected] "cat >/tuya/serialgateway"
5 Likes

Thanks so much Paul and Robert for all your help, worked flawlessly:

image

2 Likes

If there’s one more thing you can help me with, if I wanted to download a file from the gate to my PC do you know what the command is? I’ve got 2 of these and accidentally deleted the /tuya/tuya_net_start.sh file on one of the gateways, so if I can download from the other one and re upload.

Thanks in advance

ssh [email protected] "cat /tuya/tuya_net_start.sh" >tuya_net_start.sh

1 Like

Was just wondering is there a way to disable DHCP and set a static address?

1 Like

Hi all,
im trying to get into bootloader, Im using a Intel Mac with a USB UART connection

Accessing the bootloader

  1. Power cycle the device whilst at the same time pressing the “ESC key” Is this ESC key the one on the computer on the serial console. You should interrupt the boot process and end up at the RealTek bootloader prompt.
  2. Press ENTER to get a fresh prompt.

In a program called Serial it states the device is connected, but no screen like shown.
could anyone help with this issue, i can load up linux or win if necessary.
and how do you find the ip address over USB UART

Hey Justin

To get the IP the easiest way I found was to connect the gateway to a spare port on the router and go into the routers configuration and go to your home network (refresh it if there’s an option to do so) and it’ll show you the device and IP address connected to the corresponding port.

Or get the IP from the gateway directly you’ll need root access to the console, have you managed to get the root password by following this guide:

https://paulbanks.org/projects/lidl-zigbee/root.html

Or if you have got root access to the console you can type:

ifconfig

NOTE: not ipconfig like in windows

1 Like

Make sure TX/RX are connected correctly, and the configuration of the serial connection is correct (38400 baud, 8N1, as stated in the docs). And yes, Esc is like the key on the keyboard.

1 Like

Good day. Thank you for sharing this script. (lidl_auskey_decode.py
Im getting the following error

Traceback (most recent call last):
  File "/home/juan/Documents/downloads/tuya_gateway/lidl_auskey_decode.py", line 61, in <module>
    print("Auskey:", auskey.decode("ascii"))
UnicodeDecodeError: 'ascii' codec can't decode byte 0x8e in position 2: ordinal not in range(128)

Any advice is much appreciated

Edit, please disregard. I was doing something wrong. It works and I got this generic gateway working with exactly the same instructions.

Thank you

1 Like

edit: You fixed it. :slight_smile:

1 Like

Hi, just wanted to say thanks for posting this -since Paul (bool2) said something like ‘there doesn’t seem to be much interest in this’ somewhere (can’t find where right now, but i’m sure i’ve read that)…

I am interested, an have root access to the device now thanks to your description. Next, I’m going to try the home assistant integration… So, thanks again, i think it’s great that people take the time and effort to put this kind of information online -especially in a noob-friendly manner- so that less of these kind of devices end up on the scrap heap (or, can only be put to use by closed source software that is maintained by unknown companies for an unknown stretch of time).

So, nothing more than an encouragement to keep doing what you’re doing here! :slight_smile:

4 Likes

@JeromeT
I have connected the gateway to zigbee2mqtt using the dev branch. It’s an ongoing project. See here.

So far I’ve got Xiaomi motion, contact and ambient sensors paired and they’re working fine. I also have a 1 gang wall switch also working correctly.

Z2m permits creating more than 1 network.

3 Likes

Can somebody tell something about the update checks on that lidl/tuya gateway?

It would be very interesting if ota firmware requests are made here for tuya, lidl or possibly even aqara and xiaomi zigbee devices. It would be great if you could use the hack to improve the above list.

1 Like

Thanks for the news @juan11perez !

Unfortunately I won’t be able to go experimental with my gateways, they’re already used in the house.
I’ll keep an eye on ongoing developments though.

While we’re at it, I’m curious about one thing : is there a tradeoff when using zigbee2mqtt instead of plain ZHA ? From where I see it it sounds a bit like going from one protocol (Zigbee) to another (MQTT) to HA instead of going straight from Zigbee to HA.

Thanks again for the news.

Well, dont know enough to render judgement.
In my experience I observed 2 significant advantages with z2m.

  1. No networks limitation.
  2. Better documentation and wider knowledge base to add new devices. Like I said I’m not an expert and with the available resources I was able to add an aircon thermostat and subsequently generate a pull requests to add it to main branch.

It’s (z2m) obviously a more mature product with a wider support base as it’s not limited to homeassistant.

Ok, totally understand.

Thanks for the hints.

I might try it one day if I manage to gather the time and energy.

Hello.
First, many thanks for all person who help to have this gateway works under Home assistant. I cannot imagine the work done for that …
Like DJKalz, I want to know if it’s possible to fix IP address directly in the gateway.
Thanks for help

Sure you can. I guess the easiest way is to edit the file /tuya/tuya_start.sh and add something like:

killall udhcpc       
ifconfig eth1 192.168.1.254 netmask 255.255.255.0

The first line stops the DHCP client so DHCP doesn’t set the IP address.
The next sets the IP and mask. Change the IP and mask to whatever you like.
If you need routes, you can add more lines underneath using the route utility.

4 Likes