[core] Prepare for project name change
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# LibreTuya
|
||||
# LibreTiny
|
||||
|
||||
<div align="center" markdown>
|
||||
|
||||
@@ -20,9 +20,9 @@ PlatformIO development platform for IoT modules manufactured by Tuya Inc.
|
||||
|
||||
The main goal of this project is to provide a usable build environment for IoT developers. While also providing vendor SDKs as PlatformIO cores,
|
||||
the project focuses on developing working Arduino-compatible cores for supported families. The cores are inspired by Espressif's official core for ESP32,
|
||||
which should make it easier to port/run existing ESP apps on Tuya IoT (and 3-rd party) modules.
|
||||
which should make it easier to port/run existing ESP apps on less-common, unsupported IoT modules.
|
||||
|
||||
**There's an [ESPHome port](https://docs.libretuya.ml/docs/projects/esphome/) based on LibreTuya, which supports BK7231 and RTL8710B chips.**
|
||||
**There's an [ESPHome port](https://docs.libretuya.ml/docs/projects/esphome/) based on LibreTiny, which supports BK7231 and RTL8710B chips.**
|
||||
|
||||
**Note:** this project is work-in-progress.
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* 🧑 Programmer's manual
|
||||
* [⚠️ Migration guide](docs/dev/migration_v1.0.0.md)
|
||||
* [🔋 PlatformIO Examples](examples/)
|
||||
* [📖 LibreTuya API](docs/dev/lt-api.md)
|
||||
* [📖 LibreTiny API](docs/dev/lt-api.md)
|
||||
* [C API](ltapi/dir_c7e317b16142bccc961a83c0babf0065.md)
|
||||
* [C++ API](ltapi/dir_930634efd5dc4a957bbb6e685a3ccda1.md)
|
||||
* 📚 Arduino Libraries
|
||||
|
||||
@@ -68,6 +68,7 @@ queue.AddLibrary(
|
||||
queue.AppendPublic(
|
||||
CPPDEFINES=[
|
||||
("LIBRETUYA_ARDUINO", 1),
|
||||
("LIBRETINY_ARDUINO", 1),
|
||||
("ARDUINO", 10812),
|
||||
("ARDUINO_SDK", 1),
|
||||
],
|
||||
|
||||
@@ -121,6 +121,7 @@ queue.AppendPublic(
|
||||
],
|
||||
CPPDEFINES=[
|
||||
("LIBRETUYA", 1),
|
||||
("LIBRETINY", 1),
|
||||
("LT_VERSION", env["LT_VERSION"]),
|
||||
("LT_BOARD", "${VARIANT}"),
|
||||
("LT_VARIANT_H", r"\"${VARIANT}.h\""),
|
||||
|
||||
@@ -112,7 +112,7 @@ def env_print_info(
|
||||
|
||||
# Print information about installed core versions
|
||||
print("PLATFORM VERSIONS:")
|
||||
print(" - libretuya @", env["LT_VERSION"])
|
||||
print(" - libretiny @", env["LT_VERSION"])
|
||||
print(" - ltchiptool @", get_version())
|
||||
# Print custom platformio.ini options
|
||||
if platform.custom_opts:
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "sys_rtos.h"
|
||||
#include "uart_pub.h"
|
||||
|
||||
// from LibreTuyaConfig.h
|
||||
// from lt_config.h
|
||||
#ifndef LT_MICROS_HIGH_RES
|
||||
#define LT_MICROS_HIGH_RES 1
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */
|
||||
|
||||
#include <libretuya.h>
|
||||
#include <libretiny.h>
|
||||
#include <sdk_private.h>
|
||||
|
||||
// can't include <flash.h> as it collides with <Flash.h> on Windows -_-
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-06-19. */
|
||||
|
||||
#include <libretuya.h>
|
||||
#include <libretiny.h>
|
||||
#include <sdk_private.h>
|
||||
|
||||
#include <fal.h>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-06-19. */
|
||||
|
||||
#include <libretuya.h>
|
||||
#include <libretiny.h>
|
||||
|
||||
#include <printf/printf.h>
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ class UpdateClass {
|
||||
const char *errorString();
|
||||
const char *getFirmwareName();
|
||||
const char *getFirmwareVersion();
|
||||
const char *getLibreTuyaVersion();
|
||||
const char *getLibreTinyVersion();
|
||||
const char *getBoardName();
|
||||
|
||||
private: /* UpdateUtil.cpp */
|
||||
|
||||
@@ -161,9 +161,9 @@ const char *UpdateClass::getFirmwareVersion() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get LibreTuya version from UF2 info.
|
||||
* @brief Get LibreTiny version from UF2 info.
|
||||
*/
|
||||
const char *UpdateClass::getLibreTuyaVersion() {
|
||||
const char *UpdateClass::getLibreTinyVersion() {
|
||||
if (info)
|
||||
return info->lt_version;
|
||||
return NULL;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @brief ESP Arduino Core compatibility class.
|
||||
*
|
||||
* This class only consists of inline functions, which
|
||||
* wrap the LibreTuya C API (lt_api.h). Refer to the docs of the C API
|
||||
* wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API
|
||||
* for more information.
|
||||
*
|
||||
* The class is accessible using the `ESP` global object.
|
||||
|
||||
@@ -15,15 +15,15 @@
|
||||
#define FlashId lt_flash_id_t
|
||||
|
||||
/**
|
||||
* @brief Main LibreTuya API class.
|
||||
* @brief Main LibreTiny API class.
|
||||
*
|
||||
* Since v1.0.0, this class only consists of inline functions, which
|
||||
* wrap the LibreTuya C API (lt_api.h). Refer to the docs of the C API
|
||||
* wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API
|
||||
* for more information.
|
||||
*
|
||||
* The class is accessible using the `LT` global object.
|
||||
*/
|
||||
class LibreTuya {
|
||||
class LibreTiny {
|
||||
public: /* lt_cpu.h */
|
||||
/** @copydoc lt_cpu_get_family() */
|
||||
inline ChipFamily getChipFamily() { return lt_cpu_get_family(); }
|
||||
@@ -109,6 +109,6 @@ class LibreTuya {
|
||||
inline uint32_t getMaxFreeBlockSize() { return lt_heap_get_max_alloc(); }
|
||||
};
|
||||
|
||||
extern LibreTuya LT;
|
||||
extern LibreTiny LT;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
* @brief Over-the-Air updates helper class.
|
||||
*
|
||||
* This class only consists of inline functions, which
|
||||
* wrap the LibreTuya C API (lt_api.h). Refer to the docs of the C API
|
||||
* wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API
|
||||
* for more information.
|
||||
*
|
||||
* The class is accessible using the `OTA` global object.
|
||||
*/
|
||||
class LibreTuyaOTA {
|
||||
class LibreTinyOTA {
|
||||
public: /* lt_ota.h */
|
||||
/** @copydoc lt_ota_get_type() */
|
||||
inline lt_ota_type_t getType() { return lt_ota_get_type(); }
|
||||
@@ -39,6 +39,6 @@ class LibreTuyaOTA {
|
||||
inline bool switchImage(bool revert = false) { return lt_ota_switch(revert); }
|
||||
};
|
||||
|
||||
extern LibreTuyaOTA OTA;
|
||||
extern LibreTinyOTA OTA;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
#include <Flash.h>
|
||||
|
||||
LibreTuya LT;
|
||||
LibreTuyaOTA OTA;
|
||||
LibreTuyaWDT WDT;
|
||||
LibreTiny LT;
|
||||
LibreTinyOTA OTA;
|
||||
LibreTinyWDT WDT;
|
||||
EspClass ESP;
|
||||
FlashClass Flash;
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
* @brief Watchdog control class.
|
||||
*
|
||||
* This class only consists of inline functions, which
|
||||
* wrap the LibreTuya C API (lt_api.h). Refer to the docs of the C API
|
||||
* wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API
|
||||
* for more information.
|
||||
*
|
||||
* The class is accessible using the `WDT` global object.
|
||||
*/
|
||||
class LibreTuyaWDT {
|
||||
class LibreTinyWDT {
|
||||
public: /* lt_wdt.h */
|
||||
/** @copydoc lt_wdt_enable() */
|
||||
inline bool enable(uint32_t timeout = 10000) { return lt_wdt_enable(timeout); }
|
||||
@@ -27,6 +27,6 @@ class LibreTuyaWDT {
|
||||
inline void feed() { lt_wdt_feed(); }
|
||||
};
|
||||
|
||||
extern LibreTuyaWDT WDT;
|
||||
extern LibreTinyWDT WDT;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// LibreTuya C API (with C standard libraries)
|
||||
#include <libretuya.h>
|
||||
// LibreTiny C API (with C standard libraries)
|
||||
#include <libretiny.h>
|
||||
|
||||
// Additional C libraries
|
||||
#include <sys/time.h>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <libretuya.h>
|
||||
#include <libretiny.h>
|
||||
|
||||
/**
|
||||
* @brief Get CPU family ID (as lt_cpu_family_t enum member).
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <libretuya.h>
|
||||
#include <libretiny.h>
|
||||
|
||||
/**
|
||||
* @brief Get LibreTuya version string.
|
||||
* @brief Get LibreTiny version string.
|
||||
*/
|
||||
const char *lt_get_version();
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <libretuya.h>
|
||||
#include <libretiny.h>
|
||||
|
||||
/**
|
||||
* @brief Read flash chip ID and return a lt_flash_id_t struct.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <libretuya.h>
|
||||
#include <libretiny.h>
|
||||
|
||||
/**
|
||||
* @brief Initialize the family core (optional).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <libretuya.h>
|
||||
#include <libretiny.h>
|
||||
|
||||
/**
|
||||
* @brief Get total RAM size.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <libretuya.h>
|
||||
#include <libretiny.h>
|
||||
#include <uf2ota/uf2types.h>
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <libretuya.h>
|
||||
#include <libretiny.h>
|
||||
|
||||
// https://stackoverflow.com/a/3437484
|
||||
#define MAX(a, b) \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <libretuya.h>
|
||||
#include <libretiny.h>
|
||||
|
||||
/**
|
||||
* @brief Enable the hardware watchdog.
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
// #define FDB_BIG_ENDIAN
|
||||
|
||||
#if LT_DEBUG_FDB
|
||||
#include <libretuya.h>
|
||||
#include <libretiny.h>
|
||||
#include <printf/printf.h>
|
||||
#define FDB_PRINT(...) __wrap_printf(__VA_ARGS__)
|
||||
#define FDB_DEBUG_ENABLE
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
// LibreTuya version macros
|
||||
// LibreTiny version macros
|
||||
#ifndef LT_VERSION
|
||||
#define LT_VERSION 1.0.0
|
||||
#endif
|
||||
@@ -28,7 +28,7 @@
|
||||
#define GCC_VERSION_STR \
|
||||
STRINGIFY_MACRO(__GNUC__) "." STRINGIFY_MACRO(__GNUC_MINOR__) "." STRINGIFY_MACRO(__GNUC_PATCHLEVEL__)
|
||||
#define LT_BANNER_STR \
|
||||
"LibreTuya v" LT_VERSION_STR " on " LT_BOARD_STR ", compiled at " __DATE__ " " __TIME__ ", GCC " GCC_VERSION_STR \
|
||||
"LibreTiny v" LT_VERSION_STR " on " LT_BOARD_STR ", compiled at " __DATE__ " " __TIME__ ", GCC " GCC_VERSION_STR \
|
||||
" (-O" STRINGIFY_MACRO(__OPTIMIZE_LEVEL__) ")"
|
||||
|
||||
// Functional macros
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// This file collects all LibreTuya C API includes.
|
||||
// This file collects all LibreTiny C API includes.
|
||||
// The functions are implemented in lt_api.c, which is located
|
||||
// in the common core, and in the family cores.
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ static const uint8_t colors[] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
#if LIBRETUYA_ARDUINO
|
||||
#if LIBRETINY_ARDUINO
|
||||
unsigned long millis(void);
|
||||
#endif
|
||||
|
||||
@@ -61,7 +61,7 @@ void lt_log(const uint8_t level, const char *format, ...) {
|
||||
return;
|
||||
|
||||
#if LT_LOGGER_TIMESTAMP
|
||||
#if LIBRETUYA_ARDUINO
|
||||
#if LIBRETINY_ARDUINO
|
||||
float seconds = millis() / 1000.0f;
|
||||
#elif LT_HAS_FREERTOS
|
||||
float seconds = xTaskGetTickCount() * portTICK_PERIOD_MS / 1000.0f;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <libretuya.h>
|
||||
#include <libretiny.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-06-19. */
|
||||
|
||||
#include <libretuya.h>
|
||||
#include <libretiny.h>
|
||||
|
||||
#include <fal.h>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */
|
||||
|
||||
#include <libretuya.h>
|
||||
#include <libretiny.h>
|
||||
#include <sdk_private.h>
|
||||
|
||||
extern uint32_t GlobalDebugEnable;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-05-24. */
|
||||
|
||||
#include <libretuya.h>
|
||||
#include <libretiny.h>
|
||||
#include <sdk_private.h>
|
||||
|
||||
#include <fal.h>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2022-06-19. */
|
||||
|
||||
#include <libretuya.h>
|
||||
#include <libretiny.h>
|
||||
|
||||
#include <printf/printf.h>
|
||||
|
||||
|
||||
@@ -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`
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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"
|
||||
%}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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).
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ By using a simple TUI (text user interface), you can check which I/O pins corres
|
||||
|
||||
Uploading the example and opening up a terminal (e.g. PuTTY) presents this menu:
|
||||
```
|
||||
LibreTuya v0.8.0, PinScan v1.0
|
||||
LibreTiny v0.8.0, PinScan v1.0
|
||||
Board: cb2s
|
||||
I/O count: 11
|
||||
Digital I/O count: 11
|
||||
|
||||
@@ -7,7 +7,7 @@ void printHelp(uint8_t mode) {
|
||||
switch (mode) {
|
||||
case '\0':
|
||||
stream->setTimeout(10000);
|
||||
stream->println("LibreTuya v" LT_VERSION_STR ", PinScan v" EXAMPLE_VER);
|
||||
stream->println("LibreTiny v" LT_VERSION_STR ", PinScan v" EXAMPLE_VER);
|
||||
stream->println("Board: " LT_BOARD_STR);
|
||||
stream->print("I/O count: ");
|
||||
stream->println(PINS_COUNT);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
site_name: LibreTuya
|
||||
site_name: LibreTiny
|
||||
docs_dir: .
|
||||
|
||||
site_url: https://docs.libretuya.ml/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "libretuya",
|
||||
"title": "LibreTuya",
|
||||
"description": "Free your Tuya IoT modules.",
|
||||
"title": "LibreTiny",
|
||||
"description": "PlatformIO development platform for IoT modules",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/kuba2k2/platformio-libretuya"
|
||||
|
||||
@@ -363,7 +363,7 @@ class LibretuyaPlatform(PlatformBase):
|
||||
if debug_tool == "custom":
|
||||
return
|
||||
exc = DebugInvalidOptionsError(
|
||||
f"[LibreTuya] Debug tool {debug_tool} is not supported by board {board}."
|
||||
f"[LibreTiny] Debug tool {debug_tool} is not supported by board {board}."
|
||||
)
|
||||
exc.MESSAGE = ""
|
||||
raise exc
|
||||
|
||||
Reference in New Issue
Block a user