[core] Prepare for project name change

This commit is contained in:
Kuba Szczodrzyński
2023-04-24 11:35:39 +02:00
parent 85a687fc56
commit 461e4c6df0
56 changed files with 105 additions and 103 deletions

View File

@@ -31,7 +31,7 @@ custom_versions.lwip = 2.1.3
custom_versions.beken_bdk = 2021.06.07
```
## LibreTuya options
## LibreTiny options
!!! note
See [lt_config.h](../../ltapi/lt__config_8h.md) for most options and their defaults.
@@ -48,7 +48,7 @@ build_flags =
### Logger
- `LT_LOGGER` (1) - enable/disable LibreTuya logger globally; disabling this sets the loglevel to `LT_LEVEL_NONE` - the logger can't be enabled even by using `lt_log_set_port()`
- `LT_LOGGER` (1) - enable/disable LibreTiny logger globally; disabling this sets the loglevel to `LT_LEVEL_NONE` - the logger can't be enabled even by using `lt_log_set_port()`
- `LT_LOGLEVEL` - global LT loglevel:
- `LT_LEVEL_VERBOSE`

View File

@@ -1,6 +1,6 @@
# Libraries
A page outlining 3-rd some party libraries compatible with LibreTuya.
A page outlining 3-rd some party libraries compatible with LibreTiny.
!!! note
To use some (most? (all?)) of these, a flag in `platformio.ini` is required to disable compatibility checks (because most libs are meant for ESP32/Arduino official framework):

View File

@@ -1,6 +1,6 @@
# LibreTuya API
# LibreTiny API
The LibreTuya API is divided in two parts:
The LibreTiny API is divided in two parts:
- the C API, available in all families and frameworks
- the C++ API, available in the Arduino framework only.
@@ -13,7 +13,7 @@ It's recommended to use the C API wherever possible.
This API is available using:
- `#include <libretuya.h>`
- `#include <libretiny.h>`
- `#include <Arduino.h>`
### CPU
@@ -96,44 +96,44 @@ This API is available using:
- `#include <Arduino.h>`
### LibreTuya
### LibreTiny
{%
include-markdown "../../ltapi/class_libre_tuya.md"
include-markdown "../../ltapi/class_libre_tiny.md"
start="# Detailed Description\n"
end="## Public Functions Documentation"
%}
{%
include-markdown "../../ltapi/class_libre_tuya.md"
include-markdown "../../ltapi/class_libre_tiny.md"
start="## Public Functions\n"
end="# Detailed Description"
%}
### LibreTuyaOTA
### LibreTinyOTA
{%
include-markdown "../../ltapi/class_libre_tuya_o_t_a.md"
include-markdown "../../ltapi/class_libre_tiny_o_t_a.md"
start="# Detailed Description\n"
end="## Public Functions Documentation"
%}
{%
include-markdown "../../ltapi/class_libre_tuya_o_t_a.md"
include-markdown "../../ltapi/class_libre_tiny_o_t_a.md"
start="## Public Functions\n"
end="# Detailed Description"
%}
### LibreTuyaWDT
### LibreTinyWDT
{%
include-markdown "../../ltapi/class_libre_tuya_w_d_t.md"
include-markdown "../../ltapi/class_libre_tiny_w_d_t.md"
start="# Detailed Description\n"
end="## Public Functions Documentation"
%}
{%
include-markdown "../../ltapi/class_libre_tuya_w_d_t.md"
include-markdown "../../ltapi/class_libre_tiny_w_d_t.md"
start="## Public Functions\n"
end="# Detailed Description"
%}

View File

