logo elektroda
logo elektroda
X
logo elektroda

Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

MrGenius 6276 124
Best answers

How can I make a Tuya WXU/TRV device work with XR806 firmware?

OpenBeken/OpenXR806 does boot on XR806, and by April the thread confirms a custom HTTP page was running on the WXU/XR806 for the first time; the main remaining problems were Wi‑Fi stability and getting settings to persist [#21524637] [#21524126] The first bootable path came from building against the XR806 SDK (the shared repo was published at `github.com/divadiow/xr806_sdk`), using the SDK’s `make menuconfig`/build flow and enabling the right Wi‑Fi options; once built, the firmware printed normal XR806 boot logs and the device could be flashed successfully [#21429402] [#21430649] [#21430654] [#21430812] Flash/download mode on this board appears to need only `PB02` pulled low, not the XR809-style `PB02+PB03` combination [#21530921] Config storage was later fixed by moving `sysinfo` to `0x1FC000`, which let OBK save its config; that still left about 12 KB free at the end of the 2 MB flash [#21525228] [#21533999] Even after that, the thread still reported unstable Wi‑Fi/HTTP behavior and no fully finished TRV port yet [#21524434] [#21524467] [#21524739]
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #31 21429936
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14389
    Help: 650
    Rate: 12308
    Interesting, what's that?

    I've tried to flash it:
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    Did it stuck?
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    Ok, now there is no log output at all... and even after disconnecting boot pin from ground it still works with flasher.
    I flashed back backup"
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research


    So no luck, it seems we need to try compiling samples from XR806 SDK
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #32 21430649
    divadiow
    Level 38  
    Posts: 4833
    Help: 420
    Rate: 851
    I've built something. this is the hello_demo app

    make image
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    but I didn't configure anything but the project path in make menuconfig
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    Attachments:
    • xr_system.zip (32.23 KB) You must be logged in to download this attachment.
  • #33 21430654
    divadiow
    Level 38  
    Posts: 4833
    Help: 420
    Rate: 851
    I think this is the expected log output

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    https://xr806.docs.aw-ol.com/study/soft_helloword/

    Added after 3 [minutes]:

    PhoenixMC at least parses it.

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    Added after 12 [minutes]:

    wlan_demo
    Attachments:
    • wlan_demo.zip (37.09 KB) You must be logged in to download this attachment.
  • #34 21430698
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14389
    Help: 650
    Rate: 12308
    Nothing on UART... maybe we should rather try this?
    https://xr806.docs.aw-ol.com/rtos/helloworld/
    Wait a second. It does work, but it prints on flashing UART, and not on the log one!
    I was checking wrong UART.
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    Helpful post? Buy me a coffee.
  • #35 21430716
    divadiow
    Level 38  
    Posts: 4833
    Help: 420
    Rate: 851
    well that's good news
  • ADVERTISEMENT
  • #36 21430722
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14389
    Help: 650
    Rate: 12308
    Now you can try a WiFi sample or maybe AT commandline.
    Helpful post? Buy me a coffee.
  • #37 21430759
    divadiow
    Level 38  
    Posts: 4833
    Help: 420
    Rate: 851
    wifi demo posted earlier. AT fails at the moment
  • #38 21430765
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14389
    Help: 650
    Rate: 12308
    What's the error message?
    Helpful post? Buy me a coffee.
  • #39 21430773
    divadiow
    Level 38  
    Posts: 4833
    Help: 420
    Rate: 851
    Code: Text
    Log in, to see the code


    just trying to get the context so I can move stuff around to where it may be looking. also, dinner


    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
  • #40 21430793
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14389
    Help: 650
    Rate: 12308
    Probably wrong path or missing enable in makefile?

    Which wlan_demo did you compile? I am trying to get it to work, it has some kind of command line.


    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    Helpful post? Buy me a coffee.
  • #41 21430797
    divadiow
    Level 38  
    Posts: 4833
    Help: 420
    Rate: 851
    ha. menuconfig to the rescue

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    building now it seems
  • ADVERTISEMENT
  • #42 21430799
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14389
    Help: 650
    Rate: 12308
    How does one use menuconfig? I haven't seen it in action for LWIP yet.
    Helpful post? Buy me a coffee.
  • #43 21430800
    divadiow
    Level 38  
    Posts: 4833
    Help: 420
    Rate: 851
    >>21430793

    https://github.com/divadiow/xr806_sdk/tree/master/project/demo/wlan_demo

    but I may not have had the lwip/wlan/ap settings check in menuconfig for that build, but it didnt fail...

    Added after 3 [minutes]:

    im in wsl and at xr806_sdk root i run "make menuconfig" - I had some prereqs missing and maybe it complained about gcc location first too.

    prereqs were sorted with

    Code: Bash
    Log in, to see the code
  • #44 21430812
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14389
    Help: 650
    Rate: 12308
    Your WLAN demo is most likely missing crucial defines:
    - CONFIG_WLAN_AP
    - CONFIG_WLAN_STA
    - CONFIG_WLAN_MONITOR
    They are required to enable WiFi Commands:
    Code: C / C++
    Log in, to see the code

    You also need to define PRJCONF_NET_EN :
    Code: C / C++
    Log in, to see the code

    as it does not have yet net command...
    Helpful post? Buy me a coffee.
  • #45 21430847
    divadiow
    Level 38  
    Posts: 4833
    Help: 420
    Rate: 851
    ok.
    I guess I wrongly assumed the demos were standalone, ready to build, all that needed setting to make them work was already in place.

    at_demo takes ages. failed again but this time on some undefined ota file. I enabled ota in menuconfig and now it has finished
    Attachments:
    • at_demo.zip (406.99 KB) You must be logged in to download this attachment.
  • #46 21430862
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14389
    Help: 650
    Rate: 12308
    The increase is visible in the file size.
    Helpful post? Buy me a coffee.
  • #47 21430866
    divadiow
    Level 38  
    Posts: 4833
    Help: 420
    Rate: 851
    with lwip/ota/wlan whatever enabled still I am building wlan_demo again. it's taking longer too.

    I see mbedtls stuff at the moment

    Added after 1 [minutes]:

    I wonder if you can just point this menuconfig to the OBK project path and it'll build. just wild speculation
  • ADVERTISEMENT
  • #48 21430883
    divadiow
    Level 38  
    Posts: 4833
    Help: 420
    Rate: 851
    wlan_demo again
    Attachments:
    • wlan_demo_try2.zip (455.59 KB) You must be logged in to download this attachment.
  • #49 21430882
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14389
    Help: 650
    Rate: 12308
    This is the first time you've posted binary with wlan blobs:
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    In order to compile OBK, you must have this shared app:
    https://github.com/openshwprojects/OpenXR809/tree/master/project/oxr_sharedApp
    This is the OBK wrapper:
    https://github.com/openshwprojects/OpenXR809/blob/master/project/oxr_sharedApp/main.c
    Then you also need to make sure that platform define is set.
    https://github.com/search?q=repo%3Aopenshwprojects%2FOpenXR809%20PLATFORM_XR809&type=code
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    It is fairly possible that you could just use XR806 SDK with PLATFORM_XR809 SDK define and that it will work.

    let's consider OBK WiFi HAL for XR809:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/hal/xr809/hal_wifi_xr809.c
    Let's take random define from that - CTRL_MSG_TYPE_NETWORK .
    Is CTRL_MSG_TYPE_NETWORK also present in XR806 SDK? Are the headers the same?

    If the headers are the same, then porting should be fairly simple.

    Added after 10 [minutes]:

    With the previous wlan demo you've posted, the command line has changed. It's now AT command line. It takes standard AT commands, taken from ESP docs:
    Quote:



    AT+CWINIT: Initialize/Deinitialize Wi-Fi driver.

    AT+CWMODE: Set the Wi-Fi mode (Station/SoftAP/Station+SoftAP).

    AT+CWSTATE: Query the Wi-Fi state and Wi-Fi information.

    AT+CWJAP: Connect to an AP.

    AT+CWRECONNCFG: Query/Set the Wi-Fi reconnecting configuration.

    AT+CWLAPOPT: Set the configuration for the command AT+CWLAP.

    AT+CWLAP: List available APs.

    AT+CWQAP: Disconnect from an AP.

    AT+CWSAP: Query/Set the configuration of an ESP32 SoftAP.

    AT+CWLIF: Obtain IP address of the station that connects to an ESP32 SoftAP.

    AT+CWQIF: Disconnect stations from an ESP32 SoftAP.

    AT+CWDHCP: Enable/disable DHCP.

    AT+CWDHCPS: Query/Set the IPv4 addresses allocated by an ESP32 SoftAP DHCP server.

    AT+CWAUTOCONN: Connect to an AP automatically when powered on.

    AT+CWAPPROTO: Query/Set the 802.11 b/g/n protocol standard of SoftAP mode.

    AT+CWSTAPROTO: Query/Set the 802.11 b/g/n protocol standard of station mode.

    AT+CIPSTAMAC: Query/Set the MAC address of an ESP32 station.

    AT+CIPAPMAC: Query/Set the MAC address of an ESP32 SoftAP.

    AT+CIPSTA: Query/Set the IP address of an ESP32 station.

    AT+CIPAP: Query/Set the IP address of an ESP32 SoftAP.

    AT+CWSTARTSMART: Start SmartConfig.

    AT+CWSTOPSMART: Stop SmartConfig.

    AT+WPS: Enable the WPS function.

    AT+CWJEAP: Connect to a WPA2 Enterprise AP.

    AT+CWHOSTNAME: Query/Set the host name of an ESP32 station.

    AT+CWCOUNTRY: Query/Set the Wi-Fi Country Code.

    WiFi Scan works:
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    With AT join command, I can join to WiFi:
    
    wlan scan success
                                                                 
    en1: Associated with 28:87:ba:a0:f5:6d
                                             
    en1: WPA: Key negotiation completed with 28:87:ba:a0:f5:6d [PTK=CCMP GTK=CCMP]
     
    en1: CTRL-EVENT-CONNECTED - Connection to 28:87:ba:a0:f5:6d completed [id=0 id_s
    tr=]
                                                                               
    [net INF] msg <wlan connected>
                                                     
    [net INF] netif is link up
                                                         
    [net INF] start DHCP...
                                                            
    +EVT:2
                                                                             
    msg:0
                                                                             
    wlan connected
                                                                    
    WAR drop=1135, fctl=0x00d0.
                                                        
    WAR drop=1135, fctl=0x00d0.
                                                        
    [net INF] netif (IPv4) is up
                                                       
    [net INF] address: 192.168.0.155
                                                   
    [net INF] gateway: 192.168.0.1
                                                     
    [net INF] netmask: 255.255.255.0
                                                   
    [net INF] msg <network up>
                                                         
    +EVT:4
                                                                             
    msg:7
                                                                             
    network up
                                                                        
                
                                                                      
    OK
        
    
    
    Helpful post? Buy me a coffee.
  • #50 21430921
    divadiow
    Level 38  
    Posts: 4833
    Help: 420
    Rate: 851
    Cool cool. I need to stop for the eve and I need to get my head round what you've put above.

    Added after 10 [hours] 10 [minutes]:

    divadiow wrote:
    PB02/PB03 grounded✅✅


    divadiow wrote:
    looks like only PB02 needs to be pulled low to get XR806 into download mode, as opposed to PB02 and PB03 on XR809


    so, it seems I looked it up before for that Avatto SWT60

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    https://github.com/divadiow/xr806_sdk/tree/master/docs

    Added after 8 [hours] 45 [minutes]:

    >>21430882

    :/

    Added after 18 [minutes]:

    Im failing my homework 😭

    Code: Text
    Log in, to see the code


    am I linking up as if new - OpenXR806 or sticking to OpenXR809?

    this is set

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    Should I maybe start again with openshwprojects/OpenXR809 and openshwprojects/OpenBK7231T_App forks and replacing the content in OpenXR809 with the 806 sdk files? is that a clearer way round? hmm.
  • #51 21432047
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14389
    Help: 650
    Rate: 12308
    I can help more if that's needed. Did you build menuconfig? So far I get:
    
    
    tester@DESKTOP-6SD9MUK:/mnt/w/GIT/OpenXR806$ make menuconfig
    make[1]: Entering directory '/mnt/w/GIT/OpenXR806/tools/config'
    HOSTLD build/mconf.o
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x48): undefined reference to `___chkstk_ms'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x2e2): undefined reference to `__getreent'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x302): undefined reference to `__getreent'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x316): undefined reference to `__getreent'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x496): undefined reference to `__getreent'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x4fa): undefined reference to `___chkstk_ms'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x669): undefined reference to `__getreent'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0xf8e): undefined reference to `__locale_ctype_ptr'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0xfe2): undefined reference to `__errno'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x1382): undefined reference to `___chkstk_ms'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x13cb): undefined reference to `__getreent'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x1541): undefined reference to `__getreent'
    /usr/bin/ld: build/confdata.o:confdata.c:(.text+0x209e): undefined reference to `__errno'
    /usr/bin/ld: build/expr.o:expr.c:(.text+0x82): undefined reference to `__errno'
    /usr/bin/ld: build/expr.o:expr.c:(.text+0x112): undefined reference to `__errno'
    /usr/bin/ld: build/expr.o:expr.c:(.text+0x15a): undefined reference to `__errno'
    /usr/bin/ld: build/expr.o:expr.c:(.text+0x18d): undefined reference to `__errno'
    /usr/bin/ld: build/expr.o:expr.c:(.text+0x1c9): undefined reference to `__locale_ctype_ptr'
    /usr/bin/ld: build/expr.o:expr.c:(.text+0x391): undefined reference to `__getreent'
    /usr/bin/ld: build/expr.o:expr.c:(.text+0x3d2): undefined reference to `__assert_func'
    /usr/bin/ld: build/expr.o:expr.c:(.text+0x619): undefined reference to `__getreent'
    /usr/bin/ld: build/expr.o:expr.c:(.text+0x6f1): undefined reference to `__getreent'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x9): undefined reference to `__getreent'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x299): undefined reference to `___chkstk_ms'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x4ae): undefined reference to `__errno'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x4ef): undefined reference to `__errno'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x771): undefined reference to `__errno'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x799): undefined reference to `__errno'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x7a7): undefined reference to `__errno'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0xf39): undefined reference to `__getreent'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0xf61): undefined reference to `__getreent'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x10f4): undefined reference to `__getreent'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x1375): undefined reference to `__getreent'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x14b6): undefined reference to `__getreent'
    /usr/bin/ld: build/lexer.lex.o:lexer.lex.c:(.text+0x20ac): more undefined references to `__getreent' follow
    /usr/bin/ld: build/parser.tab.o:parser.tab.c:(.text+0xe98): undefined reference to `__locale_ctype_ptr'
    /usr/bin/ld: build/parser.tab.o:parser.tab.c:(.text+0xf55): undefined reference to `__locale_ctype_ptr'
    /usr/bin/ld: build/parser.tab.o:parser.tab.c:(.text+0x1319): undefined reference to `__getreent'
    /usr/bin/ld: build/parser.tab.o:parser.tab.c:(.text+0x1352): undefined reference to `__getreent'
    /usr/bin/ld: build/parser.tab.o:parser.tab.c:(.text+0x1674): undefined reference to `__getreent'
    /usr/bin/ld: build/parser.tab.o:parser.tab.c:(.text+0x16c1): undefined reference to `__getreent'
    /usr/bin/ld: build/parser.tab.o:parser.tab.c:(.text+0x1709): undefined reference to `__getreent'
    /usr/bin/ld: build/parser.tab.o:parser.tab.c:(.text+0x172b): more undefined references to `__getreent' follow
    /usr/bin/ld: build/preprocess.o:preprocess.c:(.text+0x278): undefined reference to `__locale_ctype_ptr'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0xc0a): undefined reference to `__getreent'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0x118a): undefined reference to `__locale_ctype_ptr'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0x11c1): undefined reference to `__locale_ctype_ptr'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0x122e): undefined reference to `__locale_ctype_ptr'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0x2282): undefined reference to `__getreent'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0x235a): undefined reference to `__getreent'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0x2394): undefined reference to `__getreent'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0x2493): undefined reference to `__getreent'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0x24d7): undefined reference to `__getreent'
    /usr/bin/ld: build/symbol.o:symbol.c:(.text+0x2534): more undefined references to `__getreent' follow
    /usr/bin/ld: build/util.o:util.c:(.text+0x22a): undefined reference to `___chkstk_ms'
    /usr/bin/ld: build/util.o:util.c:(.text+0x2a4): undefined reference to `__getreent'
    /usr/bin/ld: build/util.o:util.c:(.text+0x2e4): undefined reference to `__getreent'
    /usr/bin/ld: build/util.o:util.c:(.text+0x344): undefined reference to `__getreent'
    /usr/bin/ld: build/util.o:util.c:(.text+0x384): undefined reference to `__getreent'
    collect2: error: ld returned 1 exit status
    chmod: cannot access 'mconf': No such file or directory
    make[1]: *** [Makefile:27: mconf] Error 1
    make[1]: Leaving directory '/mnt/w/GIT/OpenXR806/tools/config'
    /mnt/w/GIT/OpenXR806
    tools/config/mconf ./Kconfig
    make: tools/config/mconf: Command not found
    make: *** [Makefile:124: menuconfig] Error 127
    
    Helpful post? Buy me a coffee.
  • #52 21432060
    divadiow
    Level 38  
    Posts: 4833
    Help: 420
    Rate: 851
    I did not need to build menuconfig. straight into "make menuconfig" after sorting gcc and prereqs.

    I have this in linux home /tools

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    and this under sdk/tools

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    Code: Bash
    Log in, to see the code
  • #53 21432197
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14389
    Help: 650
    Rate: 12308
    menuconfig is build from source on the first run, so it can be used to generate required header:
    
    ../../../include/xr_config.h:33:10: fatal error: generated/autoconf.h: No such file or directory
     #include "generated/autoconf.h"
    

    but for now, I can't get menuconfig to build, neither or WSL, nor Cygwin, nor MSys... I'm not sure what's wrong, maybe it's an issue with C library.

    Which command line are you using? WSL?
    Helpful post? Buy me a coffee.
  • #54 21432203
    divadiow
    Level 38  
    Posts: 4833
    Help: 420
    Rate: 851
    yes

    Linux 5.15.167.4-microsoft-standard-WSL2 x86_64

    Added after 23 [minutes]:

    would me zipping and giving you the SDK dir im working from now be of any use. in case there's something different I havent accounted for?
  • #55 21432260
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14389
    Help: 650
    Rate: 12308
    You can try zipping your sdk with build menuconfig and generated empty project. It seems that I have WSL1 and I can't install WSL2 due to Windows issue, I will most likely have to reinstall my OS.

    Added after 54 [minutes]:

    I am doing another attempt, from scratch:
    
    0. Introduction
    As mentioned in the previous article, building Unbuntu in Windows is not very user-friendly for novices. So I have been looking for a solution and found a very interesting solution. I hope it will be helpful to you.
    
    1. Environment Construction
    The core of the solution is Alibaba Cloud.
    The specific steps are as follows:
    step 1: Register. Log in to the development platform of Jishu Community .
    
    
    Setp2: Select a suitable cloud (free is the most important)
    
    Setp3: Configure the cloud server. Just follow the instructions, it doesn't cost money~~
    
    Pay attention to the system selection, choose Ubuntu 20 or 22
    
    and follow the instructions. Log in to the control interface through remote connection.
    
    
    Step 4: xr806 development configuration. When configuring, just follow the steps given by the boss:
    https://aijishu.com/a/1060000000432870
    
    SDK
    wget https://bbs.aw-ol.com/assets/uploads/files/1693988430633-xr806_sdk.tar.gz
    
    Unzip
    tar -zxvf 1693988430633-xr806_sdk.tar.gz
    
    Switch to tools and download toolchain
    cd xr806_sdk/tools
    wget https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2
    Unzip
    tar -xvf gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2
    Modify gcc.mk
    View the file structure in the same way as the folder
    
    ##First copy the path of gcc
    
    ##Open gcc.mk and modify
    
    
    2. Testing
    Execute the following two commands in the xr806_sdk directory:
    cp project/demo/hello\_demo/gcc/defconfig .config
    make menuconfig 
    As expected, there is a problem and a patch is needed.
    
    Install the plugin:
    sudo apt-get update 
    sudo apt-get install libncurses5-dev
    Then, rerun:
    cp project/demo/hello\_demo/gcc/defconfig .config
    make menuconfig 
    Great news! Finally succeeded!
    
    ##Click Save, then Exit. Then run:
    
    make build_clean
    make build -j$(nproc)
    3. Start enjoying XR806.
    Compiled results, can be downloaded and deleted.


    Added after 3 [minutes]:

    Got it futher?

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research
    Helpful post? Buy me a coffee.
  • #56 21432357
    divadiow
    Level 38  
    Posts: 4833
    Help: 420
    Rate: 851
    Looking better!
  • #57 21432362
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14389
    Help: 650
    Rate: 12308
    Did you use the same SDK as me? Why the one downloaded via commandline worked and the one from Github didn't?

    Futher changed I did: gcc.mk , I changed path to toolchain from tools:
    
    #
    # Common rules for GCC Makefile
    #
    
    # ----------------------------------------------------------------------------
    # cross compiler
    # ----------------------------------------------------------------------------
    CC_DIR ?= /mnt/w/GIT/xr806_sdk/tools/gcc-arm-none-eabi-8-2019-q3-update/bin
    CC_PREFIX := $(CC_DIR)/arm-none-eabi-
    
    AS      := $(CC_PREFIX)as
    CC      := $(CC_PREFIX)gcc
    CPP     := $(CC_PREFIX)g++
    LD      := $(CC_PREFIX)ld
    NM      := $(CC_PREFIX)nm
    AR      := $(CC_PREFIX)ar
    

    Something is compiling:

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    Added after 8 [minutes]:

    Maybe I was missing toolchain from tools dir
    Helpful post? Buy me a coffee.
  • #58 21432430
    divadiow
    Level 38  
    Posts: 4833
    Help: 420
    Rate: 851
    The SDK on GitHub is a fresh extraction of xr806_sdk.tar.gz from https://aijishu.com/a/1060000000426976 which I had in July. The SDK folder I have been compiling from was extracted in July but I dont think anything was changed until yesterday, I only used it to get newer PhoenixMC.
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    all the copies I have are identical. I did sort GCC first...

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    Added after 1 [minutes]:

    have you flashed a successfully built OpenXR806??
  • #59 21432486
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14389
    Help: 650
    Rate: 12308
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    Added after 6 [minutes]:

    Trying to compile:

    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    Added after 2 [minutes]:

    Few errors:
    
    ject/common/board/xr806_dig_ver  -o ../main.o ../main.c
    In file included from ../shared/src/new_common.h:231,
                     from ../shared/src/new_cfg.h:4,
                     from ../main.c:42:
    ../../../../include/net/lwip-2.1.2/lwip/sockets.h:690: error: "close" redefined [-Werror]
     #define close(s)                                  lwip_close(s)
    
    In file included from ../shared/src/new_cfg.h:4,
                     from ../main.c:42:
    ../shared/src/new_common.h:120: note: this is the location of the previous definition
     #define close lwip_close
    
    ../main.c: In function 'rtos_create_thread':
    ../main.c:59:24: error: passing argument 1 of 'OS_ThreadCreate' from incompatible pointer type [-Werror=incompatible-pointer-types]
      err = OS_ThreadCreate(thread,
                            ^~~~~~
    In file included from ../../../../include/kernel/os/os.h:34,
                     from ../../../../project/common/framework/sys_ctrl/publisher.h:35,
                     from ../../../../project/common/framework/sys_ctrl/sys_ctrl.h:36,
                     from ../../../../project/common/framework/net_ctrl.h:39,
                     from ../main.c:40:
    ../../../../include/kernel/os/os_thread.h:92:40: note: expected 'OS_Thread_t *' {aka 'struct OS_Thread *'} but argument is of type 'void **'
     OS_Status OS_ThreadCreate(OS_Thread_t *thread, const char *name,
                               ~~~~~~~~~~~~~^~~~~~
    ../main.c: In function 'rtos_delete_thread':
    ../main.c:70:29: error: passing argument 1 of 'OS_ThreadDelete' from incompatible pointer type [-Werror=incompatible-pointer-types]
         return OS_ThreadDelete( thread );
                                 ^~~~~~
    In file included from ../../../../include/kernel/os/os.h:34,
                     from ../../../../project/common/framework/sys_ctrl/publisher.h:35,
                     from ../../../../project/common/framework/sys_ctrl/sys_ctrl.h:36,
                     from ../../../../project/common/framework/net_ctrl.h:39,
                     from ../main.c:40:
    ../../../../include/kernel/os/os_thread.h:108:40: note: expected 'OS_Thread_t *' {aka 'struct OS_Thread *'} but argument is of type 'void **'
     OS_Status OS_ThreadDelete(OS_Thread_t *thread);
                               ~~~~~~~~~~~~~^~~~~~
    ../main.c: In function 'main':
    ../main.c:130:6: error: unused variable 'res' [-Werror=unused-variable]
      int res;
          ^~~
    At top level:
    ../main.c:74:20: error: 'g_helloworld_thread' defined but not used [-Werror=unused-variable]
     static OS_Thread_t g_helloworld_thread;
                        ^~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    make[1]: *** [../../../../gcc.mk:225: ../main.o] Error 1
    make[1]: Leaving directory '/mnt/w/git/xr806_sdk/project/demo/sharedApp/gcc'
    make: *** [../../../../project/project.mk:430: __all] Error 2
    


    Added after 8 [minutes]:

    Ok, silenced:
    Tuya WXU XR806 from TRV Heater Device flashing, SDK, firmware change research

    Added after 7 [minutes]:

    What a restrictive compiler setup:
    
    ./shared/src/new_pins.c: In function 'PIN_SetPinRoleForPinIndex':
    ../shared/src/new_pins.c:977:8: error: variable 'channelValue' set but not used [-Werror=unused-but-set-variable]
        int channelValue;
            ^~~~~~~~~~~~
    cc1: all warnings being treated as errors
    

    I will just disable it

    Added after 13 [minutes]:

    Ok stuck for now:
    
    red/src/logging/logging.c
    ../shared/src/logging/logging.c:124:2: error: unknown type name 'SemaphoreHandle_t'
      SemaphoreHandle_t mutex;
      ^~~~~~~~~~~~~~~~~
    ../shared/src/logging/logging.c: In function 'addLogAdv':
    ../shared/src/logging/logging.c:282:2: error: unknown type name 'BaseType_t'; did you mean 'logType_t'?
      BaseType_t taken;
      ^~~~~~~~~~
      logType_t
    ../shared/src/logging/logging.c:365:16: error: 'pdTRUE' undeclared (first use in this function)
       if (taken == pdTRUE) {
                    ^~~~~~
    ../shared/src/logging/logging.c:365:16: note: each undeclared identifier is reported only once for each function it appears in
    ../shared/src/logging/logging.c:413:23: error: 'portTICK_RATE_MS' undeclared (first use in this function)
        timems = (((1000 / portTICK_RATE_MS) * len) / cps) + 2;
                           ^~~~~~~~~~~~~~~~
    ../shared/src/logging/logging.c: In function 'getData':
    ../shared/src/logging/logging.c:423:2: error: unknown type name 'BaseType_t'; did you mean 'logType_t'?
      BaseType_t taken;
      ^~~~~~~~~~
      logType_t
    ../shared/src/logging/logging.c:448:15: error: 'pdTRUE' undeclared (first use in this function)
      if (taken == pdTRUE) {
    

    I need to check if we have SemaphoreHandle_t in the SDK
    Helpful post? Buy me a coffee.
  • #60 21432558
    divadiow
    Level 38  
    Posts: 4833
    Help: 420
    Rate: 851
    Awesome stuff dude. I'm watching with keen interest

Topic summary

✨ The discussion centers on the Tuya WXU module, specifically the XR806 SoC used in TRV heater devices, exploring firmware flashing, SDK usage, and custom firmware development. The XR806 differs from the XR809 notably by including WiFi and BLE capabilities and having 320 KB SRAM versus 288 KB in XR806 specs. Participants shared boot logs, teardown procedures, and hardware photos, confirming the XR806's WiFi presence and SDK version 1.2.2. Efforts to flash custom firmware such as OpenBK7231T_App and OpenXR806 were documented, with challenges including UART synchronization errors, thread creation failures, and unstable WiFi connections. The XR806 SDK was used for compiling demos like hello_demo and wlan_demo, with configuration via make menuconfig to enable WiFi features and FreeRTOS. Issues with missing headers, build environment setup (WSL, GCC toolchain), and SDK path configurations were addressed. A key breakthrough was identifying HTTP basic authentication enabled by default on XR806, blocking HTTP server responses, which was resolved by disabling or clearing the web password. Flash memory configuration was adjusted to a free offset (0x1FC000) to enable saving settings. Despite progress, WiFi stability and full TRV functionality remain under development. Community members sourced XR806 modules from various suppliers and shared open-source projects like TinyMaix-XR806 for reference. The discussion also touched on porting HAL code from XR809 to XR806 due to high similarity, and ongoing efforts to integrate XR806 support into OpenBK7231T_App with online builds. The overall progress marks the first successful custom firmware boot and HTTP server operation on XR806-based WXU modules, paving the way for further development and device control.
Generated by the language model.

FAQ

TL;DR: With 320 KB SRAM and a quoted breakthrough — "XR auth disabled" — this FAQ shows XR806/WXU thermostat modders how to open Tuya TRVs, dump firmware, build XR806 SDK demos, and understand why OpenBeken now boots and serves a web UI, while Wi‑Fi stability and TuyaMCU work still need fixes. [#21524634]

Why it matters: This thread turns a vague "WXU might be XR806" hunch into a repeatable path for teardown, flashing, SDK builds, and first-boot OpenBeken testing on real Tuya thermostats.

Option Result in thread Main limitation
Stock Tuya WXU firmware on original device Boots, exposes TuyaOS logs, Wi‑Fi + BLE seen Closed firmware, no alternative control path proven
Dumped WXU image flashed onto XR809 Did not boot XR806/XR809 firmware mismatch
XR806 SDK demos hello_demo and Wi‑Fi demos built and ran menuconfig options needed
OpenBeken on XR806/WXU Boots and later serves web UI Wi‑Fi, config, MAC, and TuyaMCU issues remained during testing

Key insight: The project stopped being blocked by flashing and basic booting. The real breakthroughs were proving that WXU is XR806-class hardware in practice, and then finding that the missing XR806 web GUI was caused by HTTP auth behavior, not a dead HTTP server.

Quick Facts

  • Tuya WXU was discussed as XR806-class hardware because logs showed XR806 SDK v1.2.1/v1.2.2, 160 MHz CPU, 40 MHz HF clock, Wi‑Fi, and BLE on real thermostat hardware. [#21429243]
  • The thread compared memory claims directly: Tuya WXU listed 320 KB SRAM, while one XR806 spec mentioned 288 KB SRAM, which caused early confusion about whether WXU was a Tuya-specific variant. [#21429143]
  • A real TuyaOS boot log on WXU showed TuyaOS V3.6.3 built on 2024-07-18, with xr806_lowpower_common_ty 1.1.4 and a product AP named SmartLife-4649. [#21429243]
  • XR806 flashing and logging used different serial paths in practice: successful tests showed firmware output on the flashing UART, while boot logs from stock firmware were often captured on a different UART. [#21430698]
  • OpenBeken config saving started working after moving XR806 sysinfo to 0x1FC000, leaving about 12 KB free before the end of a 2 MB flash. [#21533999]

How do I open a Tuya TRV heater device with the WXU/XR806 module without damaging the display or board?

Open it in four careful steps. 1. Pull off the plastic turning wheel with steady force. 2. Remove the round battery cover underneath it. 3. Unclip the display with a small screwdriver. 4. Remove the 3 top screws and lift out the board. This sequence was reported as "very easy to open" and was used successfully before board removal and flashing work. [#21429214]

What is the Tuya WXU module, and how is it related to the XR806 chip used in thermostats and TRVs?

The Tuya WXU module is an embedded Wi‑Fi and BLE module that appears XR806-based in these thermostats. "WXU is an embedded wireless module that provides Wi‑Fi and Bluetooth Low Energy connectivity, and in this thread its boot logs matched XR806 SDK builds, clocks, and radio firmware." The strongest evidence was real boot output showing XR806 SDK, 160 MHz CPU, 40 MHz HF clock, and TuyaOS on a WXU-equipped TRV. [#21429243]

What is TuyaMCU, and why does it matter when replacing firmware on a WXU/XR806-based thermostat?

TuyaMCU is the separate device-side controller that exchanges commands with the Wi‑Fi module over UART. "TuyaMCU is a microcontroller-side protocol layer that handles thermostat logic and sensors while the Wi‑Fi module exposes cloud or custom firmware features, usually over serial links such as 115200 baud." It matters because the original TRV used TuyaMCU, so OpenBeken must match that serial behavior before core heating functions work correctly. [#21429324]

Why does flashing a dumped WXU firmware image onto an XR809 boot fail even though OpenBeken itself boots on XR809?

It fails because the dumped firmware targets XR806-class hardware, not XR809. A direct test flashed the WXU backup to XR809 successfully, but the board showed no life, no current draw, and no output on RX0 or RX1. In contrast, flashing OBK back onto XR809 restored a normal boot log on RXD0. That result strongly points to platform mismatch rather than a bad dump or bad flashing process. [#21429353]

XR806 vs XR809: what are the practical differences for SDK compatibility, flashing pins, and OpenBeken porting?

They are similar enough for HAL reuse, but different enough to break direct firmware swaps. The thread found XR809 HAL code was about 99.9% reusable, and GPIO examples looked very similar between SDKs. The important practical differences were boot-pin behavior, build-system details, flash layout, and at least one efuse field difference such as EFPG_FIELD_MAC. That is why OpenBeken could be ported, yet still needed XR806-specific fixes. [#21435819]

How do I put an XR806 or Tuya WXU module into download mode, and which boot pins actually need to be grounded?

Ground PB02 to enter XR806 download mode. Early testing assumed PB02 and PB03 both had to be grounded, mirroring XR809 habits. Later notes in the same work said only PB02 needs to be pulled low on XR806, including successful flash reads from a WXU after grounding PB02. That makes XR806 easier to place in download mode than expected. [#21502313]

Why do I get a sync or 'synchron waiting' error when trying to read or flash an XR806, and how should TX/RX be wired?

Sync errors usually came from using the wrong UART pair or wiring TX/RX the wrong way. One tester fixed an XR-series sync issue after realizing the correct lines were UART0, not UART1. Another note added that for one XR case, RX had to go to RX and TX to TX for boot-log capture. If you see "synchron waiting," verify UART0 pins first and avoid assuming classic cross-over wiring. [#21429353]

Which UART on the XR806/WXU is used for flashing and which one outputs the boot log?

They are not always the same UART in practice. A key test showed an XR806 sample did work, but its output appeared on the flashing UART rather than the log UART the tester first monitored. Earlier stock-firmware work also captured boot text from RXD0. The safe rule is to probe both serial paths before assuming the board is dead. [#21430698]

How do I build XR806 SDK examples like hello_demo, wlan_demo, or at_demo with make menuconfig under WSL?

Build them from WSL with the SDK root as your working directory. 1. Install prerequisites such as build-essential and ncurses development packages. 2. Set the ARM GCC path in gcc.mk to the toolchain under sdk/tools. 3. Copy a demo defconfig, run make menuconfig, then make build or make image. This flow worked under WSL2 after GCC and ncurses were fixed. [#21432260]

What causes the lwip/netif.h missing error or OTA-related build failures in the XR806 SDK demos, and which menuconfig options fix them?

Those errors came from disabled network components in menuconfig, not from broken demo code alone. The lwip/netif.h failure appeared while building at_demo, and enabling lwIP, WLAN, AP/STA options, and OTA made the build progress. The thread also called out CONFIG_WLAN_AP, CONFIG_WLAN_STA, CONFIG_WLAN_MONITOR, and PRJCONF_NET_EN as required for full WLAN command support. [#21430812]

Why did OpenBeken on XR806 initially open port 80 but return no web GUI or empty HTTP responses?

The HTTP server thread was alive, but replies were blocked before a usable page reached the browser. Tests showed port 80 open on 192.168.51.1, accepted clients on fd 3, and received packets of about 453 to 479 bytes. Yet browsers reported ERR_CONNECTION_TIMED_OUT or ERR_EMPTY_RESPONSE. That proved the failure was in request handling or response generation, not in AP mode or TCP accept itself. [#21524592]

How was the XR806 HTTP issue tracked down to web authentication, and what changed to make the custom OpenBeken page finally load?

It was traced to HTTP auth logic, then fixed by disabling the XR806 auth block path. Debug builds showed packet receipt, then repeated HTTP packet with auth fail messages. After changing the XR806 auth behavior, logs switched to XR auth disabled and postany: send ..., and the custom OpenBeken page finally loaded. That was the first confirmed custom HTTP page running on XR806 in the thread. [#21524634]

Where should the sysinfo/config flash offset be placed on XR806 so OpenBeken settings are saved correctly without breaking XR809 or XR872?

Place XR806 sysinfo at 0x1FC000 and gate it with an XR806-specific platform check. Direct testing showed OpenBeken started saving config correctly at 0x1FC000, with about 12 KB left before the 2 MB flash end at 0x200000. The thread explicitly warned not to hardcode that address globally, because XR809 and XR872 use different layouts and need separate handling. [#21533999]

What is PhoenixMC, and how is it used with XR806 firmware images or upgrade commands during development?

PhoenixMC is the flashing utility used in this thread to parse, read, and write XR806 images. It successfully parsed SDK-built images, flashed stock and test binaries, and was later discussed as the possible path for an upgrade command that could avoid manual boot-pin grounding. In practice, it was the main tool for dumping firmware, restoring backups, and verifying whether new XR806 builds booted. [#21430654]

What are the remaining blockers for a fully working OpenBeken/OpenXR806 port on Tuya WXU devices, especially unstable Wi-Fi, MAC handling, config saving, and TuyaMCU support?

The main blockers were unstable Wi‑Fi behavior, wrong MAC handling, incomplete config persistence before the sysinfo fix, and unfinished TuyaMCU integration. One tester reported OpenBeken booted, exposed the web UI, but did not keep settings, did not enter STA mode, and still showed MAC inconsistencies. Another recurring issue was Wi‑Fi association without completing the full connection flow. By May 2025, XR806 builds existed, but the port was still a development target, not a finished daily-driver firmware. [#21524739]
Generated by the language model.
ADVERTISEMENT