logo elektroda
logo elektroda
X
logo elektroda

[BK7231N/CBU] Tuya TH01? Generic Wi-Fi Temperature & Humidity Sensor [CHT8310]

divadiow 24582 134
ADVERTISEMENT
  • ADVERTISEMENT
  • #122 21402430
    p.kaczmarek2
    Moderator Smart Home
    Maybe we can start with Tuya Config Extraction:


    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #123 21403366
    rhizome
    Level 2  
    @divadiow thanks! I haven't seen the topic.. their config worked instantly without tweaks. @p.kaczmarek2 many thanks for fundamentals! :)
  • #124 21403545
    lktrdng
    Level 4  
    >>21402420
    Remember i am a newbie, mine is more good intentions than knowledge.
    I would reboot without any driver, double check the CHT83XX_SCK and CHT83XX_SDA, and maybe load it manually.
    Also, you can quickly check if my config also works with your device. I think we have the very same device.
    
    {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "Tuya TH Sensor",
      "model": "enter short model name here",
      "chip": "BK7231N",
      "board": "PCB_576P1-V1.0",
      "flags": "0",
      "keywords": [
        "Tuya",
        "CHT8310",
        "temperature",
        "humidity",
        "battery",
        "sensor"
      ],
      "pins": {
        "6": "CHT83XX_SCK;1;0",
        "9": "CHT83XX_SDA;1;2",
        "17": "BAT_Relay;5",
        "20": "dInput;43",
        "23": "BAT_ADC;40",
        "26": "WifiLED_n;37"
      },
      "command": "backlog PowerSave 1; startDriver battery; startDriver CHT83XX; Battery_Setup 2350 3000; CHT_calibrate -1.5 10",
      "image": "https://obrazki.elektroda.pl/5076675700_1736544409.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/topic4098816.html"
    }


    Added after 2 [minutes]:

    >>21403545
    Sorry, i just realized you already solved the issue. My bad :S.
  • #125 21414181
    sns1
    Level 5  
    Hi,

    I'd like to share some thoughts on this sensor and its optimization and take some advice if any.
    I've converted 4 units (BK7321N CHT3815), added lifepo4 18650 (1.5ah) battery and usb-charger module, packed all in small box with leds/buttons so it's somewhat useful device for monitoring temps on premises.

    Autoexec.bat -
    PowerSave 1
    
    startDriver NTP
    startDriver Battery
    startDriver CHT83XX
    
    Battery_Setup 2500 3400 2.00 2400 4096
    Battery_cycle 2
    
    addEventHandler OnHold 20 SafeMode
    //addEventHandler OnClick 20 delay_s 600
    DSEdge
    
    
    waitFor WiFiState 4
    
    
    publishAll
    delay_s 5
    
    PinDeepSleep 900


    Issues:
    - You have to calibrate each one for reasonable battery measurement. Across all 4 units - dividers are 1.96 to 2.10, it's somewhat important for proper battery monitoring.
    - It's not convenient to reconfigure device, since the path is to boot it into safemode, delete autoexec, restart and configure... If I could launch Web Application under SafeMode - it would be much easier.
    - I'm yet to optimize for how long it should delay before deepsleep. 3 seconds is too small, 10 seconds is too long (for battery reasons), I wish there would be some mqtt state on finishing publish. Probably have to mqtt publish properly and estimate across devices, since not all report, for example, battery data in time, for some devices 5 seconds is enough, for 2 of them it is not...

    p.s. not yet implemented mqtt not found workaround.
  • #126 21511164
    irogala
    Level 2  
    Hi!
    My sensor just went crazy after a couple of months working relatively normal (but draining battery like hell). Yesterday it went silent and after trying all I could I realized the only things which still work are flashing and debug output on TX2 which looks like this:

    V:BK7231N_1.0.1
    REG:cpsr     spsr     r13      r14
    SVC:000000D3          00401C1C 000033AC
    IRQ:000000d2 00000010 00401e0c 00004c28
    FIR:000000d1 00000010 00401ffc db6ca612
    SYS:000000df          0040192c 00000158
    ST:0001AD12
    J 0x10000
    bk_misc_init_start_type b 1ad12
    prvHeapInit-start addr:0x4142f0, size:113936
    [Flash]id:0xeb6015
    sctrl_sta_ps_init
    cset:0 0 0 0
    Entering initLog()...
    Commands registered!
    initLog() done!
    Info:MAIN:Main_Init_Before_Delay



    after this there are only garbage output and of course software doesn't start.
    Any idea what/how to try to bring it to life?
  • #127 21511232
    divadiow
    Level 34  
    irogala wrote:
    Any idea what/how to try to bring it to life?

    I believe we've seen this before when battery gets too low and the solution has been to solder it back up and reflash - maybe to full factory to restore all then start with OBK again.
  • ADVERTISEMENT
  • #128 21511415
    irogala
    Level 2  
    >>21511232
    I felt the same but apparently it can be reflashed without desoldering, I can read OBD config successfully but it doesn't help with boot. Not sure what to reset or erase to change that. And yes, it died due to depleted battery probably.

    Dodano po 9 [godziny] 23 [minuty]:

    Seems reflashing with original tuya firmware and back OBK couple of times helped, it's back working 8-/
  • ADVERTISEMENT
  • #129 21571199
    bzzzt
    Level 1  
    A friend of mine bought a couple of these WiFi thermostats, and he realized later, that they (annoyingly) connect to the main server and you also need an app to monitor them,
    On the chip it says the following:
    CBU 2.01.01.103308
    Close-up of a thermostat PCB with a WiFi module labeled CBU and part number 2.01.01.103308.

    I searched around, and I found the tuya-cloudcutter github repo and the list of supported models, but I can't seem to find the exact model for this item.
    I searched the net and according to some images there are different versions (possibly older) of this thermostat, the differences being rather minor, like different icon on plastic or some of them have a barcode model name printed on one of the sides of the battery cover.

    Could the procedure presented in this thread work on this, or is it a different model?
    How could I find the model id/name and see if it is supported by cloudcutter?
    Do I need to dump the firmware?

    Also attaching additional images:
    Close-up of a white electronic module with black printed text, with a white casing visible underneath.
    Label with barcode and product info Tuya WiFi Temperature Humidity Sensor Smart Life on a white cardboard box.
    Close-up of a temperature and humidity sensor package label, showing a QR code and manufacturer details.
    White box with Wi-Fi temperature and humidity sensor, Tuya and Wi-Fi logos, and a thermometer graphic on the front.
    Three parts of a disassembled WiFi thermometer: back cover, front case with thermometer symbol, and electronic circuit board.
  • #131 21598960
    oddyutza
    Level 4  
    I have a BK7321N CBU CHT8305 with a Green PCB Dated 2023.
    On the PCB there is written MCU WFWSD01 Ver01.
    I've managed to flash it properly but I've used all possible templates for the GPIO Assignments none of them worked Temperature is shown as 125Celsius and hum as 100%
    I've tried to extract the Tuya GPIO pins but I had no luck ( please see attached picture from the first post in the thread ).
    Manually I tried with:
    "20": "CHT83xx_SCK;0",
    "22": "CHT83xx_SDA;0;1",
    //
    "20": "CHT83xx_SCK;0",
    "22": "CHT83xx_SDA;1;0",
    //

    Any ideas further on ?
  • #135 21612622
    divadiow
    Level 34  
    Your device has a TuyaMCU so assigning CHT83XX driver to GPIOs is not how to set this one up. It'll be a case of creating an autoexec.bat and configuring dpID mappings. This device is similar https://www.elektroda.com/rtvforum/topic3968377.html

    Many TuyaMCU devices are in the devicelist from which the experience of others may help https://openbekeniot.github.io/webapp/devicesList.html

    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md
    https://www.elektroda.com/rtvforum/topic3970199.html
    https://www.youtube.com/watch?v=kXi8S12tmC8

