Skip to content

Commit 1325cca

Browse files
authored
Release v2.4.0
2 parents dbeab1b + 4ed300f commit 1325cca

17 files changed

+502
-412
lines changed

Dockerfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM phusion/baseimage:0.11
2+
3+
RUN apt-get update && apt-get install -y sudo iproute2 iputils-ping
4+
5+
RUN echo '* libraries/restart-without-asking boolean true' | sudo debconf-set-selections
6+
7+
COPY docker/bin /usr/bin/
8+
9+
COPY . /usr/bin/tuya-convert
10+
11+
RUN cd /usr/bin/tuya-convert && ./install_prereq.sh
12+
13+
RUN mkdir -p /etc/service/tuya && cd /etc/service/tuya && ln -s /usr/bin/config.sh run

README.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ These scripts were tested in
3232
* a Raspberry Pi 3B / 3B+ with Raspbian Stretch and its internal Wifi chip
3333
* a Raspberry Pi 3B+ + USB-WIFI with this image from [here](https://www.offensive-security.com/kali-linux-arm-images/)
3434
https://images.offensive-security.com/arm-images/kali-linux-2018.4a-rpi3-nexmon-64.img.xz
35+
* 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
3536

3637
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.
3738

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

51-
Currently a Tasmota [v7.0.0.3](https://github.com/arendst/Tasmota/releases) `tasmota-wifiman.bin` build is included. You can update to a [current version](http://thehackbox.org/tasmota) via OTA after the Tuya-Convert process completes successfully. Please note that while we include this for your convenience, we are not affiliated with the Tasmota project and cannot provide support for post installation issues. Please refer to [the respective project](https://github.com/arendst/Tasmota) for configuration and support.
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.
5253

5354
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.
5455

@@ -69,6 +70,35 @@ BE SURE THE FIRMWARE FITS YOUR DEVICE!
6970

7071
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.
7172

73+
## USING DOCKER
74+
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.
75+
Requirements:
76+
* Linux computer with a wifi adapter
77+
* Secondary wifi device (e.g. smartphone)
78+
* docker is installed
79+
* docker-compose is installed
80+
81+
Create docker image:
82+
* git clone https://github.com/ct-Open-Source/tuya-convert
83+
* cd tuya-convert
84+
* docker build -t tuya:latest .
85+
86+
Setup docker-compose:
87+
* copy docker/docker-compose.sample.yml to a new folder you created, the file should be named docker-compose.yml
88+
* you may adjust this docker-compose.yml, if necessary:
89+
* environment-variables may be different, for example network-adapter may be different from wlan0
90+
* adjust the volume folder, where you want your backups stored
91+
92+
Run the image:
93+
* go into the folder you copied docker-compose.yml
94+
* docker-compose up -d
95+
* docker-compose exec tuya start
96+
* tuya-convert now starts within docker
97+
98+
Stop the image:
99+
* docker-compose exec tuya stop
100+
* docker-compose down
101+
72102
## CONTRIBUTING
73103

74104
This project is currently maintained by Colin Kuebler @kueblc

docker/bin/config.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
echo WLAN=$WLAN >/usr/bin/tuya-convert/config.txt
3+
echo AP=$AP >>/usr/bin/tuya-convert/config.txt
4+
echo GATEWAY=$GATEWAY >>/usr/bin/tuya-convert/config.txt

docker/bin/start

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
cd /usr/bin/tuya-convert
3+
./start_flash.sh

docker/bin/stop

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
cd /usr/bin/tuya-convert
3+
./stop_flash.sh

docker/docker-compose.sample.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: '3'
2+
services:
3+
tuya:
4+
image: tuya:latest
5+
privileged: true
6+
network_mode: "host"
7+
environment:
8+
- WLAN=wlan0
9+
- AP=vtrust-flash
10+
- GATEWAY=10.42.42.1
11+
volumes:
12+
- ./data/backups:/usr/bin/tuya-convert/backups

files/tasmota.bin

6.66 KB
Binary file not shown.

install_prereq.sh

+2-12
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,8 @@
33
set -e
44

55
sudo apt-get update
6-
sudo apt-get install -y git iw dnsmasq hostapd screen curl build-essential python-pip python3-pip python-setuptools python3-setuptools python-wheel python3-wheel python-dev python3-dev mosquitto haveged net-tools libssl-dev
6+
sudo apt-get install -y git iw dnsmasq hostapd screen curl build-essential python3-pip python3-setuptools python3-wheel python3-dev mosquitto haveged net-tools libssl-dev
77

8-
PY3_DEPENDENCIES="paho-mqtt pyaes tornado git+https://github.com/M4dmartig4n/sslpsk.git pycrypto"
9-
PY2_DEPENDENCIES="git+https://github.com/M4dmartig4n/sslpsk.git pycrypto"
10-
11-
if python3 -c 'import sys; exit(0) if sys.version_info.major == 3 and sys.version_info.minor < 7 else exit(1)' ;
12-
then
13-
sudo -H pip3 install $PY3_DEPENDENCIES
14-
sudo -H pip2 install $PY2_DEPENDENCIES
15-
else
16-
sudo -H python3 -m pip install $PY3_DEPENDENCIES
17-
sudo -H python2 -m pip install $PY2_DEPENDENCIES
18-
fi
8+
sudo -H python3 -m pip install paho-mqtt tornado git+https://github.com/drbild/sslpsk.git@use-byte-string-for-identity-hints pycryptodomex
199

2010
echo "Ready to start upgrade"

0 commit comments

Comments
 (0)