logo elektroda
logo elektroda
X
logo elektroda

OpenBeken to Wi-Fi router connectivity troubleshooting question

carlig833 708 3
ADVERTISEMENT
  • #1 21097301
    carlig833
    Level 7  

    Hello there,
    I have a TH01Y-CB3S_V1.6 temperature/humidity sensor based on Tuya CB3S, then BK7231N.
    The question I am asking may be applicable to other OpenBeken supported devices though.

    The problem is that the device, based on OpenBeken firmware, cannot connect to my router and I don't know why.
    When I access the router's page listing all connected devices it is not there. I have a FRITZ!Box 7530.
    Other OpenBeken devices (not this model) can connect to my router with no problem.
    This device can connect to another "router", that is my Android phone's hotspot, without problems.
    The device AP works ok, but as soon as I set SSID and password of my router I lose control over it.

    The question to the forum is: what methods and toolbox can I use to troubleshoot this issue and understand the root cause.

    I wonder if either one of the two options below is viable or any other is to be considered:

    1. collect and decode the logs in real-time using RX/TX connection to the device.
    2. configure "persistent logs" so that I can collect them when the device is failing to connect to my router, then revert to access point mode and download the logs

    Do you have any link that covers 1 or 2 or do you have any other suggestions?
  • ADVERTISEMENT
  • Helpful post
    #2 21097507
    spin55
    Level 17  
    https://developer.tuya.com/en/docs/iot/wb3s-module-datasheet?id=K9dx20n6hz5n4
    Pin 11 -> TX2

    If you connect the Rx terminal of the USB-UART converter to that pin 11 of WB3S, you will be able to obtain information that allows you to move forward. To see this information you can use programs such as Realterm or the serial port of the Arduino IDE configured at 115200bps.

    The TH01 has an extra chip that controls everything, including the Wi-Fi module (in this case WB3S). We call this chip TuyaMCU and, for now, the firmware inside is not touched. This TuyaMCU chip controls the power of the WiFi module and sometimes cuts off so quickly that it prevents you from seeing the logs in the web App and could even cause you not to see the IP in the router logs.

    Normally, on devices with a TuyaMCU chip and powered by batteries, there is a way to prolong the Wi-Fi connection by holding down the pairing key or button. In this case you could see the IP in the MQTT record list and, knowing this, access the device's web page. But the ideal thing is to monitor pin 11, which will allow you to see everything that happens from the battery connection.
  • ADVERTISEMENT
  • #3 21098051
    carlig833
    Level 7  

    Thanks spin55.
    I have used putty to see the logs after connecting TX2 and RX2 to the USB-SERIAL adapter.
    The following pattern found in logs likely indicates that this is an authentication problem from the device to my router:

    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_AUTH_FAILED - 3
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_DISCONNECTED - 2

    The reason this is happening remains unknown. The SSID and key found in the logs are real and matching, there should not be authentication failure.
    I am attaching the logs here just in case it can be used for help (I changed the actual key for privacy reasons).
    At this point I don't know what else to do to fix the problem.
  • #4 21098461
    spin55
    Level 17  
    Since you say that this only happens to you with this device, I tell you the following:

    I do not have this WiFi device, but I have two Zigbee that are equivalent, model ZTH01. They both have the same symptom: they have pairing problems and I was only able to fix it by sending a specific command from the Zigbee console. Both keep the red LED on until the command is sent and it turns off. Otherwise the LED remains on for an indefinite period of time and considerably shortens the useful life of the batteries, since it takes several minutes before turning off. Besides that. While the LED is kept on, there is no sending of temperature and humidity information.

    The same goes for the Zigbee version of TH08 (ZTH08). The icon keeps flashing on the screen and does not update the date and time until I send the command.

    I will try to find the original information on the Zibee2mqtt Forums in case it may be useful so that someone with more knowledge can help you find a viable solution. If I find it, I'll post the link here.

    https://github.com/Koenkk/zigbee2mqtt/issues/19137#issuecomment-1810843051
    https://github.com/Koenkk/zigbee2mqtt/issues/19137#issuecomment-1811762603
ADVERTISEMENT