Topic summary

The discussion centers on the Tuya-based generic Wi-Fi temperature and humidity sensor labeled as TH08 but identified as TH01 with a Sensylink CHT8310 sensor and BK7231N chip on a CBU board. Users share experiences with flashing OpenBK firmware using BK7231GUIFlashTool and CP2102 or other USB-serial adapters, addressing issues like firmware patch detection, flashing failures, and device bricking due to power supply limitations. A community-developed CHT8310 driver integrated into the CHT8305 driver supports the sensor, requiring proper pin configuration, including dual channels for SDA and BAT_Relay pins. Calibration challenges are noted, especially temperature offsets and poor accuracy at low temperatures, with some users applying software offsets. Battery monitoring and management are discussed extensively, including identifying BAT_Relay and BAT_ADC pins, voltage calibration, and scripting autoexec.bat to optimize battery life and prevent bootloops on low battery by conditional deep sleep durations. The ALERT pin on P7 is used to wake the device from deep sleep on environmental changes, reducing power consumption. Users also explore polling rate adjustments to reduce unnecessary sensor reads. Integration with Home Assistant via MQTT is addressed, with configuration tips to avoid data misinterpretation. Some users report pairing issues with the original Tuya app after battery depletion, resolved by router resets. The community contributes device templates with detailed pin assignments and commands, improving support in OpenBeken firmware and cloudcutter profiles. Discussions include hardware details like the PW33 boost converter, power supply considerations, and potential for device display enhancements. Overall, the thread provides comprehensive technical guidance on flashing, configuring, calibrating, and optimizing the Tuya TH01/TH08 sensor with CHT8310 using OpenBK firmware.
Summary generated by the language model.
ADVERTISEMENT