banksy-git / lidl-gateway-freedom

Freeing the Silvercrest (Lidl/Tuya) Smart Home Gateway from the cloud.
https://paulbanks.org/projects/lidl-zigbee/
GNU General Public License v3.0
206 stars 66 forks source link

Add firmware upgrade script and guide #5

Closed Ordspilleren closed 3 years ago

Ordspilleren commented 3 years ago

Based on this thread, we managed to get custom firmware running on the EFR32 Zigbee chip in the Lidl Gateway. I have made a script to perform the upgrade, and a guide on how to use it. It also includes sx compiled for the Realtek SoC on the device. This is needed for uploading the firmware with xmodem.

Since a lot of useful information is already in this repo, I guess it makes sense to use it as a base for further development. Feel free to provide feedback if you have any!

krosand commented 3 years ago

The last commit work fine, thx :+1:

MattWestb commented 3 years ago

I think it can being good adding one link to the EZSP 6.5.1.0 so user can using it for going back to "tuya app". https://github.com/grobasoz/zigbee-firmware/blob/master/EFR32%20Series%201/EFR32MG1B-256k/NCP/NCP_UHW_MG1B232_650_PA0-PA1-PB11_PA5-PA4.gbl

If have using your script its also possible doing one "redo" script that is deleting the changes that is made (if tuya is starting checking for file changed / added in the file system).

loglux commented 3 years ago

What is the benefit of this upgrade?

MattWestb commented 3 years ago

I saying so if you dont have one large zigbee system and not problems with IKEA and other controlling devices draining there batteries (like Sonoff Zigbee Bridge was having) its safer staying on the 6.5 than can going back to toya app very easy and safe.

If having problems its being many fixes implanted that can helping getting the system being more stable in the 6.7.8.0 but you cant 110% getting it back to factory without flashing the module with one dumped copy of your original module firmware with one SWD flasher. For the moment tuya app is not complaining then flashing the "new" 6.5.1 but its sending large logs (with all command being used in the CLI then was off line from the cloud) to the cloud and it can being that tuya is implanting more deep test of the file system and build number of the EZSP and is blocking "hacked" devices that is going back to there "app" and cloud worlds. One collection of reference documents for devs https://github.com/zigpy/zigpy/discussions/595.

banksy-git commented 3 years ago

Very useful! :+1: Based on your work I've added an upgrade script that uses new functionality in serialgateway to allow remote control of the flow-control enable bit thus facilitating remote updates.

This avoids us pulling in binary copies of the sx utility into the repo. (I think sx is GPL licenced so legitimate questions arise about how does one exercise their software freedom - i.e. how can another user build that same binary, etc, etc. The toolchain feels a bit "dodgy" so I thought best we avoid this topic altogether!)

MattWestb commented 3 years ago

Its only getting better and better !!!

And the integration / support in Z2M is needing EZSP protocol v 8 more users like updating there EZSP firmware to 6.7.8.0.

Great thanks to Milano and Denmark for making its happens !!

Ordspilleren commented 3 years ago

@banksy-git Great job! Your solution is similar to what I wanted to do originally, but my C is really rusty so I chose the easy way out. I like this approach way better than my script, so I will close the PR.

castigaro commented 2 years ago

Hi, thank you very much for this useful projects.

First with @banksy-git 's hack I was able to hack the lidl silvercrest likewise as the megos smart gateway from aldi. Maybe you remember our contact Paul ;-)

Now with the firmware and the firmware_upgrade script from @Ordspilleren i was first time able to use the silvercrest gateway in combination with zigbee2mqtt as serial adapter via tcp with the experimential ezsp adapter so that all devices are also recognized.

And the best thing ever!

Now I am finally able to use all silvercrest and Megos devices and especially the Megos remote 141L100RC as well as the HG06668 doorbell from Silvercrest with zigbee2mqtt. Only the firmware upgrade led to the devices being recognized. Before that, they were always listed as unknown devices in combination with the original silvercrest firmware.

MattWestb commented 2 years ago

Z2M implementation is only working with EZSP with serial protocol version 8 and standard for tuya ZBGW is using EZSP 6.5.1.0 (if not tuya have upgrading it) that is using serial protocol version 7 protocol. So need EZSP 6.7.0.0 or newer for it to working with Z2M so use the 6.7.8.0 firmware. (ZHA can using all versions but the 6.7.8.0 is the last recommended for stable version)