Set up Environment
Overviewâ
Prepare necessary tools on different systems, such as Linux, Windows, and macOS.
Prepare hardwareâ
Before getting started, prepare the following resources:
- TuyaOpen-compatible development boards or modules
- USB data cable
- Computer (Windows, Linux, or macOS supported)
Set up environmentâ
It is recommended to use the LTS versions of Ubuntu 24, 22, and 20.
Install the necessary tools:
sudo apt-get install lcov cmake-curses-gui build-essential ninja-build wget git python3 python3-pip python3-venv libc6-i386 libsystemd-dev
Download and activate TuyaOpenâ
Download the TuyaOpen repository:
# Use GitHub
git clone https://github.com/tuya/TuyaOpen.git
# Or use Gitee
git clone https://gitee.com/tuya-open/TuyaOpen.git
cd TuyaOpen
Activate tos.py
:
. ./export.sh
Run the commands tos.py version
and tos.py check
to verify. You will see the following information:
⯠tos.py version
[INFO]: Running tos.py ...
[INFO]: v1.3.0
⯠tos.py check
[INFO]: Running tos.py ...
[INFO]: [git] (2.43.0 >= 2.0.0) is ok.
[INFO]: [cmake] (4.0.2 >= 3.28.0) is ok.
[INFO]: [make] (4.3 >= 3.0.0) is ok.
[INFO]: [ninja] (1.11.1 >= 1.6.0) is ok.
[INFO]: Downloading submodules...
[INFO]: [do subprocess]: cd /home/huatuo/work/open/TuyaOpen && git submodule update --init
[INFO]: Download submodules successfully.
If the check command fails:
# Tool validation failed. Please install or upgrade the required tools.
# Submodules download failed. Manually execute the git command.
git submodule update --init
Run the following command to deactivate tos.py
:
deactivate
You can run the command tos.py --help
to view a more detailed description of tos.py
, or refer to the tos.py Guide.
FAQsâ
Failed to activate tos.py
â
-
If activation failed, it may be because
python3-venv
is not installed. Install it and try again.sudo apt-get install python3-venv
-
When
tos.py
is activated, the./.venv
directory will be created automatically. If activation failed, you need to delete the./.venv
directory and re-activate it.