Skip to content

Commit 94acc3b

Browse files
authored
Release v2.4.4
2 parents 31856ad + 87e3009 commit 94acc3b

File tree

5 files changed

+23
-15
lines changed

5 files changed

+23
-15
lines changed

README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ A Chinese company named Tuya offers a free-to-brand turnkey smart home solution
55

66
Aside from that, they claim their cloud solution has 'military grade security'. Michael Steigerwald, founder of the German IT security startup VTRUST, was able to disprove this claim and presented his results in the "Smart home - Smart hack" talk at 35C3 in Leipzig: https://media.ccc.de/v/35c3-9723-smart_home_-_smart_hack
77

8-
In the following days, VTRUST and the German tech magazine c't decided to work together. Since reflashing devices using the ESP8266/85 is widespread among DIY smart home enthusiasts, we wanted to provide an easy way for everyone to free their devices from the cloud without the need for a soldering iron.
8+
In the following days, VTRUST and the German tech magazine c't decided to work together. Since reflashing devices using the ESP8266/85 is widespread among DIY smart home enthusiasts, we wanted to provide an easy way for everyone to free their devices from the cloud without the need for a soldering iron.
99

1010
Please make sure to visit VTRUST (https://www.vtrust.de/), since the hack is their work.
1111

1212
## 🚨WARNING🚨
13-
Please be sure that you understand what you're doing before using this software. Flashing an alternative firmware can lead to unexpected behavior and/or render the device unusable, so that it might be permanently damaged (highly unlikely) or require soldering a serial connection to the processor in order to reflash it (likely).
13+
Please be sure that you understand what you're doing before using this software. Flashing an alternative firmware can lead to unexpected behavior and/or render the device unusable, so that it might be permanently damaged (highly unlikely) or require soldering a serial connection to the processor in order to reflash it (likely).
1414

15-
### ⚠️ Be aware that you use this software at your own risk so neither VTRUST nor c't/heise can be held accountable for any damage done or loss of functionality. ⚠️
15+
### ⚠️ Be aware that you use this software at your own risk so neither VTRUST nor c't/heise can be held accountable for any damage done or loss of functionality. ⚠️
1616

1717
TUYA-CONVERT only provides with the means to backup the original and flash an alternative firmware. Please do not ask for hardware support for your favorite alternative firmware in this repository, rather open an issue in the corresponding repository.
1818

@@ -27,13 +27,14 @@ Since Tuya devices are spread around the world with likely a vast amount of diff
2727
* Secondary wifi device (e.g. smartphone)
2828
* Dependencies will be installed by `install_prereq.sh`
2929

30-
These scripts were tested in
30+
These scripts were tested in
3131
* Kali-Linux 2018.4 in VMWARE
32-
* a Raspberry Pi 3B / 3B+ with Raspbian Stretch and its internal Wifi chip
33-
* a Raspberry Pi 3B+ + USB-WIFI with this image from [here](https://www.offensive-security.com/kali-linux-arm-images/)
34-
https://images.offensive-security.com/arm-images/kali-linux-2018.4a-rpi3-nexmon-64.img.xz
32+
* a Raspberry Pi Zero W with Rasbian
33+
* a Raspberry Pi 3B / 3B+ / 4B with Raspbian Stretch and its internal Wifi chip
34+
* a Raspberry Pi 3B / 3B+ Raspberry Pi OS Buster (previously called Raspbian) and its internal Wifi chip
35+
* a Raspberry Pi 3B+ + USB-WIFI with an image from [here](https://www.offensive-security.com/kali-linux-arm-images/)
3536
* Ubuntu 18.04.3 64Bit in VirtualBox on Win10 with a [cheap RTL8188CU Wifi Adapter](http://s.click.aliexpress.com/e/KrKIoPdI) connected to the VM
36-
37+
3738
Any Linux with a Wifi adapter which can act as an Access Point should also work. Please note that we have tested the Raspberry Pi with clean installations only. If you use your Raspberry Pi for anything else, we recommend using another SD card with a clean installation.
3839

3940
## PROCEDURE
@@ -49,7 +50,7 @@ On January 28th, 2019, Tuya started [distributing a patch](https://www.heise.de/
4950
BE SURE THE FIRMWARE FITS YOUR DEVICE!
5051
1. Place your binary file in the `/files/` directory or use one of the included firmware images.
5152

52-
Currently a [Tasmota](https://github.com/arendst/Tasmota) `tasmota-wifiman.bin` build is included in the Tuya-Convert package. You can update to the [current maintenance release](http://thehackbox.org/tasmota) via OTA after the flashing process completes successfully. The included binary does not have any specific hardware configured. Once flashed using Tuya-Convert you will need to configure your device(s) properly. Please note that while we include this firmware for your convenience, we are not affiliated with the Tasmota project and cannot provide support for post installation issues. Please refer to the [Tasmota project](https://github.com/arendst/Tasmota) and [its documentation](http://tasmota.com) for configuration and support.
53+
Currently a [Tasmota](https://github.com/arendst/Tasmota) `tasmota-wifiman.bin` build is included in the Tuya-Convert package. You can easily update to the [current maintenance release](http://thehackbox.org/tasmota) via OTA **after** the flashing process completes successfully. The included binary does not have any specific hardware configured. Once flashed using Tuya-Convert you will need to configure your device(s) properly. Please note that while we include this firmware for your convenience, we are not affiliated with the Tasmota project and cannot provide support for post installation issues. Please refer to the [Tasmota project](https://github.com/arendst/Tasmota) and [its documentation](http://tasmota.com) for configuration and support. **IMPORTANT:** If you still want to update the tasmota binary before using Tuya-Convert, always pickup `tasmota-wifiman.bin`. Never ever use `tasmota-minimal.bin` as you will brick your device.
5354

5455
An ESPurna [1.13.5](https://github.com/xoseperez/espurna/releases/tag/1.13.5) binary is also included (`espurna-base.bin`). Like before, the binary included does not have any specific hardware defined. Once flashed using Tuya-Convert you can update to the device-specific version via any of the means that ESPurna provides (OTA, web interface update, update via telnet or MQTT). Please refer to the [ESPurna project page](http://espurna.io) for more info and support.
5556

@@ -68,7 +69,7 @@ BE SURE THE FIRMWARE FITS YOUR DEVICE!
6869

6970
If you flashed the included Tasmota firmware file, it will broadcast a `tasmota-xxxx` access point (AP) when the device boots. Connect to this AP and open the browser to 192.168.4.1 to configure the device's Wi-Fi credentials. When entering the Wi-Fi password, click the checkbox to view the password you enter to ensure that it is correct and that your mobile device has not inadvertently capitalized the first letter if it is supposed to be lower case nor autocorrected what you entered. ~~Double~~ **Triple check the Wi-Fi credentials** before clicking **Save** to apply the settings.
7071

71-
If you flashed the included ESPurna firmware file, the procedure will be very similar. The device will broadcast a `ESPURNA-XXXXXX` access point. You will have to connect to it using the default password: `fibonacci`. Once connected open the browser to 192.168.4.1 and follow the initial configuration instructions. Then go to the WIFI tab and configure your home WiFi connection (remember to save) or go to the ADMIN tab to upgrade the firmware to the device-specific image.
72+
If you flashed the included ESPurna firmware file, the procedure will be very similar. The device will broadcast a `ESPURNA-XXXXXX` access point. You will have to connect to it using the default password: `fibonacci`. Once connected open the browser to 192.168.4.1 and follow the initial configuration instructions. Then go to the WIFI tab and configure your home WiFi connection (remember to save) or go to the ADMIN tab to upgrade the firmware to the device-specific image.
7273

7374
## USING DOCKER
7475
You may want to use a docker image instead. Advantage of this solution: You don't have to install anything on your host (except docker), everything goes into the docker image.
@@ -97,7 +98,7 @@ Run the image:
9798

9899
Stop the image:
99100
* docker-compose exec tuya stop
100-
* docker-compose down
101+
* docker-compose down
101102

102103
## CONTRIBUTING
103104

@@ -115,4 +116,3 @@ You can also give back by providing or improving documentation, tutorials, issue
115116
- [TuyAPI](https://github.com/codetheweb/tuyapi) NPM library for LAN control of Tuya devices with stock firmware
116117
- [TuyOTA](https://github.com/SynAckFin/TuyOTA) Perl based Tuya flashing script using a similar strategy
117118
- [MockTuyaCloud](https://github.com/kueblc/mocktuyacloud) Framework replicating much of the Tuya cloud functionality
118-

scripts/firmware_picker.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ while true; do
1313
# get short name
1414
filename=$(basename "$file")
1515
# skip files too large or too small
16-
filesize=$(stat -c%s "$file")
16+
filesize=$(stat -Lc%s "$file")
1717
[[ "$filesize" -gt 0x1000 && "$filesize" -le 0x80000 ]] || continue
1818
# skip files without magic byte
1919
[[ $(head -c 1 "$file") == "$MAGIC" ]] || continue

scripts/setup_ap.sh

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ version_check () {
1616
}
1717

1818
setup () {
19+
rfkill unblock wifi
20+
1921
wpa_supplicant_pid=$(pidof wpa_supplicant)
2022
if [ -n "$wpa_supplicant_pid" ]; then
2123
echo "Attempting to stop wpa_supplicant"

scripts/setup_checks.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ check_port () {
6767
port="$2"
6868
reason="$3"
6969
echo -n "Checking ${protocol^^} port $port... "
70-
process_pid=$(sudo ss -Hlnp -A "$protocol" "sport = :$port" | grep -Po "(?<=pid=)(\d+)" | head -n1)
70+
process_pid=$(sudo ss -lnp -A "$protocol" "sport = :$port" | grep -Po "(?<=pid=)(\d+)" | head -n1)
7171
if [ -n "$process_pid" ]; then
7272
process_name=$(ps -p "$process_pid" -o comm=)
7373
echo "Occupied by $process_name with PID $process_pid."
@@ -107,7 +107,7 @@ check_firewall () {
107107
echo "Attempting to stop firewalld.service"
108108
echo "When done, enable with: ${bold}sudo systemctl start firewalld.service${normal}"
109109
fi
110-
if sudo ufw status | grep -qw active; then
110+
if command -v ufw >/dev/null && sudo ufw status | grep -qw active; then
111111
sudo ufw disable
112112
echo "When done, enable with: ${bold}sudo ufw enable${normal}"
113113
fi

start_flash.sh

+6
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ while true; do
6969
echo "Waiting for the device to install the intermediate firmware"
7070

7171
i=120
72+
# !!! IMPORTANT !!!
73+
# Did your device get an IP address other than 10.42.42.42?
74+
# That is because it is not running the intermediate firmware
75+
# The intermediate firmware will request 10.42.42.42
76+
# Do NOT change this address!!!
77+
# It will NOT make it install and will break this script
7278
while ! ping -c 1 -W 1 -n 10.42.42.42 &> /dev/null; do
7379
printf .
7480
if (( --i == 0 )); then

0 commit comments

Comments
 (0)