logo elektroda
logo elektroda
X
logo elektroda

New firmware for WT5 Multi-Channel LED controller with RF - TuyaMCU?

Kinsi55 7473 106
ADVERTISEMENT
  • #91 21364024
    p.kaczmarek2
    Moderator Smart Home
    TuyaMCU does the RF, so RF will still work after you change WiFi module firmware.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #92 21378760
    atomphil
    Level 10  
    >>21364024 But if you use RF and WiFi at the same time and switch via the supply voltage, the last setting is started correctly for a short time after switching on, but then overwritten with the values from the web interface after starting the WiFi module. These differ from the last value if the RF was used.
    Simultaneous use is not practical. I have therefore deactivated the WiFi control on my WT5 again, as the unwanted sending of the web interface values to the TuyaMCU at the start cannot be deactivated and we also want to use the RF.

    Hinzugefügt nach 6 [Minuten]:

    >>20889438 Do these findings perhaps also apply to the WT5?
  • #93 21379163
    p.kaczmarek2
    Moderator Smart Home
    These findings are for devices that are not using the usual WiFi state mechanism:
    
    tuyaMcu_defWiFiState 4
    

    if tuyaMcu_defWiFiState is not working, then the linked findings apply, but as far as I can tell, WT5 is using tuyaMcu_defWiFiState and also it has no extra pin from MCU to WiFi module so it is not affected by what you linked.
    Helpful post? Buy me a coffee.
  • #94 21379847
    atomphil
    Level 10  
    Could you please implement an option where OBK only sends the values to the TuyaMCU that have been changed (via web interface, HA etc.) and the sending of all other values for synchronization is suppressed?

    Yes, this would mean that the web interface would not be synchronized with the actual light status when using the RF, but this is irrelevant in daily operation if you only use the RF and HA (Zigbee switches and scripts).
    If used exclusively without RF, it is theoretically also not necessary to send the data for synchronization, as the TuyaMCU saves the last status.

    Without this option, mixed operation of the WT5 is not possible, as the current settings are always overwritten with those saved in OBK after power-on.
  • #95 21379936
    p.kaczmarek2
    Moderator Smart Home
    Ok, can you point exactly what's being sent from OBK that you want to disable?
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/driver/drv_tuyaMCU.c
    As far as I can see, in general the TuyaMCU_OnChannelChanged callback does the sending, but for LED, we have a special mechanism, TuyaMCU_OnRGBCWChange, which is called from cmd_newLEDDriver.c (apply_smart_light).
    I can see that apply_smart_light can be called on boot only if remember state flag is set:
    Code: C / C++
    Log in, to see the code

    but I'm not sure, if you want to test, disable this flag or just use online compilation system to test your own changes:
    https://www.elektroda.com/rtvforum/topic4033833.html#20946719
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #96 21380520
    atomphil
    Level 10  
    I haven't quite understood what's going on yet.

    The controller always has a life of its own with the Tuya driver activated, regardless of how OBK_FLAG_LED_REMEMBERLASTSTATE is set.
    The difference is when OBK_FLAG_LED_REMEMBERLASTSTATE = 1, the last setting from OBK is set and with the value 0 cold white full brightness.
  • #97 21407597
    c0m4r
    Level 11  
    I have such a WT5 controller with a CB3S module. Using the BK7231 Easy UART Flasher I have uploaded the software (unfortunately without making a copy) and in the end everything is ok but unfortunately the module does not connect to my wifi nor after doing erase all does it expose its AP. I flash several times and each time it is ok but the wifi is not there. What can I do next to look for the cause of the problem?
  • ADVERTISEMENT
  • #98 21407695
    p.kaczmarek2
    Moderator Smart Home
    Have you entered your SSID and password in the options, in configure WiFi?
    Helpful post? Buy me a coffee.
  • #99 21407749
    c0m4r
    Level 11  
    I have tried both filling in the OBK settings in the flasher so that it immediately connects to wifi and leaving it unfilled so that the AP appears to connect. Each time without success. Neither connects to my wifi nor puts out an AP.
    I have checked the read "read only OBK settings" and the data about my wifi stored in the chip is ok.
    I tried to connect with the putty to the TX2 pin (from the RX programmer to the TX2 pin, without the other lines) the power supply I have applied normal to the whole device but some bushes are

    Screenshot from PuTTY showing garbled characters in the terminal.
  • #100 21407774
    p.kaczmarek2
    Moderator Smart Home
    From TX2 collect the log at baud 115200. In flasher you can still do a restore RF partition.
    Helpful post? Buy me a coffee.
  • #101 21407812
    c0m4r
    Level 11  
    I did the RF restore, checked the Read OBK config again, log below, looks all ok.
    As I connect from the 3.3V/GND converter and from RX to TX2 (11pin) in CB3S, I run putty on the same COM as I programmed, baud 115200 and nothing happens, empty terminal.
    If I leave only the RX to TX2 line connected and supply the controller with 12V there is one line in the terminal
    PuTTY terminal with unreadable characters displayed on a black background. .
    When I still connect the TX lines from the converter to RX2 from CB3S it flies very quickly fffff itself

    Screenshot of PuTTY program with unreadable characters in the terminal.

    Starting write test!
    Now is: piątek, 24 stycznia 2025 15:16:49.
    Flasher mode: BK7231N
    Going to open port: COM5.
    Serial port open!
    Getting bus... (now, please do reboot by CEN or by power off/on)
    Getting bus success!
    Going to set baud rate setting (921600)!
    Will try to read device flash MID (for unprotect N):
    Flash MID loaded: 1560EB
    Will now search for Flash def in out database...
    Flash def found! For: 1560EB
    Flash information: mid: 1560EB, icName: TH25Q16HB, manufacturer: TH, szMem: 1000000, szSR: 2, cwUnp: 0, cwEnp: 7, cwMsk: 407C, sb: 2, lb: 5, cwdRd: 05-35-FF-FF, cwdWr: 01-FF-FF-FF
    Entering SetProtectState(True)...
    sr: 0
    sr: 0
    final sr: 0
    msk: 407c
    cw: 0, sb: 2, lb: 5
    bfd: 0
    SetProtectState(True) success!
    Going to read encryption key...
    Encryption key read done!
    Encryption key: 510fb093 a3cbeadc 5993a17e c7adeb03
    Erasing sector 0x1D0000... ok! 
    All selected sectors erased!
    Writing sector 1900544... ok! Starting CRC check for 1 sectors, starting at offset 0x1D0000
    CRC matches 0x890D0AC8!
    Write success!
    Starting read!
    Read parms: start 0x1D1000 (sector 465), len 0x1000 (1904640 sectors)
    Now is: piątek, 24 stycznia 2025 15:17:17.
    Flasher mode: BK7231N
    Going to open port: COM5.
    Serial port open!
    Getting bus... (now, please do reboot by CEN or by power off/on)
    Getting bus failed, will try again - 0/100!
    Getting bus success!
    Going to set baud rate setting (921600)!
    Will try to read device flash MID (for unprotect N):
    Flash MID loaded: 1560EB
    Will now search for Flash def in out database...
    Flash def found! For: 1560EB
    Flash information: mid: 1560EB, icName: TH25Q16HB, manufacturer: TH, szMem: 1000000, szSR: 2, cwUnp: 0, cwEnp: 7, cwMsk: 407C, sb: 2, lb: 5, cwdRd: 05-35-FF-FF, cwdWr: 01-FF-FF-FF
    Entering SetProtectState(True)...
    sr: 0
    sr: 0
    final sr: 0
    msk: 407c
    cw: 0, sb: 2, lb: 5
    bfd: 0
    SetProtectState(True) success!
    Going to read encryption key...
    Encryption key read done!
    Encryption key: 510fb093 a3cbeadc 5993a17e c7adeb03
    Going to start reading at offset 0x1D1000...
    Reading 0x1D1000... Ok! 
    Basic read operation finished, but now it's time to verify...
    Starting CRC check for 1 sectors, starting at offset 0x1D1000
    CRC matches 0x2E171159!
    All read!
    Loaded total 0x1000 bytes 
    OBK config loaded. You can now view it by clicking 'Change OBK settings' button.
    You can also edit it whatever you want.
    You can also use 'Write OBK config' button to write it back with your changes.
    
    .
  • ADVERTISEMENT
  • #102 21407847
    p.kaczmarek2
    Moderator Smart Home
    Maybe you have removed the bootloader for yourself? Enable "overwrite bootloader" in flasher.

    Erase All doesn't need to be done at all, or maybe you did it so now flashing OBK leaves an empty space after the bootloader, so you have to re-upload it....
    Helpful post? Buy me a coffee.
  • #103 21407915
    c0m4r
    Level 11  
    Bootloader, it was :) Thank you.
    The logs came up, the device logged into the Wi-Fi, but unfortunately the webpanel does not open.
    First I tried with DHCP, on the router it got the address 192.168.2.88, then I made a reservation for this address and in BK config I made a static IP with the same address. Unfortunately the webpanel does not report :( .
    Screenshot of a terminal showing device connection logs to a Wi-Fi network. .
  • #104 21407939
    p.kaczmarek2
    Moderator Smart Home
    What do you mean with webpane? The basic web panel should work. The Web App, on the other hand, only works if you have internet access because the Web App is a script from the open Github repository downloaded from the web (with the option to host this at home);.
    Helpful post? Buy me a coffee.
  • #105 21407977
    c0m4r
    Level 11  
    I am referring to the basic web panel - the page is not loading. I understand that it works on standard port 80? Is there anything in the logs to check if the panel is okay?
  • #106 21407983
    p.kaczmarek2
    Moderator Smart Home
    You may have messed up the RF partition with this Erase All. Perform Restore RF partition in flasher. Is the device responding to the ping? The site should work normally on port 80.
    Helpful post? Buy me a coffee.
  • #107 21408440
    c0m4r
    Level 11  
    I think I know what the problem is. There's a bug in either the firmware or the flasher that doesn't set dhcp=1 correctly when you edit the static IP address. I removed the network settings in flasher and set all addresses to just 0 so that there was dhcp, uploaded the flash, RF and bootloader again and the module issued its AP. I have configured my WiFi, the module has connected to the network, but the dhcp still has the 0 flag, which means it can't/won't set itself the IP address the router has assigned it, so even though I go to the address the router has assigned, the module can't see the address - you can see this well in the logs
    Console logs showing DHCP and MQTT issues.

    EDIT:
    I couldn't get a deal with DHCP, only setting a static IP address + reservation on the router sorted it out and the web panel works. Thanks for helping me get it up and running, now I'll be connecting and fighting with the LEDs ;) .

Topic summary

The discussion revolves around the WT5 Multi-Channel LED controller, which utilizes a WB3S Wi-Fi module and an SC95F8615 SOC for controlling MOSFETs. Users are exploring the possibility of flashing the device with new firmware, specifically OpenBeken, to enable better integration with TuyaMCU. Key points include the need for UART communication captures to understand the device's operation, the challenges of RF remote control integration, and the behavior of the device upon power cycling. Users have shared their experiences with firmware flashing, configuration scripts, and the limitations of the current setup, particularly regarding the synchronization of settings between the RF remote and the web interface. Solutions discussed include modifying the autoexec.bat for persistent settings and capturing communication data for further analysis.
Summary generated by the language model.
ADVERTISEMENT