logo elektroda
logo elektroda
X
logo elektroda

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

p.kaczmarek2 118641 485
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • ADVERTISEMENT
  • #302 20460650
    p.kaczmarek2
    Moderator Smart Home
    @vincent3 I don't know how to solve this problem, but if you are willing to take the risk, you can try enabling "Erase all" in the flashing settings, which is False by default. Then tell me if it helped, otherwise we can try to think about something else.

    My BL602 dev board from aliexpress has currently a broken WiFi (even after full erase, probably efuse error, I don't know) and I am waiting for new one to arrive.

    I have did some more progress on BL602 because I also have a bulb and a led strip (but they are not connected by wires to flasher, they use OTA) and recently I enabled SSDP and DDP drivers.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #303 20460669
    vincent3
    Level 4  
    Thanks! I will try this option tonight and report it to you!

    BTW...
    Great job man! Thanks for your effort and passion!
  • #304 20465457
    rojoricardo
    Level 4  
    Hello, I bought a light bulb that came with BL602 managed to flash with latest firmware (.517) however after flashing, disconnecting boot and repowering the chip, there is no access point, so i opened the UART, and it seems to be in a loop of some sort, also reflashed useing the erase flash TRUE option and same thing.
    My chip is the BL-M5 V1.2
    Tasmota replacement for BL602, programming, pairing with Home Assistant, now with OTA working!
  • #305 20465575
    p.kaczmarek2
    Moderator Smart Home
    Please post full log and try the firmware 1.15.511.
    I am currently on 1.15.511 and it seems to work fine:
    Tasmota replacement for BL602, programming, pairing with Home Assistant, now with OTA working!
    Also, if you have a BL602 bulb, please consider posting a teardown in separate topic. Adding BL602 device teardowns is very helpful, we don't have much of them.
    https://openbekeniot.github.io/webapp/devicesList.html

    Added after 5 [minutes]:

    EDIT: I just got a suggestion from @Zain00 , are you powering it from a reliable power supply? maybe it boot loops because you try to power it from USB to ttl adapter that can't provide enough current.
    Helpful post? Buy me a coffee.
  • #306 20466437
    rojoricardo
    Level 4  
    @p.kaczmarek2
    p.kaczmarek2 wrote:
    posting a teardown

    The tear down is already done for this Bulb, its just that i was powering it through the FDI or USB to UART and it doesnt have the juice.
  • #307 20466450
    p.kaczmarek2
    Moderator Smart Home
    So it works now? Great.
    Well, to be honest, I think we've been repeating that on our Youtube channel several times already. Use good power supply, preferably external LDO 3.3V and power it from good 5V, so it gives a stable 3.3V for WiFi module. Something like AMS1117 3.3 will do great, although we are using TC1264-3.3.
    Helpful post? Buy me a coffee.
  • #308 20469312
    Zain00
    Level 10  
    Today I got a switch with DT-BL02, I was not successful at flashing this module.
    With BLDevCube version: 1.4.8, I get {"ErrorCode": "003D","ErrorMsg":"BFLB FLASH MATCH TYPE FAIL"}
    With version: 1.8.3 I can flash the chip but then no AP appears and no RX/TX reading from the BLDevCube.

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

    D8 is Boot pin.
  • ADVERTISEMENT
  • #309 20471056
    vincent3
    Level 4  
    >>20460518

    @p.kaczmarek2

    You are 100% right. It is all about stable 3.3V. My BL602 (socket in my case) doesn't boot on USB2TTL 5Vto3,3V stabilizer (boot loop) but works great powered by an internal 230V AC-DC power supply.

    Thanks for the tip!
  • #310 20489728
    pitas999
    Level 2  
    Just bought 2 RGB controllers hoping for ESP / BL602 but instead got the leapfive LF686. Is there any hope of flashing this device?

    Many thanks for your work making these devices working with tasmota!
  • #311 20489742
    p.kaczmarek2
    Moderator Smart Home
    Hello, can you provide more information, or even more preferably a teardown article (where to buy+packaging photos+internal photos)?

    I've found something interesting in this readme:
    
    BLISP (Bouffalo Labs ISP tool & library)
    This is an open source tool and library for flashing Bouffalo RISC-V MCUs.
    
    NOTE: Library API and blisp tool cli arguments are not stable yet.
    
    Supported MCUs
     bl60x - BL602 / BL604 / TG7100C / LF686 / LF688
     bl70x - BL702 / BL704 / BL706
     bl70xl - BL702L / BL704L
     bl606p - BL606P
     bl61x - BL616 / BL618
     bl808 - BL808
    Supported OS
     Windows
     Linux
     MacOS
     FreeBSD
    How to update Pinecil V2
    Check out the wiki page.
    
    Building from code
    Clone repository
    If you have not cloned this repository locally; clone the git repository locally by running
    
    git clone --recursive https://github.com/pine64/blisp.git
    cd blisp
    git submodule update --init --recursive
    Build the library and command line utility
    For building blisp command line tool, use following commands:
    
    mkdir build && cd build
    cmake -DBLISP_BUILD_CLI=ON ..
    cmake --build .
    Need more build details? See here.
    Usage
    For BL70X, BL61X, BL808 and BL606P, connected via USB, you can use following command, which will auto-detect serial port:
    
    .\blisp.exe write --chip=bl70x --reset .\name_of_firmware.bin
    or
    .\blisp.exe write -c bl70x --reset .\name_of_firmware.bin
    For BL60X, you need to specify also the serial port path:
    
    blisp write --chip bl60x --reset -p /dev/ttyUSB0 name_of_firmware.bin
    

    It suggests that LF686 may be a version of BL602, have you tried programming that?
    Helpful post? Buy me a coffee.
  • #312 20489780
    pitas999
    Level 2  
    I'm a little bit confused about post #252, can't decipher if that user flashed the LF686 with the BL602 firmware or not. but later i can give it a try and see if i can flash it!
  • #313 20491766
    pitas999
    Level 2  
    Flashed the FL868 with the BL602 binary and it works, I can't tell it is 100% working because this is my first time with your project.

    Regarding the configuration does it have support for domoticz? I can only find the configuration settings for home assistant.

    Thanks for your hard work!
  • #314 20491772
    p.kaczmarek2
    Moderator Smart Home
    Wow that is a very good news, can you submit a device teardown as a separate article so we can include this in our online templates list?
    Submit the IoT device teardown/review/guide/article and get a free SD card
    What do you need for domoticz? It has been discussed few times already but I am not sure if it's fully there. Domoticz has this strange MQTT format.

    Would you be able to tell me exactly what the relay should publish on change and what should listen to so it works with Domoticz? With examples? But I am not asking for a link to docs with a 50 options, just a basic, most minimal, possible MQTT format that would help you to get it running with domoticz. The most basic version.
    Helpful post? Buy me a coffee.
  • #315 20493724
    pitas999
    Level 2  
    Sorry for the late reply, I don't know if this helps but here's the log from the console of a tasmota (ESP) RGB controller output from the commandos ON/OFF (issued from domoticz):

    OFF domoticz
    10:48:43 MQT: stat/Leds_Desktop/RESULT = {"POWER":"OFF"}

    ON DOMOTICZ
    10:49:25 MQT: domoticz/in = {"idx":100,"nvalue":1,"svalue":"50","Battery":100,"RSSI":8}
    10:49:25 MQT: stat/Leds_Desktop/RESULT = {"POWER":"ON","Dimmer":50,"Color":"6E807C","HSBColor":"166,14,50","Channel":[43,50,49]}

    and here the output with the commands issued from tasmota itself

    OFF TASMOTA
    10:50:21 MQT: domoticz/in = {"idx":100,"nvalue":0,"svalue":"50","Battery":100,"RSSI":8}
    10:50:21 MQT: stat/Leds_Desktop/RESULT = {"POWER":"OFF"}

    ON TASMOTA
    10:50:31 MQT: domoticz/in = {"idx":100,"nvalue":1,"svalue":"50","Battery":100,"RSSI":8}
    10:50:31 MQT: stat/Leds_Desktop/RESULT = {"POWER":"ON"}

    color change command
    COLOR CHANGE DOMOTICZ
    10:59:46 MQT: stat/Leds_Desktop/RESULT = {"POWER":"ON","Dimmer":51,"Color":"820B7C","HSBColor":"303,91,51","Channel":[51,4,49]}

    COLOR CHANGE TASMOTA
    11:00:23 MQT: domoticz/in = {"idx":100,"nvalue":1,"svalue":"51","Battery":100,"RSSI":8}
    11:00:23 MQT: stat/Leds_Desktop/RESULT = {"POWER":"ON","Dimmer":51,"Color":"660B82","HSBColor":"286,91,51","Channel":[40,4,51]}



    "idx" is the unique sensor number of the sensor in domoticz!

    I can try to give more advanced information/logs but you'll have to be more specific because I'm not too knowledgeable in MQTT.
  • #316 20494469
    sp5mbx
    Level 12  
    >>20469312
    @Zain00

    I also received such errors, it helped - I unpacked the packed program from git into a file with a short name, e.g. D:\1\ - and then, after properly preparing the links for the batch, it worked without any problems. version 1.4.8 works.
    Originally, I unpacked the program: D:\BL602 IoT SDK and the DT-BL10 WiFi and BLE RISC-V development board\OpenBL602-master\ here there was a program with subdirectories.
    Maybe it will help you.
    73 Best regards
  • #317 20502891
    Zain00
    Level 10  
    Thanks, I tried that but still nothing

    Added after 3 [minutes]:

    @p.kaczmarek2 I think there is a problem with the latest BL602 OTA update. After updating the device, it stopped working and I had to reflash it with USB.
    I had one device pricked, and I get this error when I try to flash it
    {"ErrorCode": "0003","ErrorMsg":"BFLB LOAD HELP BIN FAIL"}
    {"ErrorCode": "0050","ErrorMsg":"BFLB IMG LOAD SHAKEHAND FAIL"}
  • ADVERTISEMENT
  • #318 20504107
    p.kaczmarek2
    Moderator Smart Home
    Hmm I just had a report on Github also saying that OTA breaks after 609:
    Tasmota replacement for BL602, programming, pairing with Home Assistant, now with OTA working!
    The user says that he can easily recover device via UART.
    I can't see any bad changes in code around 609, problem might be related to flash binary size.

    So far I have disabled few unused drivers in BL602 and reduced flash memory usage by 5KB, we'll check soon if it works. I am unable to do so yet due to the continuous lack of dev board (my one was bricked by MAC change attempt about a week or two ago).

    Are you sure that UART flashing is not working for you? Have you done boot pull trick?
    Helpful post? Buy me a coffee.
  • #319 20505760
    p.kaczmarek2
    Moderator Smart Home
    @Zain00 , the reported OTA issue has been solved. Tests have shown that the binary size was too big for BL602 OTA system.
    Tasmota replacement for BL602, programming, pairing with Home Assistant, now with OTA working!
    I will be reducing binary size further soon.
    Helpful post? Buy me a coffee.
  • #320 20512970
    gromdar
    Level 1  
    >>20489742


    I've just received two devices with LF686. I've uploaded software for BL602 according to instruction (twice, first download attempt failed). It seems that everything works fine on first device. I mean MQTT reports changes, led dimms as expected. The only strange thing was IP in AP mode it was 192.168.169.1 ... maybe I did something wrong. Fortunately IP was reported on serial port.
    Edit :
    Second device went even easier. After connecting to network browser opened page http://www.msftconnecttest.com/ with device so could easy configure my wifi. So far both devices works well.
    BTW . My version looks exactly the same , PCB is perfectly the same as BL version , only processor is different. Tasmota replacement for BL602, programming, pairing with Home Assistant, now with OTA working!
  • #321 20517573
    nomek
    Level 18  
    @p.kaczmarek2 do you know if the MAC problem has been resolved?
  • #322 20522100
    arhi3a
    Level 1  
    Hello,
    it would seem that new Magic Homes from china are coming with BL602 relabeled as LF686 (LF686C20).
    You can google documentation about this processor version under "BF2 Data sheet (LF688/LF686)" .
    I've been able to successfully flash it with OpenBeken without any problems.
    Tasmota replacement for BL602, programming, pairing with Home Assistant, now with OTA working!
  • #323 20538400
    cheisenbahnfreund
    Level 1  
    @p.kaczmarek2 Thank you for this great work to get rid of the ewelink cloud stuff. They almost went to the trashcan.
    I just stepped over the videos on youtube and with the help of the forum I was able to flash all of my fake-sonoff SWITCH-WF.
    The only thing I experienced was that the resistor (3,3V-LOG pad) used to get it into boot mode. It worked only on the first device, all other did not enter boot mode. Measuring the voltage at the pin showed that it was in an undefined logical area when using 10k and had to be smaller, 1k did the job. The configuration for this device 1-LED, 5-BTN, 22-REL.
    Works like a charm!!
  • #324 20552790
    pechevef
    Level 2  
    Hello, my name is Paco, I'm from Spain and this is my first message in this forum

    This project and this topic is very interesting for me.
    I bought a RGB LED strip with IR remote control and WiFi like this in AliExpress ( Link )
    I expected it to be compatible with Magic Home, to be able to integrate it into Home Assistant, but the suggested app to handle it was TechLife Pro, which cannot be integrated into Home Assistant

    II thought about flashing Tasmota for it, but it's not compatible either
    I disassembled the controller and found that it has BL602C20 chip

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

    I finally found this thread, which has the instructions to get it able to flash and integrate it into Home Assistant locally

    I have read the whole thread, but I haven't quite found the specific instructions to be able to flash the device, but on the OpenBK7231T_App github page there is a lot of information to get started

    My first step was to follow the instructions in the Russian guide BL602 RGB (Link)
    My device is not exactly the same, but it is very similar, and I followed the proposed steps:

    1.- Solder wires to the exposed pins (VCC I08 RX TX GND) There is another pin labeled RES, which must be to RESET the board. I have not used it. I have assumed that the I08 pin corresponds to the Boot PIN, since I have read that the GPI08 must be activated to put the chip in flashing mode

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

    2.- Connect the device to a USB-TTL adapter with a resistor to activate the flashing mode. I have followed this scheme:

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

    3.- I downloaded the components suggested in that guide (BL602.zip, which includes the flashing program BLDevCube.exe) and the firmware OpenBL602_1.15-406.bin

    4.- Connect the TTL to my Windows PC and run the BLDevCube.exe utility, replacing the files with those corresponding to the locations on my hard drive and select the COM6 port that appeared to connect the USB-TTL

    5.- When clicking Create and Download, the following error message appears ERROR : {"ErrorCode":"0069","ErrorMsg":"BFLB FLASH ID NOS SUPPORT"}

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

    I tried again with the last firmware OpenBL602_1.17.29.bin with the same result

    The Log File is:

    Spoiler:
    [20:39:14.951] - [param]
    interface_type = "Uart"
    comport_uart = "COM6"
    speed_uart = "2000000"
    speed_jlink = "1000"
    bl60x_brd = "IoTKitA"
    bl60x_xtal = "40M"
    aes_key = ""
    aes_iv = ""
    addr = "0x0"

    [check_box]
    partition_download = true
    boot2_download = true
    bin_download = true
    media_download = false
    use_romfs = false
    mfg_download = false
    ro_params_download = true
    ckb_erase_all = "False"
    encrypt = false
    download_single = false

    [input_path]
    pt_bin_input = "C:\\...\\partition\\partition_cfg_2M.toml"
    boot2_bin_input = "C:\\...\builtin_imgs\\blsp_boot2.bin"
    cfg2_bin_input = "C:\\...\\OpenBL602_1.17.29.bin"
    meida_bin_input = ""
    romfs_dir_input = ""
    mfg_bin_input = ""
    img_bin_input = ""
    [20:39:14.957] - ========= Interface is Uart =========
    [20:39:14.969] - eflash loader bin is eflash_loader_40m.bin
    [20:39:14.972] - ========= chip flash id: ef4015 =========
    [20:39:14.974] - flash_id:ef4015 do not support
    [20:39:14.976] - ========= chip flash id: ef4015 =========
    [20:39:14.977] - flash_id:ef4015 do not support
    [20:39:14.978] - Please check your partition table file


    I think the problem could be that the chip is BL602C20, and that it is not exactly the same as the BL602L20 chips in other devices. The partition table file

    I have also studied Youtube tutorials "Magic Home BL602 RGB LED Strip programming with OpenBeken - new Tasmota/Esphome port style firmware" and "How to flash new Sonoff BL602 bulb B05-BL-A60 - 100% free from cloud guide and BP5758 configuration" , but I have not found a solution or that I have done something wrong

    Does anyone have any clue what could happen?

    If I manage to solve it, I will document it and write a teardown. Thanks in advance

    Regards
    Paco
  • #325 20553122
    p.kaczmarek2
    Moderator Smart Home
    Hello, I haven't checked myself, but I've seen comments in this thread saying that it can be flashed with a newer version of BLDevCube.exe . I am not sure yet. Maybe someone like @Zain00 can know more about it.

    Btw you can also do a firmware read (backup) first with BLDevCube.exe as well. Just in case that something goes wrong.
    Helpful post? Buy me a coffee.
  • #326 20560067
    pechevef
    Level 2  
    Thank you very much for your answer

    I have I have found a new version of BLDevCube.exe at https://dev.bouffalolab.com/download

    I have tried flashing the chip with this new version and the same files as suggested in the Russian guide, except OpenBL602_1.17.29.bin and it seems to have worked, no errors

    Tasmota replacement for BL602, programming, pairing with Home Assistant, now with OTA working!
  • #327 20565786
    jackhrictest
    Level 1  
    Hey guys!
    Just hooked up 3 of my Magic Home LED controllers with OpenBeken and it works flawlessly for a little bit using MQTT. However, after around 50-55 minutes, all three of my controllers become unresponsive at the same time (if powered up at the same time...), and are inaccessible with MQTT and IP. The LEDs stay on, so I'm assuming something with my WiFi / MQTT configuration might be off. The only logs with ALL selected only show this repeating until crash:
    Info:MAIN:Time 936, idle 0/s, free 102240, MQTT 1(1), bWifi 1, secondsWithNoPing 867, socks 2/21 
    Info:MAIN:Time 937, idle 0/s, free 102240, MQTT 1(1), bWifi 1, secondsWithNoPing 868, socks 2/21 
    Info:MAIN:Time 938, idle 0/s, free 102240, MQTT 1(1), bWifi 1, secondsWithNoPing 869, socks 2/21 
    Info:MAIN:Time 939, idle 0/s, free 102240, MQTT 1(1), bWifi 1, secondsWithNoPing 870, socks 2/21 
    Info:MAIN:Time 940, idle 0/s, free 102240, MQTT 1(1), bWifi 1, secondsWithNoPing 871, socks 2/21 
    


    My MQTT server has no credentials, and uses the homeassistant prefix.
    Anyone have any pointers?

    Thank you again for the help!
  • #328 20609824
    pdrobek
    Level 10  
    Can somebody share working connection diagram for flashing Magic Home LED Controller based on BL602 chip? I tried to use Arduino UNO without Atmega IC of course as flashing tool.

    Connection:
    Arduino site ---> LED controller site
    5V ---> main VCC of LED controller (simply power up device)
    GND ---> GND
    TX ---> TX (this is not an error because it works while flashing esp8266)
    RX ---> RX (this is not an error because it works while flashing esp8266)

    3V3 connected to BOOT pad with 10k Ohm resistor

    I also tried steps from https://www.youtube.com/watch?v=bs0ylC6xRs0, no luck because there are no information when i should connect USB to flash my device.

    I tried to use newest version of BLDevCube as stated in https://github.com/openshwprojects/OpenBK7231T_App/issues/848

    Dodano po 5 [godziny] 35 [minuty]:

    Issue with flashing resolved. Tasmota replacement for BL602, programming, pairing with Home Assistant, now with OTA working!

    Does anyone know why i got weird ip. Not 192.168.4.1?
  • #329 20610274
    p.kaczmarek2
    Moderator Smart Home
    Hello, how did you resolve flash issue?

    It seems that BL602 is still using non-standard IP, just like it's mentioned earlier in this topic and on our YT videos:
    https://www.youtube.com/watch?v=L6d42IMGhHw
    Tasmota replacement for BL602, programming, pairing with Home Assistant, now with OTA working!
    Helpful post? Buy me a coffee.

Topic summary

The discussion revolves around the development and integration of firmware for devices based on the BL602 chip, particularly focusing on flashing procedures, MQTT connectivity, and Home Assistant integration. Users share their experiences with various models, including Magic Home LED controllers and Sonoff devices, detailing successful flashing processes, issues with WiFi connectivity, and the need for stable power supplies. The conversation also touches on the implementation of features like OTA updates, Alexa integration, and the challenges faced with different firmware versions. Users report on the behavior of their devices post-flashing, including boot loops and MAC address duplication issues, while seeking solutions and sharing troubleshooting tips.
Summary generated by the language model.
ADVERTISEMENT