ESP8266 changes + LN882H sdk update (#1955)

This commit is contained in:
NonPIayerCharacter
2026-01-26 12:03:21 +03:00
committed by GitHub
parent a06a91d438
commit 17dbe1e44b
10 changed files with 80 additions and 95 deletions

View File

@@ -333,45 +333,73 @@ jobs:
include:
- platform: OpenESP32C2
variant: 2M
version: v5.5.1
version: v5.5.2
sdk: esp-idf
- platform: OpenESP32C3
variant: 2M
version: v5.5.1
version: v5.5.2
sdk: esp-idf
- platform: OpenESP32
variant: 4M
version: v5.5.1
version: v5.5.2
sdk: esp-idf
- platform: OpenESP32C2
variant: 4M
version: v5.5.1
version: v5.5.2
sdk: esp-idf
- platform: OpenESP32C3
variant: 4M
version: v5.5.1
version: v5.5.2
sdk: esp-idf
- platform: OpenESP32C6
variant: 4M
version: v5.5.1
version: v5.5.2
sdk: esp-idf
- platform: OpenESP32S3
variant: 4M
version: v5.5.1
version: v5.5.2
sdk: esp-idf
- platform: OpenESP32S2
variant: 4M
version: v5.5.1
version: v5.5.2
sdk: esp-idf
- platform: OpenESP32C5
variant: 4M
version: v5.5.1
version: v5.5.2
sdk: esp-idf
- platform: OpenESP32C61
variant: 4M
version: v5.5.1
version: v5.5.2
sdk: esp-idf
- platform: OpenESP8266
variant: default
version: v3.4
sdk: OpenESP8266
steps:
- name: Source checkout
uses: actions/checkout@v4
- name: SDK checkout
- name: ESP-IDF checkout
if: ${{ matrix.platform != 'OpenESP8266' }}
uses: actions/checkout@v4
with:
repository: espressif/esp-idf
path: sdk/esp-idf
ref: ${{ matrix.version }}
submodules: recursive
- name: OpenESP8266 checkout
if: ${{ matrix.platform == 'OpenESP8266' }}
uses: actions/checkout@v4
with:
repository: NonPIayerCharacter/OpenESP8266
path: sdk/OpenESP8266
ref: obk
fetch-tags: true
fetch-depth: '10'
submodules: recursive
- uses: actions/setup-python@v5
id: pysetup
with:
@@ -388,15 +416,15 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.espressif # cache whole folder, not just dist
key: ESP-IDF_toolchain_${{ matrix.version }}_${{ steps.pysetup.outputs.python-version }}
key: ${{ matrix.sdk }}_toolchain_${{ matrix.version }}_${{ steps.pysetup.outputs.python-version }}
- name: Get toolchain
if: steps.cache-toolchain.outputs.cache-hit != 'true'
run: |
cd sdk/esp-idf
cd sdk/${{ matrix.sdk }}
./install.sh
- name: Run make
run: |
cd sdk/esp-idf
cd sdk/${{ matrix.sdk }}
. ./export.sh
. ./add_path.sh
cd ../..
@@ -408,55 +436,6 @@ jobs:
path: |
output/${{ needs.refs.outputs.version }}${{ matrix.variant != 'default' && '_' || '' }}${{ matrix.variant != 'default' && matrix.variant || '' }}/${{ matrix.platform }}_${{ needs.refs.outputs.version }}${{ matrix.variant != 'default' && '_' || '' }}${{ matrix.variant != 'default' && matrix.variant || '' }}.img
output/${{ needs.refs.outputs.version }}${{ matrix.variant != 'default' && '_' || '' }}${{ matrix.variant != 'default' && matrix.variant || '' }}/${{ matrix.platform }}_${{ needs.refs.outputs.version }}${{ matrix.variant != 'default' && '_' || '' }}${{ matrix.variant != 'default' && matrix.variant || '' }}.factory.bin
if-no-files-found: warn
build_8266:
name: Build ESP8266
needs: refs
runs-on: ubuntu-latest
defaults:
run:
shell: bash
container:
image: coatldev/six:latest
strategy:
fail-fast: false
matrix:
include:
- platform: OpenESP8266
variant: default
steps:
- name: Source checkout
uses: actions/checkout@v4
- name: SDK checkout
uses: actions/checkout@v4
with:
repository: NonPIayerCharacter/OpenESP8266
path: sdk/OpenESP8266
ref: obk
fetch-tags: true
fetch-depth: '10'
submodules: recursive
- name: Install dependencies
run: |
apt update && apt install -y cmake
pip2 install virtualenv
python2 -m pip install --user -r sdk/OpenESP8266/requirements.txt
python3 -m pip install esptool
- name: Run make
run: |
cd sdk/OpenESP8266
./install.sh > /dev/null
. ./export.sh
. ./add_path.sh
cd ../..
make APP_VERSION=${{ needs.refs.outputs.version }}${{ matrix.variant != 'default' && '_' || '' }}${{ matrix.variant != 'default' && matrix.variant || '' }} APP_NAME=${{ matrix.platform }} VARIANT="${{ matrix.variant }}" ${{ matrix.platform }}
- name: Save build assets
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}_${{ needs.refs.outputs.version }}_${{ matrix.platform }}${{ matrix.variant != 'default' && '_' || '' }}${{ matrix.variant != 'default' && matrix.variant || '' }}
path: |
output/${{ needs.refs.outputs.version }}${{ matrix.variant != 'default' && '_' || '' }}${{ matrix.variant != 'default' && matrix.variant || '' }}/${{ matrix.platform }}_${{ needs.refs.outputs.version }}${{ matrix.variant != 'default' && '_' || '' }}${{ matrix.variant != 'default' && matrix.variant || '' }}.img
output/${{ needs.refs.outputs.version }}${{ matrix.variant != 'default' && '_' || '' }}${{ matrix.variant != 'default' && matrix.variant || '' }}/${{ matrix.platform }}_2MB_${{ needs.refs.outputs.version }}${{ matrix.variant != 'default' && '_' || '' }}${{ matrix.variant != 'default' && matrix.variant || '' }}.factory.bin
output/${{ needs.refs.outputs.version }}${{ matrix.variant != 'default' && '_' || '' }}${{ matrix.variant != 'default' && matrix.variant || '' }}/${{ matrix.platform }}_1MB_${{ needs.refs.outputs.version }}${{ matrix.variant != 'default' && '_' || '' }}${{ matrix.variant != 'default' && matrix.variant || '' }}.factory.bin
if-no-files-found: warn
@@ -497,7 +476,7 @@ jobs:
merge:
name: Merge Artifacts
runs-on: ubuntu-22.04
needs: [refs, build, build2, build_idf, build_8266, build_txw81x]
needs: [refs, build, build2, build_idf, build_txw81x]
#if: always() && needs.refs.outputs.new_release == 'true' && (github.ref == 'refs/heads/main' || github.ref_name == 'alpha')
steps:
- name: Merge Artifacts