@@ -1,6 +1,6 @@
# UF2-based OTA
LibreTuya's OTA updating is based on [Microsoft's UF2 specification](https://microsoft.github.io/uf2/). Some aspects of the process, such as OTA1/2 support and target partition selection, have been customized with extension tags.
LibreTiny's OTA updating is based on [Microsoft's UF2 specification](https://microsoft.github.io/uf2/). Some aspects of the process, such as OTA1/2 support and target partition selection, have been customized with extension tags.
!!! note
Just like in UF2, all values in this format are little-endian.

View File

@@ -1,6 +1,6 @@
# uf2ota library
uf2ota library allows to write a LibreTuya UF2 file to the flash, while parsing all the necessary tags. It manages the target partitions, compatibility checks, and works on top of the FAL provided by FlashDB.
uf2ota library allows to write a LibreTiny UF2 file to the flash, while parsing all the necessary tags. It manages the target partitions, compatibility checks, and works on top of the FAL provided by FlashDB.
## Usage example

View File

@@ -1,6 +1,6 @@
# uf2ota.py
This is a tool for converting LibreTuya firmware images to UF2 format for OTA updates.
This is a tool for converting LibreTiny firmware images to UF2 format for OTA updates.
```console
$ python uf2ota.py
@@ -51,7 +51,7 @@ Tags:
- FIRMWARE: esphome
- VERSION: 2022.6.0-dev
- OTA_VERSION: 01
- DEVICE: LibreTuya
- DEVICE: LibreTiny
- LT_HAS_OTA1: 01
- LT_HAS_OTA2: 01
- LT_PART_1: ota1
@@ -63,7 +63,7 @@ Total binary size: 302448
# dump
Dump UF2 file (only LibreTuya format) into separate firmware binaries.
Dump UF2 file (only LibreTiny format) into separate firmware binaries.
```console
$ python uf2ota.py dump out.uf2

View File

@@ -6,11 +6,11 @@ arduino/
│ ├─ cores/ Wiring core files
│ ├─ libraries/ Supported built-in family libraries
│ ├─ port/ External library port units
├─ libretuya/
├─ libretiny/
│ ├─ api/ Library interfaces
│ ├─ common/ Units common to all families
│ ├─ compat/ Fixes for compatibility with ESP32 framework
│ ├─ core/ LibreTuya API for Arduino cores
│ ├─ core/ LibreTiny API for Arduino cores
│ ├─ libraries/ Built-in family-independent libraries
| ├─ port/ External library port units
| ├─ posix/ POSIX-like C utility functions
@@ -26,7 +26,7 @@ builder/
│ ├─ <family name>-arduino.py Arduino Core build system
├─ libs/ Builders for external libraries
├─ utils/ SCons utils used during the build
├─ arduino-common.py Builder to provide ArduinoCore-API and LibreTuya APIs
├─ arduino-common.py Builder to provide ArduinoCore-API and LibreTiny APIs
├─ main.py Main PlatformIO builder
docs/ Project documentation, guides, tips, etc.
platform/

View File

@@ -13,7 +13,7 @@ ESPHome can be flashed in few different ways, depending on your needs.
=== "CLI"
The flasher program built-in LibreTuya is also available for ESPHome.
The flasher program built-in LibreTiny is also available for ESPHome.
- use `python -m esphome run yourdevice.yml` to recompile AND upload the firmware
- use `python -m esphome upload yourdevice.yml` to upload without recompiling

View File

@@ -1,6 +1,6 @@
# Flashing PlatformIO projects
PlatformIO projects developed with LibreTuya can be flashed just like any other PIO project.
PlatformIO projects developed with LibreTiny can be flashed just like any other PIO project.
!!! abstract
All binary files generated by PlatformIO will be in `.pio/build/<my_board>/`. The methods described below may require you to get a file from that directory.
@@ -9,7 +9,7 @@ PlatformIO projects developed with LibreTuya can be flashed just like any other
## Built-in flasher
LibreTuya has a built-in firmware uploader, based on [ltchiptool](tools/ltchiptool.md). Pressing `Upload` in PlatformIO IDE does all the work for you.
LibreTiny has a built-in firmware uploader, based on [ltchiptool](tools/ltchiptool.md). Pressing `Upload` in PlatformIO IDE does all the work for you.
If you have more than one COM port, configure your PIO project first:

View File

@@ -7,7 +7,7 @@ This feature allows to upload code using UART, without needing to ground the CEN
It is enabled by default (using the `LT_AUTO_DOWNLOAD_REBOOT` option). It works by listening to incoming UART data, and checking if it matches a command that the flashing program would send. If it does, a chip reboot is performed and the uploading process starts.
!!! note
ADR will only work if there's already a recent build of LibreTuya flashed to the device (and if the device doesn't bootloop or freeze immediately).
ADR will only work if there's already a recent build of LibreTiny flashed to the device (and if the device doesn't bootloop or freeze immediately).
## Beken 72xx

View File

@@ -22,7 +22,7 @@ If your device doesn't have a profile yet, it will probably not work. You can co
### Firmware building
1. [Compile ESPHome](../../projects/esphome.md), or your custom firmware based on LibreTuya.
1. [Compile ESPHome](../../projects/esphome.md), or your custom firmware based on LibreTiny.
2. Get the firmware binary, named `bk7231x_app.ota.ug.bin` from the build directory (`.pio/build/<board>/` or `.esphome/build/<board>/.pioenvs/<board>/`).
3. Put it in the `custom-firmware` directory of tuya-cloudcutter.

View File

