logo elektroda
logo elektroda
X
logo elektroda

[BK7321N] Generic USB powered thermostat and humidity sensor with LED display - CBU module

DeDaMrAz 4986 57
ADVERTISEMENT
  • #31 20553549
    p.kaczmarek2
    Moderator Smart Home
    We've been looking into TM1638 recently and it seems very, very similar to GN6932.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #32 20629042
    hakimmuhiddin
    Level 4  

    I wanted to ask.. I am having trouble getting the IP address of the device.. Each time I connect to an access point, I don't have the privilege to access the router webpage.. I am planning to set a static IP address on the device during OpenAP mode.. And then set the main WiFi SSID and password by using the previously set IP address..

    Is that possible?
  • ADVERTISEMENT
  • #33 20629101
    p.kaczmarek2
    Moderator Smart Home
    Hello, you can easily set the static address for OpenBeken device. You can do this in AP mode. Make sure the IP address you are using is unique. I am attaching a config page screenshot below:
    [BK7321N] Generic USB powered thermostat and humidity sensor with LED display - CBU module [BK7321N] Generic USB powered thermostat and humidity sensor with LED display - CBU module
    Helpful post? Buy me a coffee.
  • #34 20979685
    divadiow
    Level 35  
    I assume everyone else's config is still working?

    Mine doesn't seem to like starting the GN6932 driver. I've tried CLK/DAT/STB on different channels and the same.

    Screenshot of pin configuration settings for driver GN6932.
    Info:MAIN:Driver GN6932 is not known in this build.
    Info:MAIN:Available drivers: 


    my autoexec
    backlog startDriver GN6932; startDriver NTP
    ntp_timeZoneOfs  +00:00
    TMGN_Clear
    //check the reading of you sensor against a good known and calibrate in this case -2
    CHT_Calibrate -2 10 
    TMGN_Clear
    //adjust brightness if needed (0-7) - default is 7 max
    TMGN_Brightness 7
    TMGN_SetBit 9 1 1
    TMGN_SetBit 9 2 1
    TMGN_SetBit 9 3 1
    TMGN_SetBit 9 7 1
    TMGN_SetBit 9 0 1
    TMGN_SetBit 10 2 1
    TMGN_SetBit 10 3 1
    
    again:
    // TMGN_Print  offset len value bPadToLenWithZeros
    //TMGN_Print 0 2 $second 1
    TMGN_Print 7 2 $minute 1
    TMGN_Print 5 2 $hour 1
    TMGN_Print 2 3 $CH1 1
    TMGN_Print 0 2 $CH0 1
    delay_s 0.1
    //blinking : on the clock
    TMGN_SetBit 10 0 0
    TMGN_SetBit 10 1 0
    delay_s 1
    TMGN_SetBit 10 0 1
    TMGN_SetBit 10 1 1
    delay_s 1
    goto again
    
    
  • #35 20979746
    p.kaczmarek2
    Moderator Smart Home
    The answer is here OpenBeken online building system - compiling firmware for all platforms (BK7231, BL602, W800, etc)
    The GN6932 is so rarely used that's disabled in latest builds. You need to enable it. Alternatively, I can make a build for you in Pull Requests.
    See:
    Code snippet showing driver configuration for TM1637, GN6932, TM1638 with a highlighted line for activation

    You need to add
    
    #define ENABLE_DRIVER_TMGN 1
    

    in obk_config.h
    Helpful post? Buy me a coffee.
  • #36 20979755
    divadiow
    Level 35  
    Ah. That explains it! Maybe it's time I had a go at my own fork and building. I'll try your guide, thanks

    Added after 1 [minutes]:

    Unless you think it should go back into live...
  • Helpful post
    #37 20980349
    divadiow
    Level 35  
    Just for testing I went back to 1.17.295 and the driver of course works now. Because the newer units have a CHT8310 temp/hum sensor (mine does anyway), as opposed to the CHT8305, the driver for the CHT is the old version before CHT8310 support was added. As such, the readings are incorrect. No matter. Just testing.

    I also had to set the CHT_SDA channels as 1:0 way round or the display would show the temp in the humidity line and humidity in the temp line. The temp though is showing the div10 figure in LED and -265 in GUI.

    Screenshot showing temperature readings from the CHT8305 sensor with a value of -26.585489 and three active drivers: NTP, CHT8305, GN6932. Digital display showing time, temperature, and humidity.

    Some random pics for the library

    Close-up of an electronic component on a blue printed circuit board with the markings B8310 CBET2H. GN6932 integrated circuit on a circuit board.
    Electronic circuit board with a series of LEDs marked with a QC label
    A blue circuit board with various electronic components.
    Message indicating no updates available for the device.
    Image of an LED WIFI T&H Sensor display showing temperature and humidity.
    Advertisement for a digital WiFi temperature and humidity sensor.
    Label with barcode and product information for the WiFi Smart Thermostat LED Display Electri Temperature and Humidity Sensor model TH03.
    Packaging of a smart Wi-Fi temperature and humidity sensor with Tuya logo.

    1.0.6 is not in the known patched firmware list, so could be cloudcutter compatible, if not already in there.

    Also, I've updated the OBK template a little. Still not 100% sure on the GN6932 channels
    https://github.com/OpenBekenIOT/webapp/pull/80
  • #38 20980392
    p.kaczmarek2
    Moderator Smart Home
    divadiow wrote:

    Unless you think it should go back into live...

    Growing flash size usage causes the "LittleFS is being removed by OTA" issue which pops up periodically on Github. That's why rarely used drivers are disabled.

    divadiow wrote:
    As such, the readings are incorrect.

    That's the old version without temperature/humidity probe driver. Can you check if it's working with new build with LED display driver enabled?

    divadiow wrote:

    Also, I've updated the OBK template a little. Still not 100% sure on the GN6932 channels
    https://github.com/OpenBekenIOT/webapp/pull/80

    Thank you. The channel indices of GN6932 pins are not used.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #39 20980403
    divadiow
    Level 35  
    p.kaczmarek2 wrote:
    That's the old version without temperature/humidity probe driver. Can you check if it's working with new build with LED display driver enabled?


    that's my next step when I have setup github build to bin
  • ADVERTISEMENT
  • #40 20980421
    p.kaczmarek2
    Moderator Smart Home
    I saw you've got already a bin in the PR.
    Helpful post? Buy me a coffee.
  • #41 20981282
    divadiow
    Level 35  
    oh. I see I see. and yay

    User interface screen of the OpenBK application showing temperature and humidity data along with other technical details.

    Digital thermometer with a display showing the current time, temperature, and humidity.

    so cool
  • #42 20981879
    p.kaczmarek2
    Moderator Smart Home
    I am glad to see it's working, good job.

    So, to sum up, the newer models come with CHT8310 instead of CHT8305? I wonder what are the differences between those two CHT sensors.
    Helpful post? Buy me a coffee.
  • #43 20981912
    divadiow
    Level 35  
    p.kaczmarek2 wrote:
    So, to sum up, the newer models come with CHT8310 instead of CHT8305? I wonder what are the differences between those two CHT sensors.


    yes. otherwise they seem identical.

    who knows what the deciding factors were in changing to CHT8310 though. chip shortage? discontinuation? :shrug:

    differences in Sensylink summary:

    Product list with technical specifications of sensors.

    about which chatgpt says

    Quote:
    Interface: Both the CHT8305 and CHT8310 use I2C and SMBus interfaces.

    Temperature Accuracy: Both have the same typical temperature accuracy of ±0.2°C.

    Humidity Accuracy:

    The CHT8305 has a humidity accuracy of ±2.0%RH at 50%RH.
    The CHT8310 has a wider humidity accuracy range of ±2.0%RH at 20%RH to 80%RH.
    Current Consumption at 1Hz (I_AOC/1Hz):

    The CHT8305 consumes 1.5µA.
    The CHT8310 consumes 2.0µA.
    Shutdown Current (I_SD):

    The CHT8305 has a shutdown current of 0.05µA.
    The CHT8310 has a slightly higher shutdown current of 0.055µA.
    Analog-Digital Converter Resolution (ADD): Both have an ADC resolution of 4.

    Package: Both use the same package type, DFN-3x3-6.
  • #44 20981971
    p.kaczmarek2
    Moderator Smart Home
    Take care, LLMs like ChatGPT may be unreliable in many cases. It's always better to check the datasheets and/or manufacturer's page.
    Helpful post? Buy me a coffee.
  • #45 20982322
    divadiow
    Level 35  
    I know, I know! I only fed it the Sensylink image to interpret and summarise 👍🏼
  • #46 21205039
    yuretskor
    Level 6  
    Hi. Can you explain how the command works TMGN_SetBit? I'm trying to display the time on the display TM1637 and I can't do anything (I need help. Thank you
  • #47 21205129
    DeDaMrAz
    Level 20  
    @yuretskor

    Here is an autoexec example I am using in my device that is based on a similar device (GN6932) so you can maybe have some idea about it

    startDriver GN6932
    startDriver NTP
    ntp_timeZoneOfs  +2:00
    
    //clear screen on boot
    TMGN_Clear
    
    //adjust brightness if needed (0-7) - default is 7 max
    TMGN_Brightness 7
    
    //static bits for displaying state, connection and various constant characters (like 'C or'F, AM/PM...)
    TMGN_SetBit 9 1 1
    TMGN_SetBit 9 2 1
    TMGN_SetBit 9 3 1
    TMGN_SetBit 9 7 1
    TMGN_SetBit 9 0 1
    TMGN_SetBit 10 2 1
    TMGN_SetBit 10 3 1
    
    //main loop to display clock and values from a CHT sensor
    again:
    TMGN_Print 7 2 $minute 1
    TMGN_Print 5 2 $hour 1
    TMGN_Print 2 3 $CH1 1
    TMGN_Print 0 2 $CH0 1
    delay_s 0.1
    //blinking : on the clock
    TMGN_SetBit 10 0 0
    TMGN_SetBit 10 1 0
    delay_s 1
    TMGN_SetBit 10 0 1
    TMGN_SetBit 10 1 1
    delay_s 1
    goto again


    I would suggest to you to use setbit to figure out which characters are available and can be used, then you can play around with print options form various channels.
  • #48 21205192
    yuretskor
    Level 6  
    @DeDaMrAz thank you. But I would like to clarify what to write in the setbit command.
    Why 9 1 1 what do these numbers mean? Where to look and read?
  • #49 21205196
    DeDaMrAz
    Level 20  
    @yuretskor

    In general those drivers can support multiple 7-segment display (some of them even keyboard matrixes) so it the particular example:

    TMGN_SetBit 9 1 1

    9 is index number for the display. remember multiple displays so 0-15 (I think, check the datasheet about the actual number it supports), next 1 is bit number of that display (all of them have 7 segments + a dot, so you are choosing what to control from 0-7) and last 1 is the actual value of that bit, so is that segment on or off = 1 or 0.

    Here is a picture for visual reference that I took some time ago while TMGN driver was created. Picture may not be 100% accurate but it'll do for reference (order may be reversed or segments starting from 0-7 etc.) It is from a TM1638 LED driver but you should get a good idea overall.

    Four 7-segment LED displays on a blue circuit board, with index and bit number labels.

    Also check the projects GitHub docs section and search for TMGN in there - https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md

    Hope it helps.
  • #50 21205197
    yuretskor
    Level 6  
    And also what does it mean in a team TMGN_Print 7 2 The numbers 7 2 ?
  • #52 21205343
    p.kaczmarek2
    Moderator Smart Home
    @yuretskor I recognize your issue from this topic:
    https://www.elektroda.com/rtvforum/topic3959243-90.html#21204872
    Your bit map is okay. Don't use TMGN_SetBit. I think you need to use TMGN_Map.
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md
    Helpful post? Buy me a coffee.
  • #53 21210107
    yuretskor
    Level 6  
    please explain for the dumb that in the TMGN_Print command 7 2 means 7 and 2 if possible with an example. thanks
  • #54 21210176
    p.kaczmarek2
    Moderator Smart Home
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md
    Fragment of documentation showing the syntax and description of the TMGN_Print function.
    TMGN_Print [StartOffset] [MaxLenOr0] [Text]
    So, if you want to display on the, let's say, position 3, you do: TMGN_Print 3 0 XY
    If you want to display at start position (first digit), you do: TMGN_Print 0 0 XYZW
    Etc etc
    Helpful post? Buy me a coffee.
  • #55 21350125
    darkassassinmax
    Level 3  
    Can someone provide a build with GN6932 driver? Compiling is so hard for me
    or provide esphome configuration
  • #58 21350840
    darkassassinmax
    Level 3  
    >>21350238 thank you!

Topic summary

The discussion focuses on a generic USB-powered thermostat and humidity sensor device based on the Tuya CBU module, featuring a CHT8305 sensor and a GN6932 multi 7-segment LED display driver. Detailed hardware pin mappings were established: CHT8305 SDA to CBU P22, SCL to CBU P20; GN6932 DIN to CBU P15, CLK to P17, and STB to P28. The GN6932 driver was reverse-engineered, revealing it as a serial interface LED driver with 8-level brightness control and SPI-like communication, similar to TM1637 but with an added STB pin and no ACK. A test driver and example scripts were developed and integrated into the OpenBK7231T firmware, enabling display of temperature, humidity, and time with brightness adjustment and segment control via commands like TMGN_Print and TMGN_SetBit. Calibration for the CHT8305 sensor was initially missing but later implemented, allowing temperature offset correction. Newer device models reportedly use the CHT8310 sensor, which is similar but requires updated drivers. Firmware builds sometimes disable the GN6932 driver due to flash size constraints, requiring manual enabling in the configuration. Users shared scripts for clock display and sensor data visualization, including temperature unit conversion between Celsius and Fahrenheit. Additional support and clarifications on command usage (e.g., TMGN_SetBit parameters) were provided, along with links to source code and documentation. The community also addressed static IP configuration during OpenAP mode for device network setup. Overall, the device is now well-supported in OpenBeken firmware with active development on display drivers and sensor calibration.
Summary generated by the language model.
ADVERTISEMENT