View File

@@ -568,12 +568,12 @@ OpenESP8266: prebuild_ESP8266
APP_VERSION=$(APP_VERSION) OBK_VARIANT=$(OBK_VARIANT) cmake platforms/ESP8266 -B platforms/ESP8266/build
APP_VERSION=$(APP_VERSION) OBK_VARIANT=$(OBK_VARIANT) cmake --build ./platforms/ESP8266/build -j $(shell nproc)
mkdir -p output/$(APP_VERSION)
python3 -m esptool -c esp8266 merge_bin -o output/$(APP_VERSION)/OpenESP8266_2MB_$(APP_VERSION).factory.bin --flash_mode dout --flash_size 2MB 0x0 ./platforms/ESP8266/build/bootloader/bootloader.bin 0x8000 ./platforms/ESP8266/build/partition_table/partition-table.bin 0x10000 ./platforms/ESP8266/build/OpenBeken.bin
esptool.py -c esp8266 merge_bin -o output/$(APP_VERSION)/OpenESP8266_2MB_$(APP_VERSION).factory.bin --flash_mode dout --flash_size 2MB 0x0 ./platforms/ESP8266/build/bootloader/bootloader.bin 0x8000 ./platforms/ESP8266/build/partition_table/partition-table.bin 0x10000 ./platforms/ESP8266/build/OpenBeken.bin
cp ./platforms/ESP8266/build/OpenBeken.bin output/$(APP_VERSION)/OpenESP8266_$(APP_VERSION).img
-rm platforms/ESP-IDF/partitions.csv
cp platforms/ESP8266/partitions-1mb.csv platforms/ESP8266/partitions.csv
cd platforms/ESP8266/ && idf.py partition_table
python3 -m esptool -c esp8266 merge-bin -o output/$(APP_VERSION)/OpenESP8266_1MB_$(APP_VERSION).factory.bin --flash-mode dout --flash-size 1MB 0x0 ./platforms/ESP8266/build/bootloader/bootloader.bin 0x8000 ./platforms/ESP8266/build/partition_table/partition-table.bin 0x10000 ./platforms/ESP8266/build/OpenBeken.bin
esptool.py -c esp8266 merge-bin -o output/$(APP_VERSION)/OpenESP8266_1MB_$(APP_VERSION).factory.bin --flash-mode dout --flash-size 1MB 0x0 ./platforms/ESP8266/build/bootloader/bootloader.bin 0x8000 ./platforms/ESP8266/build/partition_table/partition-table.bin 0x10000 ./platforms/ESP8266/build/OpenBeken.bin
.PHONY: OpenTR6260
OpenTR6260: prebuild_OpenTR6260

