Skip to content

Commit 338f87b

Browse files
Merge pull request #187 from libretiny-eu/feature/libretiny-support
Add LibreTiny support
2 parents b458d86 + 27f4a0a commit 338f87b

File tree

51 files changed

+208
-94
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+208
-94
lines changed

.github/workflows/build-libretiny.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
3+
name: Build (LibreTiny)
4+
5+
on:
6+
workflow_dispatch:
7+
push:
8+
branches:
9+
- main
10+
- release/*
11+
pull_request:
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
platformio-libretiny:
19+
name: LibreTiny (pio)
20+
runs-on: ubuntu-latest
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
board:
25+
- generic-bk7231n-qfn32-tuya
26+
- generic-rtl8710bn-2mb-788k
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Cache PlatformIO
33+
uses: actions/cache@v4
34+
with:
35+
key: ${{ runner.os }}-pio
36+
path: |
37+
~/.cache/pip
38+
~/.platformio
39+
40+
- name: Python
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version: "3.x"
44+
45+
- name: Install PIO
46+
run: |
47+
python -m pip install --upgrade pip
48+
pip install --upgrade platformio
49+
50+
- name: Build Examples
51+
run: |
52+
for i in AsyncResponseStream Auth Headers; do
53+
echo "============================================================="
54+
echo "Building examples/$i..."
55+
echo "============================================================="
56+
PLATFORMIO_SRC_DIR=examples/$i PIO_BOARD=${{ matrix.board }} pio run -e ci-libretiny
57+
done

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,19 @@ lib_deps =
7272
ESP32Async/ESPAsyncWebServer
7373
```
7474

75+
### LibreTiny (BK7231N/T, RTL8710B, etc.)
76+
77+
Version 1.9.1 or newer is required.
78+
79+
```ini
80+
[env:stable]
81+
platform = libretiny @ ^1.9.1
82+
lib_ldf_mode = chain
83+
lib_deps =
84+
ESP32Async/AsyncTCP
85+
ESP32Async/ESPAsyncWebServer
86+
```
87+
7588
### Unofficial dependencies
7689

7790
**AsyncTCPSock**

examples/AsyncResponseStream/AsyncResponseStream.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Copyright 2016-2025 Hristo Gochkov, Mathieu Carbou, Emil Muratov
33

44
#include <DNSServer.h>
5-
#ifdef ESP32
5+
#if defined(ESP32) || defined(LIBRETINY)
66
#include <AsyncTCP.h>
77
#include <WiFi.h>
88
#elif defined(ESP8266)
@@ -20,7 +20,7 @@ static AsyncWebServer server(80);
2020
void setup() {
2121
Serial.begin(115200);
2222

23-
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
23+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI
2424
WiFi.mode(WIFI_AP);
2525
WiFi.softAP("esp-captive");
2626
#endif

examples/AsyncTunnel/AsyncTunnel.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77

88
#include <Arduino.h>
9-
#ifdef ESP32
9+
#if defined(ESP32) || defined(LIBRETINY)
1010
#include <AsyncTCP.h>
1111
#include <WiFi.h>
1212
#elif defined(ESP8266)
@@ -70,7 +70,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent);
7070
void setup() {
7171
Serial.begin(115200);
7272

73-
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
73+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI
7474
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
7575
while (WiFi.status() != WL_CONNECTED) {
7676
delay(500);

examples/Auth/Auth.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77

88
#include <Arduino.h>
9-
#ifdef ESP32
9+
#if defined(ESP32) || defined(LIBRETINY)
1010
#include <AsyncTCP.h>
1111
#include <WiFi.h>
1212
#elif defined(ESP8266)
@@ -52,7 +52,7 @@ static AsyncAuthorizationMiddleware authz([](AsyncWebServerRequest *request) {
5252
void setup() {
5353
Serial.begin(115200);
5454

55-
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
55+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI
5656
WiFi.mode(WIFI_AP);
5757
WiFi.softAP("esp-captive");
5858
#endif

examples/CORS/CORS.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77

88
#include <Arduino.h>
9-
#ifdef ESP32
9+
#if defined(ESP32) || defined(LIBRETINY)
1010
#include <AsyncTCP.h>
1111
#include <WiFi.h>
1212
#elif defined(ESP8266)
@@ -25,7 +25,7 @@ static AsyncCorsMiddleware cors;
2525
void setup() {
2626
Serial.begin(115200);
2727

28-
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
28+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI
2929
WiFi.mode(WIFI_AP);
3030
WiFi.softAP("esp-captive");
3131
#endif

examples/CaptivePortal/CaptivePortal.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Copyright 2016-2025 Hristo Gochkov, Mathieu Carbou, Emil Muratov
33

44
#include <DNSServer.h>
5-
#ifdef ESP32
5+
#if defined(ESP32) || defined(LIBRETINY)
66
#include <AsyncTCP.h>
77
#include <WiFi.h>
88
#elif defined(ESP8266)
@@ -28,7 +28,7 @@ public:
2828
response->print("<!DOCTYPE html><html><head><title>Captive Portal</title></head><body>");
2929
response->print("<p>This is our captive portal front page.</p>");
3030
response->printf("<p>You were trying to reach: http://%s%s</p>", request->host().c_str(), request->url().c_str());
31-
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
31+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI
3232
response->printf("<p>Try opening <a href='http://%s'>this link</a> instead</p>", WiFi.softAPIP().toString().c_str());
3333
#endif
3434
response->print("</body></html>");
@@ -41,7 +41,7 @@ void setup() {
4141
Serial.println();
4242
Serial.println("Configuring access point...");
4343

44-
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
44+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI
4545
if (!WiFi.softAP("esp-captive")) {
4646
Serial.println("Soft AP creation failed.");
4747
while (1);

examples/CatchAllHandler/CatchAllHandler.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77

88
#include <Arduino.h>
9-
#ifdef ESP32
9+
#if defined(ESP32) || defined(LIBRETINY)
1010
#include <AsyncTCP.h>
1111
#include <WiFi.h>
1212
#elif defined(ESP8266)
@@ -86,7 +86,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent);
8686
void setup() {
8787
Serial.begin(115200);
8888

89-
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
89+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI
9090
WiFi.mode(WIFI_AP);
9191
WiFi.softAP("esp-captive");
9292
#endif

examples/ChunkResponse/ChunkResponse.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77

88
#include <Arduino.h>
9-
#ifdef ESP32
9+
#if defined(ESP32) || defined(LIBRETINY)
1010
#include <AsyncTCP.h>
1111
#include <WiFi.h>
1212
#elif defined(ESP8266)
@@ -86,7 +86,7 @@ static const size_t htmlContentLength = strlen_P(htmlContent);
8686
void setup() {
8787
Serial.begin(115200);
8888

89-
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
89+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI
9090
WiFi.mode(WIFI_AP);
9191
WiFi.softAP("esp-captive");
9292
#endif

examples/ChunkRetryResponse/ChunkRetryResponse.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77

88
#include <Arduino.h>
9-
#ifdef ESP32
9+
#if defined(ESP32) || defined(LIBRETINY)
1010
#include <AsyncTCP.h>
1111
#include <WiFi.h>
1212
#elif defined(ESP8266)
@@ -96,7 +96,7 @@ static int key = -1;
9696
void setup() {
9797
Serial.begin(115200);
9898

99-
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED
99+
#if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED || LT_ARD_HAS_WIFI
100100
WiFi.mode(WIFI_AP);
101101
WiFi.softAP("esp-captive");
102102
#endif

0 commit comments

Comments
 (0)