@@ -62,7 +62,7 @@ It is a good idea to dump the stock firmware (full flash contents) of your devic
If you want to flash custom firmware, or restore stock firmware from a previously dumped file, follow the steps below.
!!! info
LibreTuya generates multiple firmware files in the build directory. **You usually want to flash the `.uf2` file**, but since ltchiptool can detect file types, you can choose a different firmware file and it'll tell you if that works.
LibreTiny generates multiple firmware files in the build directory. **You usually want to flash the `.uf2` file**, but since ltchiptool can detect file types, you can choose a different firmware file and it'll tell you if that works.
1. Choose `Write flash`. Click `Browse` and select a valid firmware file. The file type and chip type will be auto-detected, along with correct flash offset and length. No need to worry about overwriting the bootloader anymore!
2. Connect the chip to your PC, according to the [chip connection guides](../chip-connection/SUMMARY.md). Select the COM port that your UART adapter is using.
@@ -135,7 +135,7 @@ Tags:
- FIRMWARE: arduinotest
- VERSION: 22.08.01
- OTA_VERSION: 01
- DEVICE: LibreTuya
- DEVICE: LibreTiny
- BUILD_DATE: 6d08e862
- LT_HAS_OTA1: 01
- LT_HAS_OTA2: 00

View File

@@ -1,6 +1,6 @@
# Getting started
Using LibreTuya is simple, just like every other PlatformIO development platform.
Using LibreTiny is simple, just like every other PlatformIO development platform.
1. [Install PlatformIO](https://platformio.org/platformio-ide)
2. `platformio platform install -f https://github.com/kuba2k2/libretuya`
@@ -15,11 +15,11 @@ Using LibreTuya is simple, just like every other PlatformIO development platform
## Run community projects
LibreTuya was developed with popular community projects in mind. Currently, unofficial [ESPHome port](../projects/esphome.md) is available ([the PR](https://github.com/esphome/esphome/pull/3509) will hopefully be merged into upstream at some point).
LibreTiny was developed with popular community projects in mind. Currently, unofficial [ESPHome port](../projects/esphome.md) is available ([the PR](https://github.com/esphome/esphome/pull/3509) will hopefully be merged into upstream at some point).
## Develop your own project
If you're developing your own embedded software, and want it to run on LibreTuya-supported chips, create a project.
If you're developing your own embedded software, and want it to run on LibreTiny-supported chips, create a project.
- use PlatformIO IDE (PIO Home -> Open -> New Project)
- run `pio project init` in your desired project directory
@@ -28,7 +28,7 @@ Next, read one of the [flashing guides](../flashing/SUMMARY.md) to run your proj
### LT configuration
LibreTuya has a few configuration options that change its behavior or features. Refer to [LT configuration](../dev/config.md) for details.
LibreTiny has a few configuration options that change its behavior or features. Refer to [LT configuration](../dev/config.md) for details.
### GPIO usage - important change

View File

@@ -41,7 +41,7 @@ Note that the download mode can only be activated when the flasher is running (t
## Auto-download-reboot
If you have a recent version of LibreTuya installed on the chip, you can use [Auto-download-reboot](../../flashing/tools/adr.md) to reboot the chip automatically. This is enabled by default, so you don't have to change anything.
If you have a recent version of LibreTiny installed on the chip, you can use [Auto-download-reboot](../../flashing/tools/adr.md) to reboot the chip automatically. This is enabled by default, so you don't have to change anything.
## Single-adapter usage

View File

@@ -4,13 +4,13 @@ Debugging of Realtek Ameba chips is possible and was tested with OpenOCD running
*(the following is applicable to Arduino framework, and was not tested with SDK framework)*
LibreTuya has ready-to-use OpenOCD config files:
LibreTiny has ready-to-use OpenOCD config files:
- [platform/realtek-ambz/openocd/amebaz.cfg](../../../cores/realtek-ambz/misc/amebaz.cfg)
## Local debugger
It should be possible to use PlatformIO's built-in debugging capabilities directly, when plugging an OpenOCD-compatible debugger into your PC. As there are no debugger interfaces built into Tuya boards, you need to specify your interface of choice in `platformio.ini`:
It should be possible to use PlatformIO's built-in debugging capabilities directly, when plugging an OpenOCD-compatible debugger into your PC. As there are no debugger interfaces built into these IoT boards, you need to specify your interface of choice in `platformio.ini`:
```ini
[env:my_board]
openocd_interface = <interface name>

View File

@@ -2,13 +2,13 @@
Because ESPHome does not natively support running on non-ESP chips, you need to use a fork of the project.
There are two basic ways to install and use LibreTuya-ESPHome. You can choose the option that best suits you:
There are two basic ways to install and use LibreTiny-ESPHome. You can choose the option that best suits you:
- command line (CLI) - for more experienced users; compilation using CLI commands, somewhat easier to troubleshoot
- ESPHome Dashboard (GUI) - for new users, might be an easy way to go; config management & compilation using web-based dashboard
!!! tip
You can use LibreTuya-ESPHome for ESP32/ESP8266 compilation as well - the forked version *extends* the base, and doesn't remove any existing features. Keep in mind that you might not have latest ESPHome updates until the fork gets updated (which usually happens at most every few weeks).
You can use LibreTiny-ESPHome for ESP32/ESP8266 compilation as well - the forked version *extends* the base, and doesn't remove any existing features. Keep in mind that you might not have latest ESPHome updates until the fork gets updated (which usually happens at most every few weeks).
## Find your device's board
@@ -23,7 +23,7 @@ If your board isn't listed, use one of the **Generic** boards, depending on the
!!! important
Read [Getting started](../getting-started/README.md) first - most importantly, the first part about installation.
**It is very important that you have the latest version of LibreTuya installed** (not `libretuya-esphome` - this is a different thing!) **so that you don't face issues that are already resolved**.
**It is very important that you have the latest version of LibreTiny installed** (not `libretiny-esphome` - this is a different thing!) **so that you don't face issues that are already resolved**.
Assuming you have PlatformIO, git and Python installed:
@@ -44,15 +44,15 @@ If your board isn't listed, use one of the **Generic** boards, depending on the
1. `git clone https://github.com/kuba2k2/libretuya-esphome` (or download the .ZIP and unpack it, not recommended)
2. Open a terminal/cmd.exe in the cloned directory (`libretuya-esphome`).
3. `python docker/build.py --tag libretuya --arch amd64 --build-type docker build` - this will build the Docker image of ESPHome. Change `amd64` to something else if you're using a Raspberry Pi.
3. `python docker/build.py --tag libretiny --arch amd64 --build-type docker build` - this will build the Docker image of ESPHome. Change `amd64` to something else if you're using a Raspberry Pi.
4. Create a `docker-compose.yml` file in the same directory:
```yaml title="docker-compose.yml"
version: "3"
services:
esphome:
container_name: esphome-libretuya
image: esphome/esphome-amd64:libretuya # (2)!
container_name: esphome-libretiny
image: esphome/esphome-amd64:libretiny # (2)!
volumes:
- ./configs:/config:rw # (1)!
- /etc/localtime:/etc/localtime:ro
@@ -76,7 +76,7 @@ If your board isn't listed, use one of the **Generic** boards, depending on the
esphome:
name: yourdevice
libretuya:
libretiny:
board: wr3 # THIS IS YOUR BOARD CODE
framework:
version: latest
@@ -102,7 +102,7 @@ If your board isn't listed, use one of the **Generic** boards, depending on the
- `New Device`
- `Continue`
- enter name and WiFi details
- choose `LibreTuya`
- choose `LibreTiny`
- choose the board that you found before
- select `Skip`
3. A new config file will be added. Press `Edit` and proceed to the next section.
@@ -133,10 +133,10 @@ Now, refer to the [flashing guide](../flashing/esphome.md) to learn how to uploa
!!! note
This part is for advanced users. You'll probably be fine with the default options.
All options from [Options & config](../dev/config.md) can be customized in the `libretuya:` block:
All options from [Options & config](../dev/config.md) can be customized in the `libretiny:` block:
```yaml title="yourdevice.yml"
libretuya:
libretiny:
framework:
version: latest
lt_config:
@@ -149,7 +149,7 @@ libretuya:
Additionally, few options have their dedicated keys:
```yaml title="yourdevice.yml"
libretuya:
libretiny:
framework:
version: latest
# verbose/trace/debug/info/warn/error/fatal

View File

@@ -24,7 +24,7 @@ If you have an unsupported chip, feel free to reach out using Issues or on the D
A list of chip families currently supported by this project.
!!! note
The term *family* was chosen over *platform*, in order to reduce possible confusion between LibreTuya supported "platforms" and PlatformIO's "platform", as an entire package. *Family* is also more compatible with the UF2 term.
The term *family* was chosen over *platform*, in order to reduce possible confusion between LibreTiny supported "platforms" and PlatformIO's "platform", as an entire package. *Family* is also more compatible with the UF2 term.
The following list corresponds to UF2 OTA format family names, and is also [available as JSON](../../families.json). The IDs are also present in [lt_Types.h](../../ltapi/lt__types_8h.md).