View File

@@ -12,3 +12,5 @@ idf_build_set_property(COMPILE_OPTIONS "-Wno-error=format-truncation" APPEND)
idf_build_set_property(COMPILE_OPTIONS "-Wno-error=incompatible-pointer-types" APPEND)
idf_build_set_property(COMPILE_OPTIONS "-Wno-error=pointer-sign" APPEND)
idf_build_set_property(COMPILE_OPTIONS "-Wno-error=main" APPEND)
idf_build_set_property(COMPILE_OPTIONS "-ffile-prefix-map=$ENV{IDF_PATH}/=" APPEND)
target_link_libraries(${project_elf} "-Wl,--print-memory-usage -u _printf_float -u _scanf_float")

View File

@@ -25,24 +25,31 @@ CONFIG_LWIP_ESP_LWIP_ASSERT=n
CONFIG_MBEDTLS_SSL_PROTO_TLS1=n
CONFIG_MBEDTLS_SSL_PROTO_TLS1_1=n
CONFIG_LWIP_MAX_ACTIVE_TCP=8
CONFIG_LWIP_MAX_SOCKETS=8
CONFIG_LWIP_MAX_ACTIVE_TCP=6
CONFIG_LWIP_MAX_LISTENING_TCP=3
CONFIG_LWIP_MAX_UDP_PCBS=2
CONFIG_LWIP_MAX_RAW_PCBS=2
CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=1024
CONFIG_LWIP_MAX_UDP_PCBS=1
CONFIG_LWIP_MAX_RAW_PCBS=1
CONFIG_LWIP_IP4_FRAG=n
CONFIG_LWIP_IP6_FRAG=n
CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=2048
CONFIG_ESP8266_WIFI_RX_BUFFER_NUM=6
CONFIG_ESP8266_WIFI_LEFT_CONTINUOUS_RX_BUFFER_NUM=6
CONFIG_SUPPORT_TERMIOS=n
CONFIG_ESPTOOLPY_FLASHMODE_DOUT=y
CONFIG_ESPTOOLPY_FLASHMODE="dout"
CONFIG_NEWLIB_NANO_FORMAT=n
CONFIG_NEWLIB_NANO_FORMAT=y
ESP_SYSTEM_EVENT_TASK_STACK_SIZE=1024
ESP_SYSTEM_EVENT_QUEUE_SIZE=16
ESP_ERR_TO_NAME_LOOKUP=n
ESP8266_CORE_GLOBAL_DATA_LINK_IRAM=n
ESP8266_WIFI_TX_PKT_NUM=4
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=1024
CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=8
CONFIG_ESP_ERR_TO_NAME_LOOKUP=n
#CONFIG_ESP8266_CORE_GLOBAL_DATA_LINK_IRAM=n
CONFIG_LWIP_DHCPS_MAX_STATION_NUM=2
CONFIG_ESP8266_WIFI_RX_BUFFER_NUM=14
CONFIG_ESP8266_WIFI_LEFT_CONTINUOUS_RX_BUFFER_NUM=8
CONFIG_ESP8266_WIFI_RX_PKT_NUM=4
CONFIG_ESP8266_WIFI_TX_PKT_NUM=4
CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=n
CONFIG_FREERTOS_TIMER_STACKSIZE=1024
CONFIG_TASK_SWITCH_FASTER=n
CONFIG_LOG_COLORS=n
CONFIG_MBEDTLS_DYNAMIC_BUFFER=y

View File

