logo elektroda
logo elektroda
X

Tasmota replacement for BL602, programming, pairing with Home Assistant, now with OTA working!

p.kaczmarek2 127188 501
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • #481 21347399
    p.kaczmarek2
    Moderator Smart Home
    Well, in worst case, you can just send me this module (instead of throwing it to e-waste) and I can make some kind of tutorial guide showing how to fix that kind of issue, but it's up to you.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #482 21347415
    wojtekrz
    Level 11  
    >>21347399 I'll send it to you. Could you please give me your address in private msg?
  • #483 21484351
    divadiow
    Level 36  
    BL602 Tuya SDKs

    Code: Text
    Log in, to see the code
  • #484 21546638
    alex113
    Level 3  
    Hi.
    I know my question probably has been answered, but I can't search here in 17 pages.
    Does the integration to HA needs to be via MQTT ? I don't use it neither I want to use. Is it possible to control directly ?
    My HA setup uses adaptative light integration for these leds.
    Thanks
  • #485 21565249
    spleefer90
    Level 7  
    So it looks like I have the same bulb as https://www.elektroda.com/rtvforum/topic3889041-120.html#20151469, and the same issues as https://www.elektroda.com/rtvforum/topic3889041-450.html#21286241 with WPA2+WPA3 not working, only pure WPA2 on the CozyLife FW.

    Is this still going to be broken on OpenBeken FW even if I manage to flash this, which the previous person did not seemingly manage, or has this been fixed in OBK since?

    EDIT: Yes, it is the same, I have broken off an entire row of pads and one pad on the side.

    I should have desoldered the large capacitors first and hot air'd it properly - I already had components fly off so I didn't care much - new to using a hot air station. Oh well.
  • ADVERTISEMENT
  • #486 21565261
    divadiow
    Level 36  
    WPA3 is supported in the SDK update from v1.18.95
  • ADVERTISEMENT
  • #487 21617182
    p.kaczmarek2
    Moderator Smart Home
    For clarity, I split the posts, and discussion about testing bl602tool from renzenicolai for BL602 flash read and write is now in that topic: https://www.elektroda.com/rtvforum/topic4131690.html
    Helpful post? Buy me a coffee.
  • #488 21634875
    Cutin
    Level 12  
    After the flashing (successful), I do not see the device on the WIFI network and I do not see the blue led flashing.

    I often see screenshots of KR2302 flashing with BL602 using Bouffalo Lab Dev Cube 1.4.8 and I wonder if this is the main problem with me because I did it with version 1.8.0.

    By default I didn't have "blsp_boot2.bin" in the Boot2 directory but some other files so I used a file from someone's repository on github.

    Bouffalo Lab Dev Cube interface with firmware loaded for BL602 .

    Screenshot of a folder showing three directories: two boot2 and one mfg version
  • #490 21635718
    Cutin
    Level 12  
    divadiow wrote:
    set up the bl_factory_params_IoTKitA_40M.dts dts file and use this file:

    https://www.elektroda.com/rtvforum/topic4126885.html#21583616
    .

    Bouffalo Lab Dev Cube interface with loaded .toml, .bin, and .dts files .

    I tried with DTS and your .TOML and looks similar (no detection on WIFI, no blue LED flash). Tested connected to UART and 230V with the same result.

    I am wondering is the boot file is correct.
    I downloaded it from this source: https://github.com/renzenicolai/bl602tool/blob/main/blsp_boot2.bin
  • #491 21641391
    Cutin
    Level 12  
    Hej,

    Spróbowałe to samo zrobić przy pomocy Lab Dev Cube 1.4.8 z tym ,że plik boot jaki i plik .toml już pochodzi w pochodzi z katologu z całym programem (traktuje to jako wiarygodne źródło) Post: >>20117857

    Cały proces wgrania OpenBeken przeprowadzony sukcesem lecz wynik jest nadal ten sam. Po podłączeniu Mini switch to 230V nadal nie widzę go na sieci WiFi ani dioda led nie świeci.

    Czy zatem plik firmware sam w sobie jest problemem ?

    Bouffalo Lab Dev Cube 1.4.8 interface with firmware flashing settings
  • #492 21641547
    divadiow
    Level 36  
    The latest BLDevCube should be fine.

    What device do you have?

    What is the log output if you open terminal on TX com port at 2mb baud and power from 3.3v (not mains)?
  • #493 21641608
    Cutin
    Level 12  
    >>21641547 >>21641547 .

    My devices are Mini WiFi Switch KR2302 with BL602 processor (Ewelink firmware preloaded)

    I am not sure if I understood correctly.
    Simple Flasher interface with “Success” status shown and error logs below .

    After performing the flashing,unplugging the BOOT cable, rebooting and clicking "Log" I get this:

    [16:08:05.410] - Flash load shake hand
    [16:08:05.410] - clean buffer
    [16:08:05.473] - send sync
    [16:08:05.473] - ack is b'2d2d2d2d2d2d2d2d2d3e3e3e3e'
    [16:08:05.473] - reshake
    [16:08:05.473] - sleep
    [16:08:08.498] - clean buffer
    [16:08:08.498] - send sync
    [16:08:08.498] - ack is b'310d0a327468206368616e6e656c2c76'
    [16:08:08.498] - reshake
    [16:08:08.513] - sleep
    [16:08:11.528] - {"ErrorCode": "0001", "ErrorMsg": "BFLB EFLASH LOADER SHAKEHAND FAIL"}
    [16:08:11.528] - Shake hand redo
    [16:08:11.528] - FL695f unknown
    [16:08:11.528] - Not ack OK
    [16:08:11.528] - FL695f unknown
    [16:08:11.528] - Read log
    [16:08:11.528] - Read Fail
  • #494 21641683
    divadiow
    Level 36  
    Sorry, I mean "open UART". Is it BL602C20 or BL602L10?
  • #495 21641905
    Cutin
    Level 12  
    BL602L20

    KR2302 20220515 WiFi Smart Switch

    Close-up of BL602L20 chip on a blue PCB with visible wire connections .

    Disconnected BOOT cable, connected 3.3V, GND, RX and TX and pressed Open UART (Reading works as if in closed loop)

    Log file attached
  • #496 21642141
    divadiow
    Level 36  
    OK.

    and if you open uart then power device?

    it should print boot logs in bottom window

    Added after 2 [hours] 9 [minutes]:

    eg. here's my boot log

    animated

    Animated Bouffalo Lab Dev Cube interface showing UART boot logs
  • ADVERTISEMENT
  • #497 21642219
    p.kaczmarek2
    Moderator Smart Home
    For me, it seems like it may be a classic issue on BL602. Bootloop on start caused by not enough power supplied to the module. BL602 will NOT work if it's powered from low quality 3.3V power source, especially if done via long wire, with no decoupling capacitors. We saw similar issues few times on forum already.

    Are you sure you're testing it powered via 230V? Does it work if you restore eWeLink firmware? Maybe something wrong is on the board itself, faulty capacitor?

    The solution often is simple- either power it as you are supposed to power it (but disconnect PC first), from smart device directly, or use a good LDO like AMS1117-3.3V, feed 5V to input and get good 3.3V from output.

    It may also help if @Cutin shows photos of his full setup.
    Helpful post? Buy me a coffee.
  • #498 21642220
    divadiow
    Level 36  
    divadiow wrote:
    and if you open uart then power device?

    apols, I see you added log file.
  • #499 21695058
    solevi
    Level 2  
    Hi,
    Just wanted to share my case.
    My device is the "Magic Home LED CCT Strip" one.
    First, I tried to change the firmware with the MHFlasher Android app, but no success.
    Here is what was in the logs:
    
    [19:37:44] OTA server is running on port 1111
    [19:37:46] clicked scan
    [19:37:46] Permission granted - skanujemy
    [19:37:46] Starting scan
    [19:37:47] Success scan
    ...
    [19:37:47] AP found: LEDnet0041DBCDEB
    ...
    [19:37:55] Connected to LEDnet0041DBCDEB
    [19:37:55] got dhcp IPv4: 10.10.123.7
    [19:37:55] First DNS Server: 10.10.123.3
    [19:37:55] Received: 10.10.123.3,B4C2E0DBCDEB,AK001-ZJ21412
    [19:37:55]  mac:B4C2E0DBCDEB
    [19:37:55]  dev id:AK001-ZJ21412
    [19:37:55] ver: +ok=41_224_20231117_ZG-BL 
    [19:37:56] got dhcp IPv4: 10.10.123.7
    [19:37:56] First DNS Server: 10.10.123.3
    [19:37:56] Received: 10.10.123.3,B4C2E0DBCDEB,AK001-ZJ21412
    [19:37:56]  mac:B4C2E0DBCDEB
    [19:37:56]  dev id:AK001-ZJ21412
    [19:37:56] ver: +ok=41_224_20231117_ZG-BL
    

    Also tried the netcat method, again no dice:
    Server:
    Code: Bash
    Log in, to see the code

    Client:
    Code: Bash
    Log in, to see the code


    Then I tried to flash with UART through BLDevCube.
    Tried to back up the existing firmware, got an error:
    Read data error,maybe not get excepted length
    
    [20:24:59.884] - Burn return with retry fail
    [20:25:09.822] - Save as flash.bin
    [20:25:09.822] - Version: eflash_loader_v2.5.1
    [20:25:09.822] - Program Start
    [20:25:09.822] - ========= eflash loader cmd arguments =========
    [20:25:09.822] - Config file: C:\Beken\BouffaloLabDevCube-v1.9.0\chips\bl602\eflash_loader\eflash_loader_cfg.ini
    [20:25:09.837] - serial port is COM5
    [20:25:09.837] - cpu_reset=False
    [20:25:09.837] - chiptype: bl602
    [20:25:09.837] - ========= Interface is uart =========
    [20:25:09.837] - com speed: 2000000
    [20:25:09.837] - Eflash load helper file: C:\Beken\BouffaloLabDevCube-v1.9.0\chips\bl602\eflash_loader/eflash_loader_40m.bin
    [20:25:09.837] - ========= load eflash_loader.bin =========
    [20:25:09.837] - Load eflash_loader.bin via uart
    [20:25:09.837] - ========= image load =========
    [20:25:10.123] - Not ack OK
    [20:25:10.123] - FL
    [20:25:10.123] - result: FL
    [20:25:10.409] - tx rx and power off, press the machine!
    [20:25:10.409] - cutoff time is 0.1
    [20:25:10.518] - power on tx and rx
    [20:25:11.333] - reset cnt: 0, reset hold: 0.005, shake hand delay: 0.1
    [20:25:11.333] - clean buf
    [20:25:11.333] - send sync
    [20:25:11.556] - ack is 4f4b
    [20:25:11.603] - shake hand success
    [20:25:11.618] - get_boot_info
    [20:25:11.618] - data read is b'010000000000000003000400ebcddbe0c2b41500'
    [20:25:11.618] - ========= chipid: b4c2e0dbcdeb =========
    [20:25:11.618] - last boot info: None
    [20:25:11.618] - sign is 0 encrypt is 0
    [20:25:11.618] - segcnt is 1
    [20:25:11.618] - segdata_len is 38592
    [20:25:11.712] - 4080/38592
    [20:25:11.806] - 8160/38592
    [20:25:11.902] - 12240/38592
    [20:25:11.996] - 16320/38592
    [20:25:12.090] - 20400/38592
    [20:25:12.171] - 24480/38592
    [20:25:12.265] - 28560/38592
    [20:25:12.358] - 32640/38592
    [20:25:12.452] - 36720/38592
    [20:25:12.499] - 38592/38592
    [20:25:12.499] - Run img
    [20:25:12.624] - Load helper bin time cost(ms): 2786.919189453125
    [20:25:12.733] - Flash load shake hand
    [20:25:12.733] - default set DTR high
    [20:25:12.858] - clean buf
    [20:25:12.858] - send sync
    [20:25:13.077] - ack is 4f4b
    [20:25:13.124] - Read mac addr
    [20:25:13.124] - macaddr: ebcddbe0c2b4
    [20:25:13.124] - flash set para
    [20:25:13.124] - ========= flash read jedec ID =========
    [20:25:13.124] - Read flash jedec ID
    [20:25:13.124] - flash jedec id: 5e401580
    [20:25:13.124] - Finished
    [20:25:13.124] - get flash size: 0x00200000
    [20:25:13.124] - Read operation
    [20:25:13.124] - ========= flash read =========
    [20:25:17.158] - Read data error,maybe not get excepted length
    [20:25:17.158] - Retry
    [20:25:21.175] - Read data error,maybe not get excepted length
    [20:25:21.175] - Retry
    [20:25:25.199] - Read data error,maybe not get excepted length
    [20:25:25.199] - Retry
    [20:25:29.204] - Read data error,maybe not get excepted length
    [20:25:29.204] - ErrorCode: 0035, ErrorMsg: BFLB FLASH READ FAIL
    [20:25:29.204] - Burn Retry
    [20:25:29.204] - 0
    


    Then I decided to flash without a backup, and finally succeeded.

    After connecting to my wifi, I launched the Web Application to back up the RF data from there. The config was all FFs (attached rfdata.bin), not sure why.
    Since it was empty anyway, I tried to recreate one - again, no success, got stuck on Restoring RF config....

    The device is working OK so far, but there are some concerns.
    First, the PWM frequency is 2KHz. Shouldn't it be 1KHz?
    Second, at 100% brightness, the duty cycle is ~86%. Is this expected?
    Square waveform on oscilloscope with detailed signal parameters

    P.S:
    I noticed that the BLDevCube app is toggling the DTR pin of the UART converter when accessing the chip. So I discovered that connecting the BOOT pin to DTR is a much more convenient way to flash the chip; no need to use the pull-up resistor.
  • #500 21695456
    divadiow
    Level 36  
    solevi wrote:
    After connecting to my wifi, I launched the Web Application to back up the RF data from there. The config was all FFs (attached rfdata.bin), not sure why.

    This function in web app is for BK7231N/T only I think

    solevi wrote:
    First, the PWM frequency is 2KHz. Shouldn't it be 1KHz?

    this seems to have come up recently here too https://www.elektroda.com/rtvforum/topic4144560.html

    solevi wrote:
    I noticed that the BLDevCube app is toggling the DTR pin of the UART converter when accessing the chip. So I discovered that connecting the BOOT pin to DTR is a much more convenient way to flash the chip; no need to use the pull-up resistor.

    this is handy to know

    solevi wrote:
    Tried to back up the existing firmware, got an error:
    Read data error,maybe not get excepted length

    maybe your cables were too long? did you try lower baud rates?
  • #501 21699110
    solevi
    Level 2  
    Sorry for the late reply, I have been busy lately.
    divadiow wrote:
    This function in web app is for BK7231N/T only I think

    Oh, I didn't realize that. I thought that the items shown were device-specific. Good to know.
    divadiow wrote:
    this seems to have come up recently here too

    Thanks for the info, will be following the progress there.
    divadiow wrote:
    maybe your cables were too long? did you try lower baud rates?

    The cables were 6-7cm long, and I don't think that they're too long. Sorry, it's too late to check the baud rate ATM.

    And do you have any idea regarding the duty cycle?
  • #502 21699637
    divadiow
    Level 36  
    solevi wrote:
    And do you have any idea regarding the duty cycle?


    I'm afraid I don't know how to help with that
📢 Listen (AI):

Topic summary

The discussion centers on a custom Tasmota-like firmware replacement for the BL602 platform by Bouffalo Lab, enabling integration with Home Assistant via MQTT. Key topics include flashing the firmware using USB to UART converters, SDK compilation, and device pairing. Users report successful flashing on MagicHome LED controllers (RGB, RGBW, single color) and Sonoff devices, with detailed guidance on GPIO pin identification and configuration for PWM and relay functions. MQTT integration supports commands for color, dimmer, hue, saturation, and device control, with ongoing improvements to MQTT topic naming, discovery, and feedback reporting. Challenges addressed include MQTT buffer limitations causing device instability, startup behavior with LED blinking, and the absence of OTA updates for BL602 (unlike Beken platforms). The firmware supports saving and restoring channel states, configurable MQTT reporting flags, and plans for Alexa Hue emulation. Users share troubleshooting steps for flashing errors, network connectivity, and device crashes, with developer responses including bug fixes, feature additions, and testing requests. The project emphasizes open-source collaboration, aiming to free IoT devices from manufacturer servers, enhance privacy, and unify multi-vendor ecosystems under a single firmware solution.
Summary generated by the language model.
ADVERTISEMENT