logo elektroda
logo elektroda
X
logo elektroda

Tuya WiFi Ceiling Lamp KZB2436-36W: Flashing with OpenBeken, Tips, and Troubleshooting

rush56 1866 11
ADVERTISEMENT
  • #1 20345065
    rush56
    Level 4  
    Hi everyone. I'm pretty much a noob about this stuff although I flashed a few devices with Tasmota. However, now I have a ceiling light with a CBU module and it doesn't seem anyone has been flashing it already and would like to make sure it will still work if I go that route with OpenBeken. So I would need some help here. I am really tired of Tuya limitations and troubles with it. Almost every day it changes IP although I have DHCP static IP set in the router (could be a router problem). I use it with LocalTuya. I have to take power off and back on for it to get back set IP.

    CBU module datasheet I found on Tuya:
    https://developer.tuya.com/en/docs/iot/cbu-module-datasheet?id=Ka07pykl5dk4u

    It is supposed to have a BK7231N chip.

    I ordered the lamp from AliExpress:
    https://a.aliexpress.com/_mOnNYEi

    Tuya WiFi Ceiling Lamp KZB2436-36W: Flashing with OpenBeken, Tips, and Troubleshooting
    Tuya WiFi Ceiling Lamp KZB2436-36W: Flashing with OpenBeken, Tips, and Troubleshooting
    Tuya WiFi Ceiling Lamp KZB2436-36W: Flashing with OpenBeken, Tips, and Troubleshooting Tuya WiFi Ceiling Lamp KZB2436-36W: Flashing with OpenBeken, Tips, and Troubleshooting
    Tuya WiFi Ceiling Lamp KZB2436-36W: Flashing with OpenBeken, Tips, and Troubleshooting
    Tuya WiFi Ceiling Lamp KZB2436-36W: Flashing with OpenBeken, Tips, and Troubleshooting

    If there is any additional info I can provide, let me know.

    After all, I really like the design and performance of the light when there are no problems and would be really happy if I can flash it.
  • ADVERTISEMENT
  • #2 20345127
    p.kaczmarek2
    Moderator Smart Home
    I think that CBU should be very easily flashable with hid_download_py:
    https://github.com/OpenBekenIOT/hid_download_py
    First do firmware read (full 2MB), and then flash Obk:
    
    python uartprogram myfirmwarebackup.bin -d com10 -r -s 0x0 -l 0x200000
    

    
    python uartprogram W:/GIT/OpenBK7231N/apps/OpenBK7231N_App/output/1.0.0/OpenBK7231N_QIO_1.15.206.bin --unprotect -d com15 -w --startaddr 0x0
    

    NOTE: replace OpenBK7231N_QIO_1.15.206.bin with latest one...
    ALSO don't compile yourself, releases are here: https://github.com/openshwprojects/OpenBK7231T_App/releases
    For flashing, you need to connect 3.3V, GND, TX, RX and maybe CEN.
    Pin numberSymbolI/O typeFunction
    1P14I/OCommon GPIO, which can be reused as SPI_SCK (Correspond to Pin 11 of the IC)
    2P16I/OCommon GPIO, which can be reused as SPI_MOSI (Correspond to Pin 12 of the IC)
    3P20I/OCommon GPIO (Correspond to Pin 20 of the IC)
    4P22I/OCommon GPIO (Correspond to Pin 18 of the IC)
    5ADCI/OADC, which corresponds to P23 on the internal IC (Correspond to Pin 17 of the IC)
    6RX2I/OUART_RX2, which corresponds to P1 on the internal IC. (Correspond to Pin 28 of the IC)
    7TX2I/OUART_TX2, which is used for outputting logs and corresponds to P0 of the internal IC (Correspond to Pin 29 of the IC)
    8P8I/OSupport hardware PWM (Correspond to Pin 24 of the IC)
    9P7I/OSupport hardware PWM (Correspond to Pin 23 of the IC)
    10P6I/OSupport hardware PWM (Correspond to Pin 22 of the IC)
    11P26I/OSupport hardware PWM (Correspond to Pin 15 of the IC)
    12P24I/OSupport hardware PWM (Correspond to Pin 16 of the IC)
    13GNDPPower supply reference ground
    143V3PPower supply 3V3
    15TX1I/OUART_TX1, which is used for transmitting user data and corresponds to Pin 27 of the IC. For the MCU solution, please refer to CBx Module.
    16RX1I/OUART_RX1, which is used for receiving user data and corresponds to Pin 26 of the IC. For the MCU solution, please refer to CBx Module.
    17P28I/OCommon GPIO (Correspond to Pin 10 of the IC)
    18CENI/OReset pin, low active (internally pulled high), compatible with other modules (Correspond to Pin 21 of the IC)
    19P9I/OCommon GPIO (Correspond to Pin 25 of the IC)
    20P17I/OCommon GPIO, which can be reused as SPI_MISO (Correspond to Pin 14 of the IC)
    21P15I/OCommon GPIO, which can be reused as SPI_CS (Correspond to Pin 13 of the IC)
    Test pointCSNI/OMode selection pin. If it is connected to the ground before being powered on, enter the firmware test mode. If it is not connected or connected to VCC before being powered on, enter the firmware application mode. Correspond to Pin 19 on the internal IC.

    Tuya WiFi Ceiling Lamp KZB2436-36W: Flashing with OpenBeken, Tips, and Troubleshooting
    You can find more details about BK7231N flashing on our video:



    NOTE: I hope you are aware about basics, like, you should never operate on device connected to mains, etc? Disconnect everything from mains first. Power device from your own reliable 3.3V source (it should be able to supply enough current), etc.
    Helpful post? Buy me a coffee.
  • #3 20346347
    rush56
    Level 4  
    How do I set up python virtual environment if I have to? What do I have to do, I have never used this.. I downloaded the https://github.com/OpenBekenIOT/hid_download_py and run install.bat

    First I got this in cmd:
    C:UsersRushDesktophid_download_py-master>python uartprogram myfirmwarebackup.bin -d com8 -r -s 0x0 -l 0x200000
    UartDownloader....
    Read Getting Bus...
    Cannot get bus.
    Traceback (most recent call last):
    File "C:UsersRushDesktophid_download_py-masteruartprogram", line 56, in
    downloader.read(args.filename, args.startaddr, args.length)
    File "C:UsersRushDesktophid_download_py-masterbkutilsuart_downloader.py", line 83, in read
    self.pbar.close()
    AttributeError: 'NoneType' object has no attribute 'close'

    now in cmd with the first command I get:
    Traceback (most recent call last):
    File "C:UsersRushDesktophid_download_py-masteruartprogram", line 14, in
    from bkutils import UartDownloader
    File "C:UsersRushDesktophid_download_py-masterbkutils__init__.py", line 3, in
    from .uart_downloader import *
    File "C:UsersRushDesktophid_download_py-masterbkutilsuart_downloader.py", line 16, in
    from tqdm import tqdm
    ModuleNotFoundError: No module named 'tqdm'

    I have no programming skills really..

    Added after 3 [minutes]:

    https://medium.com/analytics-vidhya/virtual-environment-6ad5d9b6af59

    Should I follow this steps or something?
  • ADVERTISEMENT
  • #4 20346432
    p.kaczmarek2
    Moderator Smart Home
    Hello, it looks like you don't have tqdm.

    Have you tried to install tqdm?
    
    pip install tqdm
    

    https://stackoverflow.com/questions/47529792/no-module-named-tqdm
    or pip3

    but this:
    
    C:\Users\Rush\Desktop\hid_download_py-master>python uartprogram myfirmwarebackup.bin -d com8 -r -s 0x0 -l 0x200000
    UartDownloader....
    Read Getting Bus...
    Cannot get bus.
    

    means that you got it working before, but now tqdm is missing?
    Helpful post? Buy me a coffee.
  • #5 20346462
    rush56
    Level 4  
    Ok now I only get this error.. I had to set path, hope i made it right by some googling.. as there was warning i don't have PATH. Then it said tqdm is installed.

    Read Getting Bus...
    Cannot get bus.
    Traceback (most recent call last):
    File "C:\Users\Rush\Desktop\hid_download_py-master\uartprogram", line 56, in <module>
    downloader.read(args.filename, args.startaddr, args.length)
    File "C:\Users\Rush\Desktop\hid_download_py-master\bkutils\uart_downloader.py", line 83, in read
    self.pbar.close()
    AttributeError: 'NoneType' object has no attribute 'close'

    Well its the same error, i opened CMD as administrator now.. How to solve this now?

    Added after 4 [minutes]:

    I tryed shorting GND and CEN when reading bus, but same.

    I use CH340G USB to TTL, i used its 3.3v and ground, like for all Esp's i flashed. is that alright?

    Added after 38 [minutes]:

    Hmm gotten some progress when shorting CEN and GND at right time. But then some errors. Should it be kept shorted all the time?

    Added after 3 [minutes]:

    Read Getting Bus...
    Gotten Bus...
    Set baudrate successful
    len: 200000
    startAddr: 0
    Reading 0
    ReadSector Success 0 len 1000
    4096
    Reading 1000
    ReadSector Success 1000 len 1000
    8192
    Reading 2000
    ReadSector Success 2000 len 1000
    12288
    Reading 3000
    ReadSector Success 3000 len 620
    ReadSector Failed, len not 0x1000 620

    Read Getting Bus...
    Gotten Bus...
    Set baudrate failed

    Added after 3 [minutes]:

    Thats tricky, now it almost went through? at the end:
    CRC should be 49976dc5
    CRC is fe2a888f
    CRC check failed
    Wrote 200000 bytes to myfirmwarebackup.bin
  • ADVERTISEMENT
  • #6 20346584
    p.kaczmarek2
    Moderator Smart Home
    CEN should be shorted to GND for 0.2 seconds (originally, it was done automatically by the Beken flashing tool). Then the "Getting bus" will "get bus" and start flashing.

    It is tricky to short CEN to GND for a correct amount of time - takes several tries to do that.
    Helpful post? Buy me a coffee.
  • #7 20346592
    rush56
    Level 4  
    Ok I managed to write it. Now let me try accessing it and all that :)

    Added after 56 [minutes]:

    Well it's working, managed to set it up.

    Before I did set it up the right way, I checked this:
    Flag 8 - [LED] Alternate CW light mode (first PWM for warm/cold slider, second for brightness)
    And it seemed that it was much brighter on warm-slider side = both channels had 100%. Is that safe for the lamp or will I burn something if I wanted to use that option sometimes to get the most brightness out of it?

    Oh and one more thing. How could I set static IP on device itself?

    After all, thank you so much for your time and your investment into developing such a nice tasmota alternative firmware. Very nice work :)
  • ADVERTISEMENT
  • #8 20347180
    p.kaczmarek2
    Moderator Smart Home
    Currently we just assumed that users set static IP by doing a MAC reservation on the router DHCP client. Do you need to be able to set a static IP on the device itself?

    rush56 wrote:

    Before i did set it up the right way, i checked this:
    Flag 8 - [LED] Alternate CW light mode (first PWM for warm/cold slider, second for brightness)
    And it seemed that it was much brighter on warm-slider side = both channels had 100%. Is that safe for the lamp or will i burn something if i wanted to use that option sometimes to get the most brightness out of it?

    That option is for a special case where the driver expects not direct drive of PWM LED, but uses one LED for brightness and second for cool/warm choice (0% duty = cool, 100% duty = warm). If you have a normal LED drivers, and connect them in that way that both cool and warm channels are 100% bright, then you are using the device outside the expected range and it may overheat faster.

    I also remember that in the past I was playing with RGBCW LED bulbs (E27, big ones) and when I forced all channels to 100%, the bulb simply turned off - the LED current driver just detected that too much current were taken and safety shut down the LEDs until next device reboot.
    Helpful post? Buy me a coffee.
  • #9 20347188
    rush56
    Level 4  
    Thanks for details.

    I probably don't need static ip now, as it's through mqtt, but with localtuya I needed it. And although I had it set on router, as I already wrote, it lost set ip after lease time. After power off and on it got it back. That was daily. When I set lease time to 0, we had a lot of trouble with our wifi at home. Could be faulty routers dhcp, as this happened with other devices too. I did use wireshark to check for any other dhcp server and there was none. I also disabled dhcp and my laptop kept connecting, not getting any ip. So I assume it's routers fault.
  • #10 20347190
    p.kaczmarek2
    Moderator Smart Home
    I am using MAC reservation on about 25 devices and it works reliably.

    Futhermore, I have "startDriver SSDP" in startup commands so devices can be seen by Windows:
    Tuya WiFi Ceiling Lamp KZB2436-36W: Flashing with OpenBeken, Tips, and Troubleshooting
    Helpful post? Buy me a coffee.
  • #11 20347222
    rush56
    Level 4  
    Yeah I guess it's something with ISP's router.

    I will look into this. Is that an option on OpenBeken? Currently at work, can't check it, will look into later :)
  • #12 20347230
    p.kaczmarek2
    Moderator Smart Home
    It's a SSDP driver. You can start it from autoexec.bat or a short startup command.
    Helpful post? Buy me a coffee.

Topic summary

The discussion revolves around flashing the Tuya WiFi Ceiling Lamp KZB2436-36W, which utilizes a CBU module with a BK7231N chip, using OpenBeken firmware. Users share their experiences and troubleshooting tips for flashing the device, including the use of the hid_download_py tool and the importance of correctly connecting the CEN pin during the flashing process. Issues with DHCP and static IP settings are also addressed, with suggestions for using MAC reservation on the router to maintain a stable connection. The conversation highlights the potential risks of operating the lamp at maximum brightness and the need for careful configuration to avoid overheating.
Summary generated by the language model.
ADVERTISEMENT