@@ -23,9 +23,8 @@ static int tok_flags = 0;
int str_to_ip(const char *s, byte *ip) {
#if PLATFORM_W600 || PLATFORM_LN882H || PLATFORM_REALTEK || PLATFORM_ECR6600 || PLATFORM_TR6260 \
|| PLATFORM_XRADIO || PLATFORM_TXW81X || PLATFORM_LN8825
//seems like sscanf in W600 does not support %hhu and uses it as %u, thus overwriting more memory, use temp array for it
// same for LN882h: %hhu isn't recognised, so we have to use %u for IP_STRING_FORMAT, which will lead to problems in sscanf, too
|| PLATFORM_XRADIO || PLATFORM_TXW81X || PLATFORM_LN8825 || PLATFORM_ESP8266
// %hhu is a C99 thing, and newlib-nano/mculib don't support it
int tmp_ip[4];
int res;
res = sscanf(s, IP_STRING_FORMAT, &tmp_ip[0], &tmp_ip[1], &tmp_ip[2], &tmp_ip[3]);

View File

@@ -1088,7 +1088,8 @@ typedef enum
EXCELLENT,
} WIFI_RSSI_LEVEL;
#if PLATFORM_LN882H || PLATFORM_REALTEK || PLATFORM_ECR6600 || PLATFORM_TR6260 || PLATFORM_XRADIO || PLATFORM_TXW81X || PLATFORM_LN8825
#if PLATFORM_LN882H || PLATFORM_REALTEK || PLATFORM_ECR6600 || PLATFORM_TR6260 || PLATFORM_XRADIO \
|| PLATFORM_TXW81X || PLATFORM_LN8825 || PLATFORM_ESP8266
#define IP_STRING_FORMAT "%u.%u.%u.%u"
#else
#define IP_STRING_FORMAT "%hhu.%hhu.%hhu.%hhu"

View File

@@ -566,16 +566,11 @@
#define ENABLE_DRIVER_BL0937 1
#define ENABLE_TASMOTA_JSON 1
#define ENABLE_TASMOTADEVICEGROUPS 1
#define ENABLE_I2C 1
#define ENABLE_DRIVER_AHT2X 1
#define ENABLE_NTP 1
#define ENABLE_DRIVER_LED 1
#define ENABLE_DRIVER_WEMO 1
#define ENABLE_DRIVER_SSDP 1
#define ENABLE_DRIVER_TUYAMCU 1
#define ENABLE_DRIVER_DS1820 1
#define ENABLE_DRIVER_BMPI2C 1
#define ENABLE_DRIVER_NEO6M 1
#define ENABLE_DRIVER_TUYAMCU 1
// #define ENABLE_OBK_BERRY 1

View File

@@ -116,7 +116,7 @@ void Main_ForceUnsafeInit();
#endif
#if PLATFORM_BEKEN
#define WFI_FUNC WFI
#elif PLATFORM_BL602 || PLATFORM_REALTEK || PLATFORM_XRADIO || PLATFORM_W600 || PLATFORM_RDA5981 || PLATFORM_LN8825
#elif PLATFORM_BL602 || PLATFORM_REALTEK || PLATFORM_XRADIO || PLATFORM_W600 || PLATFORM_RDA5981 || PLATFORM_LN8825 || PLATFORM_LN882H
#define WFI_FUNC() __asm volatile("wfi")
#elif PLATFORM_W800
#define WFI_FUNC __WFI
@@ -247,7 +247,7 @@ void extended_app_waiting_for_launch2(void) {
#endif
#if PLATFORM_LN882H || PLATFORM_ESPIDF || PLATFORM_ESP8266 || PLATFORM_REALTEK_NEW
#if PLATFORM_ESPIDF || PLATFORM_REALTEK_NEW
int LWIP_GetMaxSockets() {
return 0;
@@ -1260,7 +1260,8 @@ int Main_IsConnectedToWiFi()
// called from idle thread each loop.
// - just so we know it is running.
#if PLATFORM_ESPIDF || PLATFORM_ESP8266 || PLATFORM_BL602 || (PLATFORM_REALTEK && !PLATFORM_REALTEK_NEW) || PLATFORM_XRADIO || PLATFORM_LN8825
#if PLATFORM_ESPIDF || PLATFORM_ESP8266 || PLATFORM_BL602 || (PLATFORM_REALTEK && !PLATFORM_REALTEK_NEW) \
|| PLATFORM_XRADIO || PLATFORM_LN8825 || PLATFORM_LN882H
inline __attribute__((always_inline))
#endif
void isidle() {
@@ -1635,7 +1636,8 @@ void Main_Init()
}
#if PLATFORM_ESPIDF || PLATFORM_ESP8266 || PLATFORM_BL602 || (PLATFORM_REALTEK && !PLATFORM_REALTEK_NEW) || PLATFORM_XRADIO || PLATFORM_W600 || PLATFORM_W800 || PLATFORM_LN8825
#if PLATFORM_ESPIDF || PLATFORM_ESP8266 || PLATFORM_BL602 || (PLATFORM_REALTEK && !PLATFORM_REALTEK_NEW) \
|| PLATFORM_XRADIO || PLATFORM_W600 || PLATFORM_W800 || PLATFORM_LN8825 || PLATFORM_LN882H
void vApplicationIdleHook(void)
{