Elektroda.com
Elektroda.com
X

[BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

p.kaczmarek2 89277 1198
This content has been translated flag-pl » flag-en View the original version here.
  • ferbulous
    Level 15  
    p.kaczmarek2 wrote:
    Regarding AP issue - you might have gotten unlucky and gotten the build with a temporary issue which is resolved. Try latest build.


    I've flashed the latest build 1.14.124
    I noticed right I changed the mac address (2DAF0EC4BEE1) and restarted the switch, it's not connecting to the wifi (led wifi status keeps blinking). Which then I attempt to do 7x power cycle, but I wasn't able to connect to openbk access point.

    p.kaczmarek2 wrote:
    Second news: I wrote a simple SPI flasher for BK, right now just with hardcoded parms, more coming soon...
    https://github.com/openshwprojects/BK7231_SPI_Flasher
    This tool is able to bring back the bricked BK chips back to live.

    So I'll just need to run this script and it should restore the proper/correct mac address for the BK chip?
  • yonnit
    Level 2  
    p.kaczmarek2 wrote:
    @yonnit I can get a driver for you for that device, but are you able to determine what kind of LEDs are used there, or at least tell us if they were able to have different colors (each LED different color) with Tuya firmware?
    I'd suspect they are ws2812b.


    With the original firmware and Smart Life App there were only predefined scenes I could choose from, but when using a scene, rainbow for example each LED was able to change its color.

    I was trying to cut open the rubber ball around the LED, but unfortunately they are additionally encased in some harder plastic I don't think I can get off :/

    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
  • botioni
    Level 11  
    As for the mac glich you can use older build thet is ok x.x.85 is ok 100% I don't rember what version was thet is discovered the glich, RGB working also on this firmware .
  • ferbulous
    Level 15  
    botioni wrote:
    As for the mac glich you can use older build thet is ok x.x.85 is ok 100% I don't rember what version was thet is discovered the glich, RGB working also on this firmware .


    So the mac glitch changing to C8:47:8C:00:00:00 after power cycle reset is a new bug after x.x.85 firmware?

    @p.kaczmarek2 for the spi flasher which i’m not familiar yet
    but in some rare cases one might overwrite Beken bootloader and thus brick the BK

    How would i know if i accidently overwrite beken bootloader and bricked the BK chip?
    1) Does it still broadcast its own AP after power cycle reset?
    2) UART serial flashing no longer works?
  • botioni
    Level 11  
    Yes the mac glich is new if bootloader is owerwriten the bk chip wil not boot at all will be dead like a computer no screen nothing no power on. Uart flashing will not work if no bootloader only spi flashing .
  • ferbulous
    Level 15  
    botioni wrote:
    Yes the mac glich is new if bootloader is owerwriten the bk chip wil not boot at all will be dead like a computer no screen nothing no power on. Uart flashing will not work if no bootloader only spi flashing .


    How do i prevent this before i start flashing?
    Few months ago I had another device, a switch which possibly has the same issue with bootloader overwritten.
    Only the LED wifi indicator lights up and that’s it. I can still flash via UART but it’s not booting up at all/connect to wifi
  • botioni
    Level 11  
    If you can flash via uart then bootloader is intact if a WiFi led is on thet is not a boot loader isu
  • p.kaczmarek2
    Moderator Smart Home
    botioni wrote:
    RGB working also on this firmware .

    RGB was fixed by our developer @iprak tonight morning:
    https://github.com/openshwprojects/OpenBK7231T_App/pull/415


    The MAC address recovery from Web Application->Flash Tab->Restore RF Partition should work, but it's just always good to test each new feature on devices that have possible wire access for flashing.

    Device with broken bootloader = not able to connect via UART. Not able to read, not able to write, not able to erase.

    If you have a totally bricked device, with even no UART working, you can also use my newly proposed SPI solution. The article is not translated yet:
    https://www.elektroda.pl/rtvforum/topic3931424.html
  • botioni
    Level 11  
    Is it possible to change ap mode enter behavior? When to enter how many boot failure or somthing it is entering to quickly.
  • p.kaczmarek2
    Moderator Smart Home
    @botioni
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    right now, the boot is marked as corrrect after 30 seconds. You can try changing it to eg. 10 seconds or 5 seconds.
  • ferbulous
    Level 15  
    p.kaczmarek2 wrote:
    Device with broken bootloader = not able to connect via UART. Not able to read, not able to write, not able to erase.

    If you have a totally bricked device, with even no UART working, you can also use my newly proposed SPI solution. The article is not translated yet:
    https://www.elektroda.pl/rtvforum/topic3931424.html


    Currently i have 3 device
    CB3S - UART works, mac address changed causing odd issues not connecting to wifi even after re-flashing
    CB3S - UART works, but no response/connect to wifi
    WB3S - UART not working,

    Can I use bk7231_spi_flasher.py script for N device?

    
    - set CEN to low
    - wait 1 second
    - set CEN to high
    

    Do i manually set CEN to low & high or this is done by the script?
  • p.kaczmarek2
    Moderator Smart Home
    ferbulous wrote:

    Currently i have 3 device
    CB3S - UART works, mac address changed causing odd issues not connecting to wifi even after re-flashing
    CB3S - UART works, but no response/connect to wifi

    Are you aware about the fact that MAC addresses should be unique? If you happen to have two devices with the same MAC, you will get strange connect issues. WiFi will not connect or will be unstable. Page might load once or two and then will stop responding.

    Please disconnect other "empty MAC" devices from router before trying or try with different router.

    You can also try this dump - it's full 2MB, it will override whole config, lfs, rf and MAC partition:
    (WARNING! THIS IS FOR N ONLY! BK7231N! Not for T! Flashing to T will break T!)
    FullFW_tem...roblem.zip Download (843.29 kB)
    Flash it like QIO, at offset 0, it's full image of N device.
    If it works and connects to WiFi, then use "Restore RF partition" button in Web App (flash Tab) and change MAC by WWW GUI to something unique.


    ferbulous wrote:


    WB3S - UART not working,

    Can I use bk7231_spi_flasher.py script for N device?

    I didn't test that, but please try and report here results.
    For N, just use flasher to flash whole QIO image for N platform.
    But WB3S i T.
    Also, if UART works, there is no need to use SPI flasher.


    ferbulous wrote:

    
    - set CEN to low
    - wait 1 second
    - set CEN to high
    

    Do i manually set CEN to low & high or this is done by the script?

    Everything is done by the script, but you have to remember to select correct CEN GPIO in the code (you might have used different GPIO than me).

    You can use any GPIO for CEN for my script, everything will work as long as you have chosen the same GPIO in code.

    You can check if your GPIO selection in code is correct by temporary disconnecting CEN of BK and connecting LED + resistor to that Raspberry pin of your choice and to VDD. If LED blinks, then you have correctly configured pin. Of course remember to connect LED polarity correctly.
  • ferbulous
    Level 15  
    p.kaczmarek2 wrote:
    Are you aware about the fact that MAC addresses should be unique? If you happen to have two devices with the same MAC, you will get strange connect issues. WiFi will not connect or will be unstable. Page might load once or two and then will stop responding.

    I had 2 device that were already reset online, wasn't aware both had the same MAC at the time which cause that odd issues you mentioned
    Which is why i changed the first one to some random mac that triggered this problem, so probably won't do that again

    p.kaczmarek2 wrote:
    Flash it like QIO, at offset 0, it's full image of N device.
    If it works and connects to WiFi, then use "Restore RF partition" button in Web App (flash Tab) and change MAC by WWW GUI to something unique.

    Thank you so much for this, the other CB3S device that's been in storage for the past few months now works again!

    Will start using SPI flasher to restore WB3S once i've setup the raspberry pi
  • botioni
    Level 11  
    how to configure a push button ?
    if push 1 and 0 when relesed.

    Added after 48 [minutes]:

    how to use ONDBLCLICK event if ther is one
    how to use ONHOLD event if ther is one
    i want to do somthing like ondbclick publish dimer dimm10%
    onhold somthing with repeat publish dimer dimm1%
    onsingleclick publish onsgclik singleclick

    found the correct events for other not to look for them.
    addEventHandler ONDBLCLICK 24 publish test dublu
    addEventHandler ONHOLD 24 publish test lung
    addEventHandler ONCLICK 24 publish test simplu
  • botioni
    Level 11  
    what can we use for "color_mode_state_topic :"?
    problem is HA alweys overwrites last setings to rgb value last know good at the bulb turns to color mode .
  • p.kaczmarek2
    Moderator Smart Home
    botioni wrote:


    found the correct events for other not to look for them.
    addEventHandler ONDBLCLICK 24 publish test dublu
    addEventHandler ONHOLD 24 publish test lung
    addEventHandler ONCLICK 24 publish test simplu

    Nice! There is also now a "onrelease", because someone requested it.

    botioni wrote:
    what can we use for "color_mode_state_topic :"?
    problem is HA alweys overwrites last setings to rgb value last know good at the bulb turns to color mode .

    how to reproduce the error, step by step? Have you enabled the "retain" flag in OBK settings?

    Sadly OTA is not yet there for BL602 because it was not present in BL602 SDK we used. Is there any programmer willing to help with that?

    We have OTA for all BK chips (T, N), for W600/601, W800/801, etc...
  • ferbulous
    Level 15  
    p.kaczmarek2 wrote:
    You can also try this dump - it's full 2MB, it will override whole config, lfs, rf and MAC partition:
    (WARNING! THIS IS FOR N ONLY! BK7231N! Not for T! Flashing to T will break T!)

    Could I request for T firmware dump that does the same thing?

    p.kaczmarek2 wrote:
    Nice! There is also now a "onrelease", because someone requested it.

    Is there example for onrelease use in the script?
  • rupertst
    Level 6  
    I have problems with compiling form github. I done it many times, but now I get an error. I cloned latest version. In meantime I upgraded from ubuntu 20.04 to 22.04, so I am not sure is it source problem or compiler. I get following errors:

    ===========================================================
    Build template_demo
    ===========================================================
    echo prerequirement1
    prerequirement1
    mkdir -p Debug/obj
    mkdir -p Debug/bin
    echo prerequirement2
    prerequirement2
    ../toolchain/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-gcc -g -Wl,--gc-sections -marm -mcpu=arm968e-s -mthumb-interwork  -Xlinker -Map=tuya.map   -Wl,-wrap,malloc -Wl,-wrap,_malloc_r -Wl,-wrap,free -Wl,-wrap,_free_r -Wl,-wrap,zalloc -Wl,-wrap,calloc -Wl,-wrap,realloc  -Wl,-wrap,_realloc_r -Wl,-wrap,vsnprintf -Wl,-wrap,snprintf -Wl,-wrap,sprintf -Wl,-wrap,vsprintf -Wl,-wrap,strtod -Wl,-wrap,qsort -Wl,-wrap,sscanf -o ../../../apps/template_demo/output/1.0.0/template_demo_1.0.0.axf  Debug/obj/app_bk.o Debug/obj/ate_app.o Debug/obj/param_config.o Debug/obj/sa_ap.o Debug/obj/sa_station.o Debug/obj/ieee802_11_demo.o Debug/obj/dd.o Debug/obj/drv_model.o Debug/obj/dma.o Debug/obj/driver.o Debug/obj/arch_main.o Debug/obj/fft.o Debug/obj/flash.o Debug/obj/general_dma.o Debug/obj/gpio.o Debug/obj/i2s.o Debug/obj/i2c1.o Debug/obj/i2c2.o Debug/obj/icu.o Debug/obj/intc.o Debug/obj/irda.o Debug/obj/mac_phy_bypass.o Debug/obj/phy_trident.o Debug/obj/pwm.o Debug/obj/mcu_ps_timer.o Debug/obj/bk_timer.o Debug/obj/rw_platf_pub.o Debug/obj/saradc.o Debug/obj/spi.o Debug/obj/spidma.o Debug/obj/sys_ctrl.o Debug/obj/Retarget.o Debug/obj/uart_bk.o Debug/obj/wdt.o Debug/obj/ble.o Debug/obj/prf.o Debug/obj/sdp_service.o Debug/obj/sdp_service_task.o Debug/obj/comm.o Debug/obj/comm_task.o Debug/obj/app_ble.o Debug/obj/app_task.o Debug/obj/app_sdp.o Debug/obj/app_sec.o Debug/obj/app_comm.o Debug/obj/common_list.o Debug/obj/common_utils.o Debug/obj/RomCallFlash.o Debug/obj/dbg.o Debug/obj/dbg_mwsgen.o Debug/obj/dbg_swdiag.o Debug/obj/dbg_task.o Debug/obj/rwip.o Debug/obj/ble_rf_xvr.o Debug/obj/ecc_p256.o Debug/obj/uart.o Debug/obj/func.o Debug/obj/bk7231U_cal.o Debug/obj/manual_cal_bk7231U.o Debug/obj/role_launch.o Debug/obj/hostapd_intf.o Debug/obj/ddrv.o Debug/obj/signal.o Debug/obj/sk_intf.o Debug/obj/fake_socket.o Debug/obj/main_none.o Debug/obj/aes-internal.o Debug/obj/aes-internal-dec.o Debug/obj/aes-internal-enc.o Debug/obj/aes-unwrap.o Debug/obj/aes-wrap.o Debug/obj/bk_md5.o Debug/obj/md5-internal.o Debug/obj/rc4.o Debug/obj/bk_sha1.o Debug/obj/sha1-internal.o Debug/obj/sha1-pbkdf2.o Debug/obj/sha1-prf.o Debug/obj/tls_none.o Debug/obj/ap_config.o Debug/obj/ap_drv_ops.o Debug/obj/ap_list.o Debug/obj/ap_mlme.o Debug/obj/beacon.o Debug/obj/drv_callbacks.o Debug/obj/hostapd.o Debug/obj/hw_features.o Debug/obj/ieee802_11_auth.o Debug/obj/ieee802_11.o Debug/obj/ieee802_11_ht.o Debug/obj/ieee802_11_shared.o Debug/obj/ieee802_1x.o Debug/obj/sta_info.o Debug/obj/tkip_countermeasures.o Debug/obj/utils.o Debug/obj/wmm.o Debug/obj/wpa_auth.o Debug/obj/wpa_auth_glue.o Debug/obj/wpa_auth_ie.o Debug/obj/hw_features_common.o Debug/obj/ieee802_11_common.o Debug/obj/wpa_common.o Debug/obj/driver_beken.o Debug/obj/driver_common.o Debug/obj/drivers.o Debug/obj/l2_packet_none.o Debug/obj/wpa.o Debug/obj/wpa_ie.o Debug/obj/common.o Debug/obj/eloop.o Debug/obj/os_none.o Debug/obj/wpabuf.o Debug/obj/blacklist.o Debug/obj/bss.o Debug/obj/config.o Debug/obj/config_none.o Debug/obj/events.o Debug/obj/main_supplicant.o Debug/obj/notify.o Debug/obj/wmm_ac.o Debug/obj/wpa_scan.o Debug/obj/wpas_glue.o Debug/obj/wpa_supplicant.o Debug/obj/lib_libvscanf.o Debug/obj/lib_memsistream.o Debug/obj/lib_meminstream.o Debug/obj/lib_sscanf.o Debug/obj/lib_vsscanf.o Debug/obj/lib_strtod.o Debug/obj/lib_qsort.o Debug/obj/ethernetif.o Debug/obj/net.o Debug/obj/sys_arch.o Debug/obj/api_lib.o Debug/obj/api_msg.o Debug/obj/err.o Debug/obj/netbuf.o Debug/obj/netdb.o Debug/obj/netifapi.o Debug/obj/sockets.o Debug/obj/tcpip.o Debug/obj/altcp.o Debug/obj/altcp_alloc.o Debug/obj/altcp_tcp.o Debug/obj/def.o Debug/obj/dns.o Debug/obj/inet_chksum.o Debug/obj/init.o Debug/obj/ip.o Debug/obj/ip_a.o Debug/obj/autoip.o Debug/obj/dhcp.o Debug/obj/etharp.o Debug/obj/icmp.o Debug/obj/igmp.o Debug/obj/ip4_addr.o Debug/obj/ip4.o Debug/obj/ip4_frag.o Debug/obj/dhcp6.o Debug/obj/ethip6.o Debug/obj/icmp6.o Debug/obj/inet6.o Debug/obj/ip6_addr.o Debug/obj/ip6.o Debug/obj/ip6_frag.o Debug/obj/mld6.o Debug/obj/nd6.o Debug/obj/mem.o Debug/obj/memp.o Debug/obj/netif.o Debug/obj/pbuf.o Debug/obj/raw.o Debug/obj/stats.o Debug/obj/sys.o Debug/obj/tcp.o Debug/obj/tcp_in.o Debug/obj/tcp_out.o Debug/obj/timeouts.o Debug/obj/udp.o Debug/obj/ethernet.o Debug/obj/httpd.o Debug/obj/fs.o Debug/obj/mqtt.o Debug/obj/dhcp-server.o Debug/obj/dhcp-server-main.o Debug/obj/fake_clock.o Debug/obj/target_util.o Debug/obj/net_param.o Debug/obj/multi_button.o Debug/obj/key_main.o Debug/obj/start_type.o Debug/obj/power_save.o Debug/obj/manual_ps.o Debug/obj/mcu_ps.o Debug/obj/rx_sensitivity.o Debug/obj/tx_evm.o Debug/obj/rw_ieee80211.o Debug/obj/rw_msdu.o Debug/obj/rw_msg_rx.o Debug/obj/rw_msg_tx.o Debug/obj/gpio_uart.o Debug/obj/pwm_uart.o Debug/obj/spidma_intf.o Debug/obj/temp_detect.o Debug/obj/cmd_evm.o Debug/obj/cmd_help.o Debug/obj/cmd_reg.o Debug/obj/cmd_rx_sensitivity.o Debug/obj/command_line.o Debug/obj/command_table.o Debug/obj/udebug.o Debug/obj/BkDriverFlash.o Debug/obj/BkDriverRng.o Debug/obj/BkDriverGpio.o Debug/obj/BkDriverPwm.o Debug/obj/BkDriverUart.o Debug/obj/BkDriverWdg.o Debug/obj/BkDriverTimer.o Debug/obj/wlan_cli.o Debug/obj/wlan_ui.o Debug/obj/tuya_pwm.o Debug/obj/mem_arch.o Debug/obj/platform_stub.o Debug/obj/str_arch.o Debug/obj/gpio_test.o Debug/obj/tuya_gpio.o Debug/obj/tuya_key.o Debug/obj/tuya_led.o Debug/obj/tuya_uart.o Debug/obj/tuya_device.o Debug/obj/adapter_platform.o Debug/obj/tuya_hal_memory.o Debug/obj/tuya_hal_mutex.o Debug/obj/tuya_hal_network.o Debug/obj/tuya_hal_output.o Debug/obj/tuya_hal_semaphore.o Debug/obj/tuya_hal_system.o Debug/obj/tuya_hal_thread.o Debug/obj/tuya_hal_bt.o Debug/obj/tuya_hal_rtc.o Debug/obj/tuya_hal_storge.o Debug/obj/tuya_hal_wifi.o Debug/obj/boot_handlers.o Debug/obj/boot_vectors.o Debug/obj/croutine.o Debug/obj/event_groups.o Debug/obj/list.o Debug/obj/port.o Debug/obj/heap_4.o Debug/obj/queue.o Debug/obj/tasks.o Debug/obj/timers.o Debug/obj/rtos_pub.o  -L./beken378/lib/ -lrwnx -L./beken378/lib/ -lble -lstdc++ -T./beken378/build/bk7231_ota.ld
    Debug/obj/uart_bk.o: In function `bk_printf':
    /home/rupert/Pobrane/wb3s/OpenBK7231T/platforms/bk7231t/bk7231t_os/beken378/driver/uart/uart_bk.c:119: undefined reference to `__wrap_vsnprintf'
    Debug/obj/role_launch.o: In function `rl_write_bssid_info':
    /home/rupert/Pobrane/wb3s/OpenBK7231T/platforms/bk7231t/bk7231t_os/beken378/func/joint_up/role_launch.c:60: undefined reference to `__wrap_sprintf'
    Debug/obj/ethernetif.o: In function `low_level_init':
    /home/rupert/Pobrane/wb3s/OpenBK7231T/platforms/bk7231t/bk7231t_os/beken378/func/lwip_intf/lwip-2.1.3/port/ethernetif.c:140: undefined reference to `CFG_GetDeviceName'
    /home/rupert/Pobrane/wb3s/OpenBK7231T/platforms/bk7231t/bk7231t_os/beken378/func/lwip_intf/lwip-2.1.3/port/ethernetif.c:144: undefined reference to `__wrap_sprintf'
    Debug/obj/mem.o: In function `mem_overflow_check_raw':
    /home/rupert/Pobrane/wb3s/OpenBK7231T/platforms/bk7231t/bk7231t_os/beken378/func/lwip_intf/lwip-2.1.3/src/core/mem.c:108: undefined reference to `__wrap_snprintf'
    /home/rupert/Pobrane/wb3s/OpenBK7231T/platforms/bk7231t/bk7231t_os/beken378/func/lwip_intf/lwip-2.1.3/src/core/mem.c:119: undefined reference to `__wrap_snprintf'
    Debug/obj/str_arch.o: In function `os_snprintf':
    /home/rupert/Pobrane/wb3s/OpenBK7231T/platforms/bk7231t/bk7231t_os/beken378/os/str_arch.c:79: undefined reference to `__wrap_vsnprintf'
    collect2: error: ld returned 1 exit status
    make[1]: *** [application.mk:772: application] Błąd 1
    make[1]: Opuszczenie katalogu '/home/rupert/Pobrane/wb3s/OpenBK7231T/platforms/bk7231t/bk7231t_os'
    make: *** [Makefile:5: mp] Błąd 2
    make: Opuszczenie katalogu '/home/rupert/Pobrane/wb3s/OpenBK7231T/platforms/bk7231t/bk7231t_os'
    


    and
    
    ===========================================================
    Build OpenBK7231T_App
    ===========================================================
    ../toolchain/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-gcc -g -Wl,--gc-sections -marm -mcpu=arm968e-s -mthumb-interwork  -Xlinker -Map=tuya.map   -Wl,-wrap,malloc -Wl,-wrap,_malloc_r -Wl,-wrap,free -Wl,-wrap,_free_r -Wl,-wrap,zalloc -Wl,-wrap,calloc -Wl,-wrap,realloc  -Wl,-wrap,_realloc_r -Wl,-wrap,vsnprintf -Wl,-wrap,snprintf -Wl,-wrap,sprintf -Wl,-wrap,vsprintf -Wl,-wrap,strtod -Wl,-wrap,qsort -Wl,-wrap,sscanf -o ../../../apps/OpenBK7231T_App/output/7700a694/OpenBK7231T_App_7700a694.axf  Debug/obj/app_bk.o Debug/obj/ate_app.o Debug/obj/param_config.o Debug/obj/sa_ap.o Debug/obj/sa_station.o Debug/obj/ieee802_11_demo.o Debug/obj/dd.o Debug/obj/drv_model.o Debug/obj/dma.o Debug/obj/driver.o Debug/obj/arch_main.o Debug/obj/fft.o Debug/obj/flash.o Debug/obj/general_dma.o Debug/obj/gpio.o Debug/obj/i2s.o Debug/obj/i2c1.o Debug/obj/i2c2.o Debug/obj/icu.o Debug/obj/intc.o Debug/obj/irda.o Debug/obj/mac_phy_bypass.o Debug/obj/phy_trident.o Debug/obj/pwm.o Debug/obj/mcu_ps_timer.o Debug/obj/bk_timer.o Debug/obj/rw_platf_pub.o Debug/obj/saradc.o Debug/obj/spi.o Debug/obj/spidma.o Debug/obj/sys_ctrl.o Debug/obj/Retarget.o Debug/obj/uart_bk.o Debug/obj/wdt.o Debug/obj/ble.o Debug/obj/prf.o Debug/obj/sdp_service.o Debug/obj/sdp_service_task.o Debug/obj/comm.o Debug/obj/comm_task.o Debug/obj/app_ble.o Debug/obj/app_task.o Debug/obj/app_sdp.o Debug/obj/app_sec.o Debug/obj/app_comm.o Debug/obj/common_list.o Debug/obj/common_utils.o Debug/obj/RomCallFlash.o Debug/obj/dbg.o Debug/obj/dbg_mwsgen.o Debug/obj/dbg_swdiag.o Debug/obj/dbg_task.o Debug/obj/rwip.o Debug/obj/ble_rf_xvr.o Debug/obj/ecc_p256.o Debug/obj/uart.o Debug/obj/func.o Debug/obj/bk7231U_cal.o Debug/obj/manual_cal_bk7231U.o Debug/obj/role_launch.o Debug/obj/hostapd_intf.o Debug/obj/ddrv.o Debug/obj/signal.o Debug/obj/sk_intf.o Debug/obj/fake_socket.o Debug/obj/main_none.o Debug/obj/aes-internal.o Debug/obj/aes-internal-dec.o Debug/obj/aes-internal-enc.o Debug/obj/aes-unwrap.o Debug/obj/aes-wrap.o Debug/obj/bk_md5.o Debug/obj/md5-internal.o Debug/obj/rc4.o Debug/obj/bk_sha1.o Debug/obj/sha1-internal.o Debug/obj/sha1-pbkdf2.o Debug/obj/sha1-prf.o Debug/obj/tls_none.o Debug/obj/ap_config.o Debug/obj/ap_drv_ops.o Debug/obj/ap_list.o Debug/obj/ap_mlme.o Debug/obj/beacon.o Debug/obj/drv_callbacks.o Debug/obj/hostapd.o Debug/obj/hw_features.o Debug/obj/ieee802_11_auth.o Debug/obj/ieee802_11.o Debug/obj/ieee802_11_ht.o Debug/obj/ieee802_11_shared.o Debug/obj/ieee802_1x.o Debug/obj/sta_info.o Debug/obj/tkip_countermeasures.o Debug/obj/utils.o Debug/obj/wmm.o Debug/obj/wpa_auth.o Debug/obj/wpa_auth_glue.o Debug/obj/wpa_auth_ie.o Debug/obj/hw_features_common.o Debug/obj/ieee802_11_common.o Debug/obj/wpa_common.o Debug/obj/driver_beken.o Debug/obj/driver_common.o Debug/obj/drivers.o Debug/obj/l2_packet_none.o Debug/obj/wpa.o Debug/obj/wpa_ie.o Debug/obj/common.o Debug/obj/eloop.o Debug/obj/os_none.o Debug/obj/wpabuf.o Debug/obj/blacklist.o Debug/obj/bss.o Debug/obj/config.o Debug/obj/config_none.o Debug/obj/events.o Debug/obj/main_supplicant.o Debug/obj/notify.o Debug/obj/wmm_ac.o Debug/obj/wpa_scan.o Debug/obj/wpas_glue.o Debug/obj/wpa_supplicant.o Debug/obj/lib_libvscanf.o Debug/obj/lib_memsistream.o Debug/obj/lib_meminstream.o Debug/obj/lib_sscanf.o Debug/obj/lib_vsscanf.o Debug/obj/lib_strtod.o Debug/obj/lib_qsort.o Debug/obj/ethernetif.o Debug/obj/net.o Debug/obj/sys_arch.o Debug/obj/api_lib.o Debug/obj/api_msg.o Debug/obj/err.o Debug/obj/netbuf.o Debug/obj/netdb.o Debug/obj/netifapi.o Debug/obj/sockets.o Debug/obj/tcpip.o Debug/obj/altcp.o Debug/obj/altcp_alloc.o Debug/obj/altcp_tcp.o Debug/obj/def.o Debug/obj/dns.o Debug/obj/inet_chksum.o Debug/obj/init.o Debug/obj/ip.o Debug/obj/ip_a.o Debug/obj/autoip.o Debug/obj/dhcp.o Debug/obj/etharp.o Debug/obj/icmp.o Debug/obj/igmp.o Debug/obj/ip4_addr.o Debug/obj/ip4.o Debug/obj/ip4_frag.o Debug/obj/dhcp6.o Debug/obj/ethip6.o Debug/obj/icmp6.o Debug/obj/inet6.o Debug/obj/ip6_addr.o Debug/obj/ip6.o Debug/obj/ip6_frag.o Debug/obj/mld6.o Debug/obj/nd6.o Debug/obj/mem.o Debug/obj/memp.o Debug/obj/netif.o Debug/obj/pbuf.o Debug/obj/raw.o Debug/obj/stats.o Debug/obj/sys.o Debug/obj/tcp.o Debug/obj/tcp_in.o Debug/obj/tcp_out.o Debug/obj/timeouts.o Debug/obj/udp.o Debug/obj/ethernet.o Debug/obj/httpd.o Debug/obj/fs.o Debug/obj/mqtt.o Debug/obj/dhcp-server.o Debug/obj/dhcp-server-main.o Debug/obj/fake_clock.o Debug/obj/target_util.o Debug/obj/net_param.o Debug/obj/multi_button.o Debug/obj/key_main.o Debug/obj/start_type.o Debug/obj/power_save.o Debug/obj/manual_ps.o Debug/obj/mcu_ps.o Debug/obj/rx_sensitivity.o Debug/obj/tx_evm.o Debug/obj/rw_ieee80211.o Debug/obj/rw_msdu.o Debug/obj/rw_msg_rx.o Debug/obj/rw_msg_tx.o Debug/obj/gpio_uart.o Debug/obj/pwm_uart.o Debug/obj/spidma_intf.o Debug/obj/temp_detect.o Debug/obj/cmd_evm.o Debug/obj/cmd_help.o Debug/obj/cmd_reg.o Debug/obj/cmd_rx_sensitivity.o Debug/obj/command_line.o Debug/obj/command_table.o Debug/obj/udebug.o Debug/obj/BkDriverFlash.o Debug/obj/BkDriverRng.o Debug/obj/BkDriverGpio.o Debug/obj/BkDriverPwm.o Debug/obj/BkDriverUart.o Debug/obj/BkDriverWdg.o Debug/obj/BkDriverTimer.o Debug/obj/wlan_cli.o Debug/obj/wlan_ui.o Debug/obj/tuya_pwm.o Debug/obj/mem_arch.o Debug/obj/platform_stub.o Debug/obj/str_arch.o Debug/obj/gpio_test.o Debug/obj/tuya_gpio.o Debug/obj/tuya_key.o Debug/obj/tuya_led.o Debug/obj/tuya_uart.o Debug/obj/new_builtin_devices.o Debug/obj/new_cfg.o Debug/obj/new_common.o Debug/obj/new_ping.o Debug/obj/new_pins.o Debug/obj/rgb2hsv.o Debug/obj/tiny_crc8.o Debug/obj/user_main.o Debug/obj/win_main.o Debug/obj/win_main_scriptOnly.o Debug/obj/win_stubs.o Debug/obj/win_flash_stub.o Debug/obj/win_rtos_stub.o Debug/obj/win_mqtt_stub.o Debug/obj/bitmessage_read.o Debug/obj/bitmessage_write.o Debug/obj/new_mqtt.o Debug/obj/new_mqtt_deduper.o Debug/obj/drv_bl0937.o Debug/obj/drv_bl0942.o Debug/obj/drv_bl_shared.o Debug/obj/drv_bp1658cj.o Debug/obj/drv_bp5758d.o Debug/obj/drv_cse7766.o Debug/obj/drv_ddp.o Debug/obj/drv_main.o Debug/obj/drv_ntp.o Debug/obj/drv_sm2135.o Debug/obj/drv_ssdp.o Debug/obj/drv_tasmotaDeviceGroups.o Debug/obj/drv_test_drivers.o Debug/obj/drv_tuyaMCU.o Debug/obj/drv_tuyaMCUSensor.o Debug/obj/drv_uart.o Debug/obj/drv_ucs1912.o Debug/obj/deviceGroups_read.o Debug/obj/deviceGroups_util.o Debug/obj/deviceGroups_write.o Debug/obj/hass.o Debug/obj/http_fns.o Debug/obj/http_tcp_server.o Debug/obj/http_tcp_server_nonblocking.o Debug/obj/new_http.o Debug/obj/rest_interface.o Debug/obj/drv_i2c_lcd_pcf8574t.o Debug/obj/drv_i2c_main.o Debug/obj/drv_i2c_mcp23017.o Debug/obj/drv_i2c_tc74.o Debug/obj/memtest.o Debug/obj/cmd_channels.o Debug/obj/cmd_eventHandlers.o Debug/obj/cmd_if.o Debug/obj/cmd_main.o Debug/obj/cmd_newLEDDriver.o Debug/obj/cmd_newLEDDriver_colors.o Debug/obj/cmd_repeatingEvents.o Debug/obj/cmd_script.o Debug/obj/cmd_send.o Debug/obj/cmd_tasmota.o Debug/obj/cmd_tcp.o Debug/obj/cmd_test.o Debug/obj/cmd_tokenizer.o Debug/obj/hal_adc_win32.o Debug/obj/hal_flashConfig_win32.o Debug/obj/hal_flashVars_win32.o Debug/obj/hal_generic_win32.o Debug/obj/hal_main_win32.o Debug/obj/hal_pins_win32.o Debug/obj/hal_wifi_win32.o Debug/obj/hal_adc_bl602.o Debug/obj/hal_flashConfig_bl602.o Debug/obj/hal_flashVars_bl602.o Debug/obj/hal_generic_bl602.o Debug/obj/hal_main_bl602.o Debug/obj/hal_pins_bl602.o Debug/obj/hal_wifi_bl602.o Debug/obj/hal_adc_w800.o Debug/obj/hal_flashConfig_w800.o Debug/obj/hal_flashVars_w800.o Debug/obj/hal_generic_w800.o Debug/obj/hal_main_w800.o Debug/obj/hal_pins_w800.o Debug/obj/hal_wifi_w800.o Debug/obj/hal_adc_xr809.o Debug/obj/hal_flashConfig_xr809.o Debug/obj/hal_flashVars_xr809.o Debug/obj/hal_generic_xr809.o Debug/obj/hal_main_xr809.o Debug/obj/hal_pins_xr809.o Debug/obj/hal_wifi_xr809.o Debug/obj/hal_adc_bk7231.o Debug/obj/hal_flashConfig_bk7231.o Debug/obj/hal_flashVars_bk7231.o Debug/obj/hal_generic_bk7231.o Debug/obj/hal_main_bk7231.o Debug/obj/hal_pins_bk7231.o Debug/obj/hal_wifi_bk7231.o Debug/obj/logging.o Debug/obj/lfs.o Debug/obj/lfs_util.o Debug/obj/our_lfs.o Debug/obj/jsmn.o Debug/obj/ota.o Debug/obj/http_client.o Debug/obj/utils_net.o Debug/obj/utils_timer.o Debug/obj/cJSON.o Debug/obj/adapter_platform.o Debug/obj/tuya_hal_memory.o Debug/obj/tuya_hal_mutex.o Debug/obj/tuya_hal_network.o Debug/obj/tuya_hal_output.o Debug/obj/tuya_hal_semaphore.o Debug/obj/tuya_hal_system.o Debug/obj/tuya_hal_thread.o Debug/obj/tuya_hal_bt.o Debug/obj/tuya_hal_rtc.o Debug/obj/tuya_hal_storge.o Debug/obj/tuya_hal_wifi.o Debug/obj/boot_handlers.o Debug/obj/boot_vectors.o Debug/obj/croutine.o Debug/obj/event_groups.o Debug/obj/list.o Debug/obj/port.o Debug/obj/heap_4.o Debug/obj/queue.o Debug/obj/tasks.o Debug/obj/timers.o Debug/obj/rtos_pub.o Debug/obj/drv_ir.o -L./beken378/lib/ -lrwnx -L./beken378/lib/ -lble -lstdc++ -T./beken378/build/bk7231_ota.ld
    ../toolchain/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-nm ../../../apps/OpenBK7231T_App/output/7700a694/OpenBK7231T_App_7700a694.axf | sort > ../../../apps/OpenBK7231T_App/output/7700a694/OpenBK7231T_App_7700a694.map
    ../toolchain/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-objdump -d ../../../apps/OpenBK7231T_App/output/7700a694/OpenBK7231T_App_7700a694.axf > ../../../apps/OpenBK7231T_App/output/7700a694/OpenBK7231T_App_7700a694.asm
    ../toolchain/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-objcopy -O binary ../../../apps/OpenBK7231T_App/output/7700a694/OpenBK7231T_App_7700a694.axf ../../../apps/OpenBK7231T_App/output/7700a694/OpenBK7231T_App_7700a694.bin
    make[2]: Opuszczenie katalogu '/home/rupert/Pobrane/wb3s/OpenBK7231T/platforms/bk7231t/bk7231t_os'
    make[1]: Opuszczenie katalogu '/home/rupert/Pobrane/wb3s/OpenBK7231T/platforms/bk7231t/bk7231t_os'
    Start Combined
    make: *** [Makefile:6: all] Błąd 128
    


    Python 3.10.6

    any clues?
  • p.kaczmarek2
    Moderator Smart Home
    @rupertst it look like you don't have latest App or latest SDK repository. We had replaced sprintf with a lightweight counterpart recently and you may have one of repositories outdated.

    Can you double-check if they are up to date?

    @ferbulous OnRelease can be used just like OnClick, etc,
  • rupertst
    Level 6  
    Cloned second time:
    git clone --recursive https://github.com/openshwprojects/OpenBK7231T

    and
    git clone https://github.com/openshwprojects/OpenBK7231T_App.git

    then:
    sh build_app.sh apps/template_demo template_demo 1.0.0

    or
    sh build_app.sh apps/OpenBK7231T_App/ OpenBK7231T_App

    same errors :-(((
  • p.kaczmarek2
    Moderator Smart Home
    Are you putting the App repository inside the correct directory?
    You need paths like:
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    Also, why don't use the b.sh? It's a build script. Content of b.sh:
    
    ./build_app.sh apps/OpenBK7231T_App OpenBK7231T_App 1.0.0
    
  • rupertst
    Level 6  
    I think so.
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    Script b.sh is nice (I didn,t know), but it changes anything.

    Added after 12 [minutes]:

    Solved.
    It succeed on other machine with Ubuntu 20.04. So it's the compiler problem after upgrade.
  • Dark Man
    Level 12  
    It's great, and it would be great if you added the following options to the firmware (good wishes):
    - generating to HA entities containing:
    ==> MAC address of the Wifi access point
    ==> signal strength to access point as a percentage
    ==> received IP address (this is what I care about the most, because often after firmware upgrade, the device receives a different IP address from DHCP)
    - for CCT bulbs, generate and preferably send the configuration to HA (Discovery) as one bulb, not two separate channels (currently this is only generated for RGBCW bulbs)
    - add the blink option for relays and led_enableAll with commands like in Tasmota: blinkcount, blinktime and of course the ability to make the MQTT blink with the command (useful for e.g. informing about open windows by turning red and blinking for 10 seconds :) ). Proposes a run command: led_enableAll 3 (a bit like Tasmot: Power1 3)
    - added support for lighting control via the DDP protocol http://www.3waylabs.com/ddp/#Packet%20Format (used by WLED and Tasmot custom builds, to get quick lighting effects from multiple connected devices - see https: // cloudfree.shop/blog/2022/02/17/pair-tasmota-with-wled-for-lighting-effects/)

    As for the problem described in Issue # 408, I still have color skipping and dimming brightness after each color change from the HA level.
  • p.kaczmarek2
    Moderator Smart Home
    Thanks, but in order.

    DDP is now:
    Dark Man wrote:

    - adding support for lighting control using the DDP protocol http://www.3waylabs.com/ddp/#Packet%20Format

    You just turn on the DDP driver and it listens to those packets for RGB. In its simplest form.

    Dark Man wrote:

    ==> signal strength to access point as a percentage
    ==> received IP address (this is what I care about the most, because often after firmware upgrade, the device receives a different IP address from DHCP)

    These things are not generated to the HA but are published after the MQTT.
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    I am constantly developing documentation ...



    Dark Man wrote:

    - add the blink option for relays and led_enableAll with commands like in Tasmota: blinkcount, blinktime and of course the ability to make the MQTT blink with the command (useful for e.g. informing about open windows by turning red and blinking for 10 seconds :) ). Proposes a run command: led_enableAll 3 (a bit like Tasmot: Power1 3)

    I will consider it, although our scripting language already allows you to do this and the command "setRepeatingEvent" and so on.
    And what does the Power1 3 do exactly?


    Dark Man wrote:

    As for the problem described in Issue # 408, I still have color skipping and dimming brightness after each color change from the HA level.

    Let me guess - SM2135? This RGBCW driver with pseudo-I2C do you have?
    Although, you probably mean something else.
    Like so, as soon as you confirm that SM2135 will give the release fix and I will ask you to check if it changes anything.
    Oh no, the fix - that's different - you have to do an update and then Discovery over HA again.




    As for HA and Auto Discovery integration - I recommend you call @iprak
  • Dark Man
    Level 12  
    p.kaczmarek2 wrote:
    DDP is now:
    Dark Man wrote:
    - adding support for lighting control using the DDP protocol http://www.3waylabs.com/ddp/#Packet%20Format

    You just turn on the DDP driver and it listens to those packets for RGB. In its simplest form.

    Great, I looked in the documentation but I did not find it :)

    p.kaczmarek2 wrote:
    Dark Man wrote:
    - add the blink option for relays and led_enableAll with commands like in Tasmota: blinkcount, blinktime and of course the ability to make the MQTT blink with the command (useful for e.g. informing about open windows by turning red and blinking for 10 seconds). Proposes a run command: led_enableAll 3 (a bit like Tasmot: Power1 3)

    I will consider it, although our scripting language already allows you to do this and the command "setRepeatingEvent" and so on.
    And what does the Power1 3 do exactly?

    Power1 3 - turns on the light / relay No. 1 in the blinking mode for a given number of blinks with the previously set "blinkcount" command, where the light / off time (time intervals) was previously set with the "blinktime" command.

    When set to "blinkcount 0" the blink will go on indefinitely, unless a normal ON (Power1 1) or OFF (Power1 0) command is sent which will abort it.
    p.kaczmarek2 wrote:
    Dark Man wrote:
    As for the problem described in Issue # 408, I still have color skipping and dimming brightness after each color change from the HA level.

    Let me guess - SM2135? This RGBCW driver with pseudo-I2C do you have?
    Although, you probably mean something else.
    Like so, as soon as you confirm that SM2135 will give the release fix and I will ask you to check if it changes anything.
    Oh no, the fix - that's different - you have to do an update and then Discovery over HA again.

    Well, I do not have an additional controller - PWM is flying directly.
    And yes, it was enough to erase the device from HA and send Discovery again - it solved the problem. THX

    @iprak please add Home Assistant Discovery for another diagnostics entities: IP adsress, RSSI, MAC adress of AP Station
  • p.kaczmarek2
    Moderator Smart Home
    Okay, now I am supplementing the readme with these missing publications, indeed, a fatal oversight. I have to ask the rest of the team to complete the readme as it adds something.

    In general, we have also recently had an OBK port for the platform ...
    Spoiler:

    Windows

    Quite seriously, even LittleFS works with it. You will be able to test scripts on it and "try out" OBK at the beginning. Only MQTT is missing at the moment.
  • ferbulous
    Level 15  
    @p.kaczmarek2
    I'm using this custom rules on tasmota that changes the color temperature with double press action (button 1 state 11) with variable (Var1)

    rule2 on system#boot do Var1 0 endon
    on Button1#State=11 do add1 1 endon
    on Var1#State>=2 do Var1 0 endon  
    
    rule1 on Var1#State==0 do devgroupsend 7=13 endon  #warm white
    on Var1#State==1 do devgroupsend 7=12 endon #cold white
    

    Any example I could implement the same in OBK scripts especially with the variable?

    --edit--
    would this work?
    setChannel 10 0
    addEventHandler OnDblClick 8 addChannel 10 1
    addChangeHandler Channel10 == 2 setChannel 10 0
    addChangeHandler Channel10 == 0 DGR_SendRGBCW 255 255 255
    addChangeHandler Channel10 == 1 DGR_SendRGBCW 253 244 220
  • kbechler
    Level 10  
    Hi,

    I have a Gosund SP1-C socket that I would like to flash with OpenBeken. But something is not going well for me.
    Inside is the WM013_V02 module, which is theoretically BK7231T. I connected the power supply to the 3.3V line and ground. I soldered TX, RX, GND directly to the WiFi module and connected these three to the USBTTL converter. picocom (baudrate 115200) spits out some information
    [bl] start
    [Flash chip ALT]  !!this chip is not in my support chip list, using default flash chip now!!
    [Flash DRV INF]  mode: 0x4, freq: 48000000Hz, drv: 0
    [bl] img seq 0, state 1
    [bl] goto 0x10101===============================================
    SP1-C  Jan  4 2021 19:46:51
    Foneric IoT WLAN SDK 1.3.1
    [Flash DRV INF]  mode: 0x20, freq: 48000000Hz, drv: 0
    earlyLoadAccessoryState

    but unfortunately I can't upload the firmware:

    # python3 ./uartprogram -d /dev/ttyUSB0 ./OpenBK7231T_UA_1.15.35.bin -w 
    UartDownloader....
    programm....
    Cannot get bus. : |                                                  |[    ?k/s]
    #
    


    Could you please give me a hint what am I doing wrong?
  • p.kaczmarek2
    Moderator Smart Home
    @kbechler I don't know the WM013_V02 module and the content of the log does not remind me of the logs from the SDKs I know.

    Are you able to remove the screen (plate) from this module to confirm that the BK7231T is definitely there?