logo elektroda
logo elektroda
X
logo elektroda

[Solved] [BK7231N/CBU] Tuya TH08 Wi-Fi Thermometer+Hygrometer - Issues with TuyaMCU

depau 1176 8
ADVERTISEMENT
  • #1 21336261
    depau
    Level 2  
    Hi! I'm trying to run OpenBeken on this Tuya Wi-Fi smart thermometer hygrometer date/time. Since I've had it for quite a while I no longer have the original box to show.

    Opening it is not easy since the plastic housing is significantly stiff, but if you jam a thin metal tool into the bottom side and pry really hard it should open up.

    Some pictures of the device while I'm working on it:
    Smart Tuya Wi-Fi thermometer displaying date, temperature, and humidity. Interior of a disassembled Tuya Wi-Fi smart thermometer showing the PCB with a CBU (BK7231N) module and battery connectors.

    High-res pictures of the PCB with the CBU module removed
    Close-up of the PCB of a Tuya Wi-Fi smart thermometer. Rear view of the PCB from a Tuya Wi-Fi smart thermometer.

    The module is a CBU (BK7231N), the config seems to be empty:

    Code: JSON
    Log in, to see the code


    After flashing OpenBeken (I had to desolder the CBU from the board to flash it, similarly to this other device), the display still works, but the time is not up to date. It looks like most of the board is controlled by TuyaMCU and the Beken chip only takes care of the wi-fi. Like other similar battery-powered devices it also shuts down Wi-Fi automatically unless I keep pushing the top button which wakes it up.

    I tried using this script from the similar device linked above:
    
    startDriver TuyaMCU
    startDriver NTP
    // dpID 1 is tempererature div 10
    setChannelType 1 temperature_div10
    linkTuyaMCUOutputToChannel 1 val 1
    // dpID 2 is % humidity
    setChannelType 2 Humidity
    linkTuyaMCUOutputToChannel 2 val 2
    


    but it didn't seem to work. Later I realized that the TuyaMCU is connected to UART2, so I enabled flag 26 "[UART] Use alternate UART for BL0942, CSE, TuyaMCU, etc" and that also didn't make a difference.

    I pulled out my logic analyzer and recorded the TuyaMCU communication, with and without the stock firmware. You can find the UART recordings from my logic analyzer attached (open them with Sigrok's PulseView, but it seems that OpenBeken isn't even trying to talk to the MCU.

    So that's where I got stuck, any ideas? Thank you!
    AI: Could you provide the specific configuration settings you used in OpenBeken, including any changes made to the default settings?
    Yes, I already provided the OpenBeken script and the flags in the post.
    AI: What did the logic analyzer recordings reveal about the communication attempts between OpenBeken and the TuyaMCU? Any specific patterns or lack of signals?
    The logic analyzer recordings showed a pattern of break conditions coming from OpenBeken but no actual data transmission. Occasionally the TuyaMCU did send some data but it looks like OpenBeken didn't receive it.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #2 21336284
    divadiow
    Level 35  
    Hi. If you'd be happy to post the factory firmware file that may help to get more information.
  • Helpful post
    #3 21336338
    insmod
    Level 25  
    >>21336261 try startDriver tmSensor after tuyamcu
    There should also be a dpid for battery level
  • ADVERTISEMENT
  • #5 21336400
    depau
    Level 2  
    >>21336338
    Hi, thanks for your help. startDriver tmSensor doesn't seem to make a difference, the firmware still doesn't seem to be talking to the TuyaMCU
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • Helpful post
    #6 21336417
    insmod
    Level 25  
    Considering this is a battery device, tmsensor is truly needed.
    Maybe uart pins weren't soldered back correctly?
    Additional dpIds: 3 for battery ReadOnlyLowMidHigh
    dpId 9 for Celsius/Fahrenheit (0 C, 1 F)
  • ADVERTISEMENT
  • #8 21337008
    depau
    Level 2  
    spin55 wrote:
    https://www.elektroda.com/rtvforum/topic4000657.html


    Thanks, I searched before but I could not find it!

    I managed to make it work. First of all I was wrong that TuyaMCU was on UART2, it was on UART1, so that definitely made me waste a lot of time. This script seems to do the trick:

    Code: Text
    Log in, to see the code


    Thanks for your help![/code]
    Helpful post? Buy me a coffee.

Topic summary

The discussion revolves around the integration of OpenBeken firmware on the Tuya TH08 Wi-Fi thermometer and hygrometer, which utilizes the BK7231N CBU module. The user faced challenges with the device's configuration, initially finding the TuyaMCU communication ineffective. Suggestions included posting the factory firmware and utilizing the tmSensor driver. After troubleshooting, the user discovered that the TuyaMCU was connected to UART1 instead of UART2, which resolved the communication issues. The final configuration involved setting up various drivers and linking channels for temperature, humidity, and battery levels.
Summary generated by the language model.
ADVERTISEMENT