/libretuya

PlatformIO development platform for IoT modules

Primary LanguageCMIT LicenseMIT

LibreTuya

GitHub Workflow Status GitHub last commit

Code style: clang-format Code style: black

Discord PlatformIO Registry

RTL8710BN BK7231

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.

There's an ESPHome port based on LibreTuya, which supports BK7231 and RTL8710B chips.

Note: this project is work-in-progress.

Usage

  1. Install PlatformIO
  2. platformio platform install https://github.com/kuba2k2/libretuya
  3. Create a project, build it and upload!
  4. See the docs for any questions/problems.

Arduino Core support status

Note: this list will probably change with each functionality update.

  realtek-ambz beken-72xx
Core functions ✔️ ✔️
GPIO/PWM/IRQ ✔️/✔️/✔️ ✔️/✔️/✔️
Analog input (ADC) ✔️ ✔️
Serial ✔️ ✔️
Serial (extra) 0, 1, 2 1, 2
Flash I/O ✔️ ✔️
CORE LIBRARIES
SoftwareSerial ✔️
SPI
Wire
OTHER LIBRARIES
Wi-Fi STA/AP/Mixed ✔️ ✔️
Wi-Fi Events ✔️ ✔️
TCP Client (SSL) ✔️ (✔️) ✔️ ()
TCP Server ✔️ ✔️
IPv6
HTTP Client (SSL) ✔️ (✔️)
HTTP Server ✔️ ✔️
NVS / Preferences
SPIFFS
BLE -
NTP
OTA ✔️ ✔️
MDNS ✔️ ✔️
MQTT
SD

Symbols:

  • ✔️ working
  • tested, external library
  • untested
  • broken
  • not implemented (yet?)
  • - not applicable

Names:

  • Core functions - stuff like delay(), millis(), yield(), etc.
  • CORE LIBRARIES - included normally in all Arduino cores
  • OTHER LIBRARIES - included in ESP32 core or downloadable

License

See LICENSE. Project is licensed under MIT License.

Parts of the code may come from third parties, vendor SDKs or other open-source projects. Most of these files are marked with appropriate copyright/author/license notices.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.