logo elektroda
logo elektroda
X
logo elektroda

[BK7238] Farylink wifi-wsd - OpenBeken CHT8310 on Software I2C P24/P9

nugbe 141 6
ADVERTISEMENT
  • OpenBeken software I2C pinout for CHT8310 sensor

    #1 21935113
    nugbe
    Level 3  
    Posts: 5
    Hello everyone!

    I recently bought a generic Tuya Temperature and Humidity sensor (Label: wifi-wsd, Manufacturer: Farylink). I decided to do a teardown and flash it with OpenBeken.

    Inside, I found a BK7238 Wi-Fi module and a CHT83XX (CHT8310) temperature and humidity sensor.

    The Challenge: At first, the I2C pins were completely unknown. Furthermore, it turns out that ESPHome is not a viable option for this specific board design because Tuya wired the sensor to pins P9 and P24. On the BK7231 architecture, these pins do not support Hardware I2C, and ESPHome lacks a native Software I2C implementation.

    The Solution: Thankfully, OpenBeken handles Software I2C flawlessly! Since the pins were undocumented, we ended up programming a new brute-force tool called SuperScanner (which we just submitted as a PR to the official drv_multiPinI2CScanner.c!).

    Using the scanner, we successfully brute-forced the pinout and found the hidden I2C lines:

    SDA: P24
    SCL (SCK): P9
    Power Pin: None required for this specific board.
    Once the pins were mapped, the CHT83XX driver worked instantly.

    Here is the JSON template for the auto-importer bot:

    json


    {
    "vendor": "Tuya",
    "bDetailed": "0",
    "name": "Farylink Tuya WiFi Temperature & Humidity Sensor",
    "model": "wifi-wsd",
    "chip": "BK7238",
    "board": "Generic",
    "flags": "1024",
    "keywords": [
    "Temperature",
    "Humidity",
    "CHT83XX",
    "Farylink"
    ],
    "pins": {
    "9": "CHT83XX_SCK;0;0",
    "24": "CHT83XX_SDA;1;2"
    },
    "command": "backlog PowerSave 1; startDriver CHT83XX; setChannelType 1 Temperature; setChannelType 2 Humidity",
    "image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
    "wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
    }
    I have attached some high-resolution pictures of the casing (including the Farylink sticker) and both sides of the PCB below for reference.

    I hope this helps anyone else trying to liberate this specific Tuya sensor! Let me know if you have any questions.




    Product label for a temperature and humidity sensor with barcode and the text “wifi-wsd-1pack”. Long metal rod with a cable, clip, and sticky note; blue clamp on the left Circuit board with wires and “RX/TX” tape label, plus a USB module and white casing on a desk Close-up of a PCB with a metal-shielded module, FL-S266-V1.0 marking, and SMD components
    White device with a thermometer icon on a green grid cutting mat.
  • ADVERTISEMENT
  • #2 21935209
    divadiow
    Level 38  
    Posts: 5153
    Help: 442
    Rate: 906
    cool, but was the config not extractable from the Tuya config using Easy Flasher and a backup of the original flash?
  • ADVERTISEMENT
  • Brute-force I2C scan found P24/P9 mapping

    #3 21935222
    nugbe
    Level 3  
    Posts: 5
    >>21935209

    Unfortunately not. I flashed the device before making a backup of the original Tuya firmware, so I no longer had access to the Tuya configuration data.

    At the time I wasn't expecting to need the original pin mapping, so I ended up reverse-engineering it instead. Since the I2C pins were unknown, I wrote (AI assisted) a brute-force I2C scanner (now submitted as a PR to OpenBeken) to test every possible pin combination until I found the correct mapping:

    SDA: P24
    SCL: P9

    In the end it worked out well, and the scanner may also help identify undocumented I2C devices on other BK72xx boards.

    I suppose that's the classic rookie mistake: flash first, ask questions later! 😄
  • ADVERTISEMENT
  • #4 21935226
    divadiow
    Level 38  
    Posts: 5153
    Help: 442
    Rate: 906
    ah sure. depending on which tool you used to flash and if you erased first, the Tuya config may still be present and usable. There's also the question of your button and LED on that device. After OBK conversion the Tuya config can be saved to a small file (if it still exists) and fed into the Tuay config extractor in EF.
    Screenshot of an OpenBK web panel with Plug, USB1, and USB2 switches showing OFF.
  • ADVERTISEMENT
  • #5 21935229
    nugbe
    Level 3  
    Posts: 5
    >>21935226
    Thanks a lot, I'll try and post the result.
  • #6 21936228
    nugbe
    Level 3  
    Posts: 5
    >>21935229

    here is it, thanks a lot!
    Attachments:
    • BK7238_TuyaConfig_obk8C428848.bin (72 KB) You must be logged in to download this attachment.
  • #7 21936247
    nugbe
    Level 3  
    Posts: 5
    Other PINs of this chip:

    P6 (PWM0)   WifiLED
    P23  Btn

Topic summary

✨ A generic Tuya temperature and humidity sensor branded as wifi-wsd was torn down and flashed with OpenBeken. The device uses a BK7238 Wi‑Fi module and a CHT83XX/CHT8310 temperature-humidity sensor. The main challenge was identifying the I2C wiring, since the sensor was connected to P9 and P24, which are not suitable for hardware I2C on the BK7231 architecture and are not supported by ESPHome’s native software I2C. OpenBeken’s software I2C support was used instead, along with a newly developed brute-force pin scanner (SuperScanner, submitted as a PR to drv_multiPinI2CScanner.c) to discover the hidden bus lines. The scan identified SDA on P24 and SCL on P9.
Summary generated by AI based on the discussion content.
ADVERTISEMENT