logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

TH01 Sensor with OpenBeken: Forcing TuyaMCU to update Every 30 Seconds

patentjyp 336 3
ADVERTISEMENT
  • #1 21834649
    patentjyp
    Level 5  
    I have temp & humidity sensor TH01 flashed with Openbeken.

    TH01 is the same as in the link below.

    https://www.elektroda.com/rtvforum/topic3968377.html

    It reports temperature, humidity and battery without any problem.

    I connected TH01 to DC 3.3V source without battery so it is constantly on. I remove the transistor that turns on and off CB3S module and connected GND of CB3S module to GND of 3.3V DC source.

    I want force TuyaMCU to update temperature and humidity every 30 seconds. How do i do this?

    I tried

    Quote:

    addRepeatingEvent 30 -1 tuyaMcu_sendQueryState


    but it does not work.

    Before flashing TH01, I sniffed UART (with original Tuya firmware) and I obtained the log below.

    I am not sure the log below will help but just in case...


    Quote:

    Sent by WiFi module:
    55 AA 00 01 00 00 00
    HEADER VER=00 Product LEN CHK

    Sent by WiFi module:
    55 AA 00 01 00 00 00
    HEADER VER=00 Product LEN CHK

    Received by WiFi module:
    55 AA 00 01 00 24 7B2270223A226C66333679356E7762386A6B78776767222C2276223A22312E302E30227D 99
    HEADER VER=00 Product LEN {"p":"lf36y5nwb8jkxwgg","v":"1.0.0"} CHK

    Sent by WiFi module:
    55 AA 00 02 00 01 03 05
    HEADER VER=00 McuConf LEN 03 CHK

    Received by WiFi module:
    55 AA 00 02 00 00 01
    HEADER VER=00 McuConf LEN CHK

    Sent by WiFi module:
    55 AA 00 02 00 01 04 06
    HEADER VER=00 McuConf LEN 04 CHK

    Received by WiFi module:
    55 AA 00 02 00 00 01
    HEADER VER=00 McuConf LEN CHK

    Received by WiFi module:
    55 AA 00 08 00 0F 00010101010101010200040000010D 31
    HEADER VER=00 QueryInitStatus LEN INVALID date dpId=1 Val V=269 CHK

    Received by WiFi module:
    55 AA 00 08 00 0F 000101010101010202000400000017 3B
    HEADER VER=00 QueryInitStatus LEN INVALID date dpId=2 Val V=23 CHK

    Sent by WiFi module:
    55 AA 00 08 00 01 00 08
    HEADER VER=00 QueryInitStatus LEN INVALID date CHK

    Received by WiFi module:
    55 AA 00 08 00 0C 000303030303030304000102 2F
    HEADER VER=00 QueryInitStatus LEN INVALID date dpId=3 Enum V=2 CHK

    Sent by WiFi module:
    55 AA 00 08 00 01 00 08
    HEADER VER=00 QueryInitStatus LEN INVALID date CHK

    Received by WiFi module:
    55 AA 00 10 00 02 0109 1B
    HEADER VER=00 ObtainDPcache LEN CHK

    Sent by WiFi module:
    55 AA 00 08 00 01 00 08
    HEADER VER=00 QueryInitStatus LEN INVALID date CHK

    Sent by WiFi module:
    55 AA 00 10 00 02 0100 12
    HEADER VER=00 ObtainDPcache LEN CHK

    Sent by WiFi module:
    55 AA 00 01 00 00 00
    HEADER VER=00 Product LEN CHK

    Received by WiFi module:
    55 AA 00 01 00 24 7B2270223A226C66333679356E7762386A6B78776767222C2276223A22312E302E30227D 99
    HEADER VER=00 Product LEN {"p":"lf36y5nwb8jkxwgg","v":"1.0.0"} CHK

    Received by WiFi module:
    55 AA 00 02 00 00 01
    HEADER VER=00 McuConf LEN CHK

    Sent by WiFi module:
    55 AA 00 02 00 01 03 05
    HEADER VER=00 McuConf LEN 03 CHK

    Sent by WiFi module:
    55 AA 00 02 00 01 04 06
    HEADER VER=00 McuConf LEN 04 CHK

    Received by WiFi module:
    55 AA 00 02 00 00 01
    HEADER VER=00 McuConf LEN CHK

    Received by WiFi module:
    55 AA 00 08 00 0F 000101010101010102000400000139 5D
    HEADER VER=00 QueryInitStatus LEN INVALID date dpId=1 Val V=313 CHK

    Received by WiFi module:
    55 AA 00 08 00 0F 000101010101010202000400000032 56
    HEADER VER=00 QueryInitStatus LEN INVALID date dpId=2 Val V=50 CHK

    Sent by WiFi module:
    55 AA 00 08 00 01 00 08
    HEADER VER=00 QueryInitStatus LEN INVALID date CHK

    Received by WiFi module:
    55 AA 00 08 00 0C 000303030303030304000102 2F
    HEADER VER=00 QueryInitStatus LEN INVALID date dpId=3 Enum V=2 CHK

    Received by WiFi module:
    55 AA 00 10 00 02 0109 1B
    HEADER VER=00 ObtainDPcache LEN CHK

    Sent by WiFi module:
    55 AA 00 08 00 01 00 08
    HEADER VER=00 QueryInitStatus LEN INVALID date CHK

    Sent by WiFi module:
    55 AA 00 08 00 01 00 08
    HEADER VER=00 QueryInitStatus LEN INVALID date CHK

    Sent by WiFi module:
    55 AA 00 10 00 02 0100 12
    HEADER VER=00 ObtainDPcache LEN CHK
  • ADVERTISEMENT
  • #2 21835733
    p.kaczmarek2
    Moderator Smart Home
    My first question would be do you get any readings at all now?

    From what I remember, the TuyaMCU battery powered driver works in such a way that MCU turns on the WiFi module, and WiFI module sends request to the MCU. If you power WIFI module constantly, then it won't know when to send packet to the MCU, so it wont have a transaction, so it won't get temperature at all.

    Please confirm, are you getting any readings when powering WiFI module constantly?


    I think the correct solution here is to remove the MCU from the board and connect the sensor directly to WiFi chip.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 21840885
    patentjyp
    Level 5  
    >>21835733

    You are correct. No reading at all.

    I removed Tuya MCU and directly connected CHT8310 to CB3S via I2C.
  • #4 21840974
    p.kaczmarek2
    Moderator Smart Home
    Is it working now? How many bridges did you had to make, can you show a photo to help other users?
    Helpful post? Buy me a coffee.
ADVERTISEMENT