logo elektroda
logo elektroda
X
logo elektroda

RTL8720DN, RTL8710B, RTL8710BX Compatibility with OpenBeken?

divadiow 10536 278
ADVERTISEMENT
  • #121 21379236
    p.kaczmarek2
    Moderator Smart Home
    Static IP turned out to be somewhat problematic. We have sprintf issues. I had to make two extra changes:
    Code: C / C++
    Log in, to see the code

    and:
    Code: C / C++
    Log in, to see the code

    I am not the author of original str_to_ip, but it could be done easier, but hey.... at least it works now. For RTL. Not sure about other platforms.

    @DeDaMrAz does WiFi LED blinks in DHCP as well?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #123 21379259
    divadiow
    Level 34  
    >>21377607

    which tool are you using?


    Screenshot of Ameba Image Tool V2.7.18 interface showing an error message.
  • #124 21379264
    p.kaczmarek2
    Moderator Smart Home
    AHH I know:
    Code: C / C++
    Log in, to see the code


    Added after 1 [minutes]:

    I see why WiFi LED does not work.
    All is still in hal\rtl87x0c\hal_wifi_rtl87x0c.c
    It seems that "got IP DHCP callback" is used for connect event:
    Code: C / C++
    Log in, to see the code


    Added after 1 [minutes]:

    I'll push a fix to the main branch in a moment

    Added after 2 [minutes]:

    Fixed: https://github.com/openshwprojects/OpenBK7231...mmit/4bb2eebb985a8a10b7bc6d4c076d4db22685f852 @DeDaMrAz please try
    Helpful post? Buy me a coffee.
  • #126 21379303
    divadiow
    Level 34  
    >>21361242

    T112_V1.1 RTL8710BN
    User interface of OpenRTL8710B_D88C5444 showing device information and configuration options. Screenshot of Ameba 1-N MP ImageTool software with USB port selected.
  • #127 21379319
    p.kaczmarek2
    Moderator Smart Home
    DeDaMrAz wrote:

    EDIT: 1.18.6 did not fix the WiFi LED blinking

    I see, it's because WIFI_EVENT_CONNECT is linked to wifi_con_hdl and not to wifi_conned_hdl.... ok let's try:
    https://github.com/openshwprojects/OpenBK7231...mmit/51a572e49280c0297ae2a8f8fc7d833be5b72e49
    Helpful post? Buy me a coffee.
  • #128 21379327
    DeDaMrAz
    Level 19  
    @insmod Here is the RTL B progress

    Screenshot of Ameba Image Tool V2.7.17 showing binary files to download.


    Wi-Fi network list with OpenRTL8710B_BFB4567F selected, on a green background.


    Screenshot of the OpenRTL8710B_test web interface with configuration buttons.

    OTA passed as well, waiting for new version to test more :)

    After OTA


    User interface of the OpenRTL8710B test on a webpage.

    Added after 9 [minutes]:

    >>21379319

    WiFi LED on static IP is working as well as on DHCP :)

    EDIT:

    Here is the device profile file for image tool for the current release.
  • #129 21379420
    insmod
    Level 22  
    Managed to run on RTL8711AM. But, i had to sacrifice RTL8710A support. (no xip support?)
    There is not enough RAM to run OBK, without moving a large code part to SDRAM, which 8710 lacks.
    OpenRTL8710A user interface screen with configuration buttons.
    This is only ramdebug, writing to flash currently gives
    Image1 length: 0x41fc, Image Addr: 0x10000bc8
    Image1 Validation Incorrect !!!
    

    Fixed that, now it boots.
    But one problem remains, mac address is zeroed, it is not stored in efuse (at least in the one that can be read, and i remember reading somewhere that it is stored on flash), and LwIP_GetMAC and the device mac i see on router are different.
  • ADVERTISEMENT
  • #130 21380578
    divadiow
    Level 34  
    >>21379303

    my limited fiddling:

    flash OpenRTL8710B_dev_20250104_235124.bin to OTA1 0x0800B000
    OTA to OTA2

    Code: Text
    Log in, to see the code


    User interface for OpenRTL8710B device displaying status and configuration options.

    try OTA again

    Code: Text
    Log in, to see the code


    <no reboot, device active>
    <power off/on>

    <boots back up as FW1 - so OTA seemed a success)

    try OTA again

    Code: Text
    Log in, to see the code


    device boots OK to FW2

    Added after 5 [minutes]:

    did that a few more times. it's always OTA2->OTA1 that doesn't kick off a reboot

    Added after 2 [hours] 53 [minutes]:

    flashed this T102_V1.1 RTL8710BX - almost a year since posting. flashed to factory backup from 0x08000000 then OpenRTL8710B to 0x0800B000. soldered module back

    BL0937 calibrated with 60w bulb
    OpenRTL8710B user interface displaying module status and parameters.

    LED is working as is relay and button

    Code: Text
    Log in, to see the code


    UPDATE:
    :D

    Screenshot displaying software version and uptime information.
  • #131 21381056
    p.kaczmarek2
    Moderator Smart Home
    It has more RAM than Flash?
    
    Memory
    
    1MB embedded ROM
    2.5MB embedded RAM
    Provides external flash interface
    

    Very interesting. You made me interested in flash usage again and I'm trying to check what we can strip from OBK for the future use. I'm testing in PRs right now.

    Added after 27 [seconds]:

    There are many things we can strip. Even this flags menu is not necessary, flags can be set via commands.
    Helpful post? Buy me a coffee.
  • #132 21381087
    insmod
    Level 22  
    >>21381056 Ram is 512kb + 2mb SDRAM, and that is because there is no XIP, like on AmebaZ and others, so data must be loaded into RAM. And ROM is not used at least on my device. Efuse is burnt to allow only spi boot. 4mb in my case, WRG1 module
    Initial log:
    <RTL8195A>===============================<RTL8195A>=========================================================
    
    ROM Version: 0.3
    
    Build ToolChain Version: gcc version 4.8.3 (Realtek ASDK-4.8.3p1 Build 2003) 
    
    =========================================================
    Check boot type form eFuse
    SPI Initial
    Image1 length: 0x41fc, Image Addr: 0x10000bc8
    Image1 Validate OK, Going jump to Image1
    
    BOOT from Flash:YES
    SPI calibration
    Find the avaiable window
    Baud:3; auto_length:0; Delay start:0; Delay end:63
    [SPIF Err]SpicNVMCalStore: The flash memory(@0x9080 = 0x2) is not able to be write, Erase it first!!
    ===== Enter Image 1 ====
    SPI calibration
    Find the avaiable window
    Baud:2; auto_length:21; Delay start:0; Delay end:63
    [SPIF Err]SpicNVMCalStore: The flash memory(@0x90b0 = 0x2102) is not able to be write, Erase it first!!
    SDR Controller Init
    Test 0: No match addr 0xc9d38 => 0xf != 0xc
    Test 0: No match addr 0x1f7c10 => 0x5 != 0xb
    
    OTA Im INVALID
    
    load NEW fw 0
    Flash Im2:Addr 0xb000, Len 221116, Load to SRAM 0x10006000
    Im3 length: 0x46700, Im3 Addr: 0x30000000
    Im2 Sign: RTKWin, InfaStart @ 0x10006189 
    ===== Enter Image 2 ====
    interface 0 is initialized
    interface 1 is initialized
    
    Initializing WIFI ...SPI calibration
    Find the avaiable window
    Baud:3; auto_length:0; Delay start:0; Delay end:63
    [SPIF Err]SpicNVMCalStore: The flash memory(@0x9080 = 0x2) is not able to be write, Erase it first!!
    Entering initLog()...
    Commands registered!
    initLog() done!
    Info:MAIN:Main_Init_Before_Delay
    
    WIFI initialized
    
    init_thread(53), Available heap 0x22b58Warn:CFG:CFG_InitAndLoad: Correct config has been loaded with 2 changes count.
    Error:CMD:lfs is absent
    
    Main_Init_Before_Delay doneInfo:GEN:PIN_SetupPins pins have been set up.
    Info:MAIN:Main_Init_Before_Delay done
    e
    Main_Init_Delay
    
    Main_Init_DInfo:MAIN:Main_Init_Delay
    Info:MAIN:Main_Init_Delay done
    ein_Init_DeInfo:MAIN:Main_Init_After_Delay
    


    Added after 9 [minutes]:

    And to get it to work on RTL8710AF, a lot of code would have to be cut. Without moving to SDRAM, i had "region `BD_RAM' overflowed" by about ~220k.
  • #133 21381094
    p.kaczmarek2
    Moderator Smart Home
    Oh at least it means, if I understand correctly, that code will be run from RAM and there will be no flash cache issue when trying to bit-bang WS2812?

    I am adding defines to disable large chunks of code, including LED driver, but I won't be able to finish it today. More news tomorrow. Maybe it can come useful someday for some platform.

    I want to have more control on what's included in the build and what's not. I hope to have some results soon.
    Helpful post? Buy me a coffee.
  • #134 21381312
    insmod
    Level 22  
    https://github.com/openshwprojects/OpenBK7231T_App/pull/1501
    Check RTL8710B OTA code, see if it can be reworked. Right now it looks horrible to my eyes, and i have no idea how to change it.
    RTL8710A is a bit misleading, as it is not supported. RTL8711AM was my main focus, but it should work on RTL8195AM (but who would have such an outdated module?).
    Moved easyflash to app, but that is not a best decision. Maybe link it as a submodule, but keep ef_port.c and ef_cfg.h?

    Is there a feasible way to create a UART->TCP bridge with current code? The module i have was taken from a zigbee coordinator
  • #135 21381328
    p.kaczmarek2
    Moderator Smart Home
    Very nice progress, I will try to at least flash my RTL8710BN soon.

    Easyflash seems to be pretty compact and self-contained, I wouldn't worry about it being in the app code right now. Just make sure to don't change the BK7231 config mechanism, as it is used by our flasher for now. As for new platforms, they can use easyflash, altough in the future I may look into adding easyflash to our flash tool, once we have our own flashing solution for RTLs, etc... so we can write OBK config from PC. But that's not important right now and it's a very distant plan.

    OTA code is messy for all platforms, but I am not sure what we can do about that. Maybe it could be more integrated, but it would require retesting everything, so maybe we'll just look over it...

    What do you need UART - TCP bridge for?
    I would probably try to copy to BL0942 code:
    Code: C / C++
    Log in, to see the code


    Code: C / C++
    Log in, to see the code

    Code: C / C++
    Log in, to see the code

    and do it in separate driver, in "quick tick", along with handling TCP socket in a non-blocking way so I can poll recv/send. That driver would run multiplatform as both those UART functions and TCP functions are multiplatform right now.
    So, create a separate file, add to drv_main.c array, etc, etc, in driver init setup UART and create socket, make socket non-blocking , and in quick tip poll UART and socket.

    Added after 1 [minutes]:

    EDIT: Now that I think about it, the UART<->TCP bridge on OBK could be even used to flash device via second OBK... but BK7231 does not like bad timings, so maybe it wouldn't be reliable...

    Added after 4 [hours] 57 [minutes]:

    EDIT: also see cmd_tcp.c for a TCP code... and of course there is also TCP in HTTP server.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #136 21381926
    vinibali
    Level 6  
    >>21377748 the ones, which are labeled as RX and TX on the CUCO Z0 V1.2 board. These pins are different from the RXLOG and TXLOG

    Added after 49 [seconds]:

    >>21377748 the ones, which are labeled as RX and TX on the CUCO Z0 V1.2 board. These pins are different from the RXLOG and TXLOG>>21378790
  • Helpful post
    #138 21384359
    insmod
    Level 22  
    >>21384190 Maybe, both RTL8711AM and B are in a good enough state.
    But, i will still complain about OTA on B.
    I got 4 days uptime on a B+bl0937 plug.

    Almost all of the modules on screenshot are unsupported.
    WBR1D/RTL8720DF is AmebaD.
    XR3 - is XR809 module, therefore supported.
    RTL8710ECF is AmebaLite, have yet to see it in any device.
    I don't know what is inside BW20, datasheet only mentions a RTL8711 without family name. AmebaD+?
    BT3L is TLSR8250F512ET32, so either bluetooth or zigbee.

    Added after 2 [hours] 59 [minutes]:

    Managed to create a uart->tcp bridge driver.
    Looks like it works.
    ExtraDebug:DRV:5 bytes TCP RX->UART TX: 1AC038BC7E
    Info:MAIN:Time 11, idle 0/s, free 112496, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 4/21 
    ExtraDebug:DRV:7 bytes UART RX->TCP TX: 1AC1020B0A527E
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:MAIN:Time 12, idle 0/s, free 92144, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 6/21 
    Info:MAIN:Time 13, idle 0/s, free 101232, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 4/21 
    ExtraDebug:DRV:8 bytes TCP RX->UART TX: 004221A850ED2C7E
    ExtraDebug:DRV:11 bytes UART RX->TCP TX: 0142A1A8582805C1AE247E
    ExtraDebug:DRV:4 bytes TCP RX->UART TX: 8160597E
    ExtraDebug:DRV:11 bytes TCP RX->UART TX: 7D314321A9542A1989FB7E
    ExtraDebug:DRV:13 bytes UART RX->TCP TX: 1243A1A9542A19B049E7E2DC7E
    ExtraDebug:DRV:4 bytes TCP RX->UART TX: 82503A7E
    ExtraDebug:DRV:12 bytes TCP RX->UART TX: 224021A9072A2DE8595E057E
    ExtraDebug:DRV:10 bytes UART RX->TCP TX: 2340A1A9072A159AB77E
    ExtraDebug:DRV:4 bytes TCP RX->UART TX: 83401B7E
    ExtraDebug:DRV:12 bytes TCP RX->UART TX: 334121A9072A0CB05997EB7E
    ExtraDebug:DRV:10 bytes UART RX->TCP TX: 3441A1A9072A15F1287E
    ExtraDebug:DRV:4 bytes TCP RX->UART TX: 8430FC7E
    ExtraDebug:DRV:12 bytes TCP RX->UART TX: 444621A9072A08805993D67E
    ExtraDebug:DRV:10 bytes UART RX->TCP TX: 4546A1A9072A1505697E
    Info:MAIN:Time 14, idle 0/s, free 105784, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 4/21 
    ExtraDebug:DRV:4 bytes TCP RX->UART TX: 8520DD7E
    ExtraDebug:DRV:12 bytes TCP RX->UART TX: 554721A9072A37B05980D97E
    ExtraDebug:DRV:10 bytes UART RX->TCP TX: 5647A1A9072A15AF307E
    ExtraDebug:DRV:4 bytes TCP RX->UART TX: 8610BE7E

    This is on WRG1 module (RTL8711AM) wired to EFR32MG21 Zigbee coordinator ZB-GW04 (via rx/tx pins) and connected via zigbee2mqtt.

    Added after 8 [hours] 15 [minutes]:

    On RTL8710A static ip is wrongly parsed on save
    IP=192.168.1.176 (c0 00 00 00)
    
    Mask=255.255.255.0 (ff 00 00 00)
    
    DNS=192.168.1.1 (c0 00 00 00)
    
    GW=192.168.1.1 (c0 00 00 00)
  • ADVERTISEMENT
  • #139 21384958
    p.kaczmarek2
    Moderator Smart Home
    I know this problem, wait a sec

    Added after 1 [minutes]:

    See here:
    https://github.com/openshwprojects/OpenBK7231...mmit/6eb8162b456410e1226104148e076303bcd9c8c6
    Or search in SDK for str_to_ip, in this file:
    https://github.com/openshwprojects/OpenBK7231...4148e076303bcd9c8c6/src/cmnds/cmd_tokenizer.c
    We have some kind of sscanf incosistency. I am not the one who created this str_to_ip, it could be done without sscanf... but ok.

    EDIT: Nice work on UART to TCP converter. I somehow didn't think about using two TCP sockets in separate threads, but it indeed solves the issue without the need of non-blocking Berkeley sockets. Still, I haven't managed to investigate your code more, altough I saw that channels are used there in some manner?

    Also, I've got more boards for testing, and I have already setup WBR3 with DS18B20 and DHT11 and they work.
    Breadboards with connected electronic modules on a wooden table.
    Helpful post? Buy me a coffee.
  • #140 21384975
    insmod
    Level 22  
    >>21384958 Channel is for TX indication, my zigbee gateway has 2 leds, on for wifi and one for zigbee.
    Static ip now works
  • #142 21385062
    insmod
    Level 22  
    >>21385049 RTL8710AF lacks SDRAM, so not supported. Only RTL8711AM/RTL8195AM are.
    Things are truly difficult when there is no XIP support.
  • #144 21385934
    p.kaczmarek2
    Moderator Smart Home
    I'm finishing the "per build defines" PR today or tomorrow and then I will look into testing Realtek. What's the state of OTA? Does it still fail in every second attempt, or something like that I heard?

    I think I may have RTL8710B or similiar LSPA9 clone somewhere. So I could also test power metering.
    Helpful post? Buy me a coffee.
  • #146 21387595
    vinibali
    Level 6  
    >>21378790 no luck with that unfortunately
  • #147 21387606
    insmod
    Level 22  
    >>21387595 Are you sure that yours uses BL0942? The plug in the pictures i found all have bl0937.
  • #148 21387821
    p.kaczmarek2
    Moderator Smart Home
    I didn't test it yet myself, but we have a report from polish user saying that WBR3 didn't restart for him after OTA 1.18.14 -> 1.18.18 and he had to do power off cycle manually. Still, take it with grain of salt, as I didn't test it yet. I'll try to test it and update, or we can ask @DeDaMrAz
    https://www.elektroda.pl/rtvforum/topic4098222.html#21387354
    Or maybe let me try it now...
    Before:
    Device management panel of OpenRTL87X0C with sensor data and functions.
    To 1.18.14:
    Screenshot of the OpenRTL87X0C_6622C1F4 device management panel.
    Ok now to 1.18.18:
    Screenshot of the OpenRTL87X0C interface with configuration information and button options.
    Strange, it works for me. I need to ask him for details.
    Helpful post? Buy me a coffee.
  • #150 21388928
    insmod
    Level 22  
    I ordered a WBRG1 zigbee hub, so after bk7238 i will port AmebaD.
    Btw, when will rtl8710b be merged? I need to be merged to open pull req. for bk7238.
    Does anyone know how to take a backup on amebad?

    Added after 3 [hours] 2 [minutes]:

    BW16 firmware backup, taken with ch341a after desoldering 2mb flash chip.
    Current programmer: CH341
    ID(9F): 684015(Unknown)
    ID(90): 6814(Unknown)
    ID(AB): 14(Unknown)
    ID(15): 0000(Unknown)

    Model is unknown, backup taken with GD25Q16B parameters.
    Since all Tuya RTL8720CS/D modules have at least 4mb, i replaced it with a W25Q32, preflashing it with the attached backup. It worked.
    Boot log:
    #calibration_ok:[2:19:11] 
    #
                         ######################                 ####################            ########################
                        #                      #               #                    #          #                        #
                       #     ################   #             # # ##################            #########      #########
                       #    #               #   #             # #                                       #      #
                       #   #                #   #             #  #                                      #      #
                       #   #                #   #              #  #                                     #      #
                       #   #                #  #                #  #                                    #      #
                       #    ################  #                  #  #                                   #      #
                       #                      #                   #  #                                  #      #
                       #   ################## #              #######  #                                 #      #
                       #   #                #  #            #          #                                #      #
                       #   #                #   #          #  #######   #        ####                   #      #
                       #   #                #   #          # #        #  #       #  #                   #      #
                       #   #                #   #          # #          #  #     #  #                   #      #
                       #   #                #   #          # #           #  #    #  #                   #      #
                       #    ################    #          #   ##########    #####  #                   #      #
                       #                       #            #                      #                    #      #
                        #######################               #####################                     ########
    
    version:v2.4.5,v6.2C(Nov 21 2023)
    interface 0 is initialized
    interface 1 is initialized
    
    Initializing WIFI ...
    WIFI initialized
    
    init_thread(58), Available heap 0x2f7a0
    AT_UART_CONF: 38400,8,1,0,0 C  

    Now i need a backup from tuya 4mb device, since i will need cfg/lfs flash offsets taht wouldn't erase tuya config.

Topic summary

The discussion revolves around the compatibility of RTL8720DN, RTL8710B, and RTL8710BX with OpenBeken firmware. Users share their experiences with various modules, including BW15 and WBR3, and discuss issues related to memory management, Wi-Fi connectivity, and flashing procedures. Several users report successful flashing and functionality tests, while others encounter problems with memory leaks and device reboots. The conversation also touches on the use of different tools for flashing, such as ltchiptool and rtltool, and the need for proper firmware versions to ensure compatibility. Additionally, there are mentions of specific features like MQTT support, GPIO control, and OTA updates.
Summary generated by the language model.
ADVERTISEMENT