Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamp.kaczmarek2 wrote:Hello, I will try to help you, but in those cases, can you provide some basic diagnostic information?
1. Do you get OpenBeken access point visible and if so, have you managed to configure your WiFi SSID and pass?
2. If not, have you tried connecting UART RX to TX2 (log output; TX1 is programming; TX2 is log), what does the log say?
3. Can you show us the screenshot from programming tool to confirm that it did flash correctly? Did you use a correct bin file for your platform? For T, you flash UA at default offset. For N, you flash QIO at 0.
p.kaczmarek2 wrote:TX2 is good. You have to connect RX of USB to UART dongle to TX2 to receive log. Use any app for UART communication, RealTerm can work, Putty can work as well. Remember to set 115200 baud rate
anderson007104 wrote:p.kaczmarek2 wrote:TX2 is good. You have to connect RX of USB to UART dongle to TX2 to receive log. Use any app for UART communication, RealTerm can work, Putty can work as well. Remember to set 115200 baud rate
The log repeats this message infinitely
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2022.10.28 21:56:27 =~=~=~=~=~=~=~=~=~=~=~=
)��gu�%cH
J)wn
�H
�����v1.1
[32;22m[I/FAL] Fal(V0.4.0)success[0m
[36;22m[I/OTA] RT-Thread OTA package(V0.2.4) initialize success.[0m
v1.1
[32;22m[I/FAL] Fal(V0.4.0)success[0m
[36;22m[I/OTA] RT-Thread OTA package(V0.2.4) initialize success.[0m
v1.1
[32;22m[I/FAL] Fal(V0.4.0)success[0m
[36;22m[I/OTA] RT-Thread OTA package(V0.2.4) initialize success.[0m
v1.1
[32;22m[I/FAL] Fal(V0.4.0)success[0m
[36;22m[I/OTA] RT-Thread OTA package(V0.2.4) initialize success.[0m
v1.1
[32;22m[I/FAL] Fal(V0.4.0)success[0m
[36;22m[I/OTA] RT-Thread OTA package(V0.2.4) initialize success.[0m
v1.1
[32;22m[I/FAL] Fal(V0.4.0)success[0m
[36;22m[I/OTA] RT-Thread OTA package(V0.2.4) initialize success.[0m
v1.1
[32;22m[I/FAL] Fal(V0.4.0)success[0m
[36;22m[I/OTA] RT-Thread OTA package(V0.2.4) initialize success.[0m
v1.1
[32;22m[I/FAL] Fal(V0.4.0)success[0m
[36;22m[I/OTA] RT-Thread OTA package(V0.2.4) initialize success.[0m
p.kaczmarek2 wrote:It looks like it may be using a different variation of BK chip. What was the original firmware printing?
anderson007104 wrote:p.kaczmarek2 wrote:It looks like it may be using a different variation of BK chip. What was the original firmware printing?
This is the original firmware log
12:14:58.749 -> [36;22m[I/OTA] RT-Thread OTA package(V0.2.4) initialize success.[0m
12:14:58.749 -> [01-01 18:12:15 TUYA Info][lr:0x998a5] mqc app init ...
12:14:58.749 -> [01-01 18:12:15 TUYA Info][lr:0xa297f] thread_create name:sys_timer,stackDepth:4096,totalstackDepth:4096,priority:5
12:14:58.796 -> [01-01 18:12:15 TUYA Info][lr:0xa297f] thread_create name:cmmod,stackDepth:4096,totalstackDepth:8192,priority:4
12:14:58.796 -> [01-01 18:12:15 TUYA Debug][lr:0x99853] mq_pro:5 cnt:1
12:14:58.796 -> [01-01 18:12:15 TUYA Debug][lr:0x99853] mq_pro:31 cnt:2
12:14:58.796 -> [01-01 18:12:15 TUYA Debug][lr:0xa280b] Thread:sys_timer Exec Start. Set to Running Stat
12:14:58.796 -> [01-01 18:12:15 TUYA Err][lr:0x95373] logseq empty
12:14:58.796 -> [01-01 18:12:15 TUYA Debug][lr:0xa22ef] svc online log init success
12:14:58.796 -> [01-01 18:12:15 TUYA Info][lr:0xa297f] thread_create name:wk_th-0,stackDepth:5120,totalstackDepth:13312,priority:3
12:14:58.796 -> [01-01 18:12:15 TUYA Notice][lr:0x749dc] < TUYA IOT SDK V:2.3.1 BS:40.00_PT:2.2_LAN:3.3_CAD:1.0.3_CD:1.0.0 >
12:14:58.843 -> < BUILD AT:2021_09_26_11_33_20 BY embed FOR ty_iot_sdk_bk7231 AT bk7231 >
12:14:58.843 -> IOT DEFS < WIFI_GW:1 DEBUG:1 KV_FILE:0 SHUTDOWN_MODE:0 LITTLE_END:1 T[01-01 18:12:15 TUYA Notice][lr:0x749ec] oem_bk7321_bk_1_switch:1.1.3
12:14:58.843 -> [01-01 18:12:15 TUYA Notice][lr:0x749fc] compile at:Nov 9 2021 14:22:42
12:14:58.843 -> [PLATFORM NOTICE]bk_rst:0 <only support TY_RST_POWER_OFF>[01-01 18:12:15 TUYA Notice][lr:0x74a18] ---> rst reason:0
12:14:58.843 -> [01-01 18:12:15 TUYA Notice][lr:0x73670] read uf buf {"fsw_cnt_key":0}
12:14:58.890 -> [01-01 18:12:15 TUYA Notice][lr:0x74a3c] rst_cnt:[1]
12:14:59.077 -> [01-01 18:12:15 TUYA Notice][lr:0x72ab4] IO - wifi_stat: pin-7 type low
12:14:59.124 -> [01-01 18:12:15 TUYA Notice][lr:0x72b48] IO - relay[0]: pin-18 type high
12:14:59.124 -> [01-01 18:12:15 TUYA Notice][lr:0x72b70] IO - button[0]: pin-6 type low
12:14:59.124 -> [01-01 18:12:15 TUYA Notice][lr:0x72c5c] CH[0], DPID[1]
12:14:59.124 -> [01-01 18:12:15 TUYA Notice][lr:0x72c74] CH[0], CDDPID[102]
12:14:59.124 -> [01-01 18:12:15 TUYA Notice][lr:0x72c84] CH[0], RSDPID[101]
12:14:59.124 -> [01-01 18:12:15 TUYA Err][lr:0xbd26d] uf_open default_stat_save err 8
12:14:59.124 -> [01-01 18:12:15 TUYA Err][lr:0x74b6c] cannot open file
12:14:59.124 -> [01-01 18:12:15 TUYA Notice][lr:0x74c24] fast read def mode error
12:14:59.124 -> [01-01 18:12:15 TUYA Notice][lr:0x74bb0] relay_stat:1
12:14:59.170 -> [01-01 18:12:15 TUYA Notice][lr:0xb81f7] key_addr: 0x1eb000 block_sz 4096
12:14:59.170 -> [01-01 18:12:15 TUYA Notice][lr:0xb82cb] get key:
12:14:59.170 -> 0xcb 0x4e 0x3e 0xa4 0x0 0x30 0x9d 0xab 0x65 0x6d 0x8d 0xbf 0xe4 0xb9 0x3f 0x35
12:14:59.358 -> temp in flash is:302
12:14:59.358 -> Initializing TCP/IP stack
12:14:59.826 -> [01-01 18:12:16 TUYA Notice][lr:0x71fdc] mf_init succ
12:14:59.826 -> [01-01 18:12:16 TUYA Notice][lr:0x73670] read uf buf {"fsw_cnt_key":1}
12:14:59.826 -> [01-01 18:12:16 TUYA Notice][lr:0x7207c] current product ssid name:tuya_mdev_test1
12:14:59.826 -> scan_start_req_handler
12:15:02.166 -> [PLATFORM ERROR]tuya_os_adapt_wifi_assign_ap_scan [tuya_mdev_test1] error
12:15:02.166 -> [PLATFORM NOTICE]bk_rst:0 <only support TY_RST_POWER_OFF>[01-01 18:12:18 TUYA Notice][lr:0x92903] Last reset reason: 0
12:15:02.166 -> [01-01 18:12:18 TUYA Notice][lr:0x92a71] serial_no:84e342040de8
12:15:02.166 -> [01-01 18:12:18 TUYA Notice][lr:0x92aa9] gw_cntl.gw_wsm.stat:1
12:15:02.166 -> [01-01 18:12:18 TUYA Notice][lr:0x92b37] gw_cntl.gw_wsm.nc_tp:0
12:15:02.166 -> [01-01 18:12:18 TUYA Notice][lr:0x92b3f] gw_cntl.gw_wsm.md:0
12:15:02.166 -> [01-01 18:12:18 TUYA Notice][lr:0x92d27] gw_cntl.gw_if.abi:0 input:0
12:15:02.212 -> [01-01 18:12:18 TUYA Notice][lr:0x92d33] gw_cntl.gw_if.product_key:keys83qyuhuqrdn7, input:keys83qyuhuqrdn7
12:15:02.212 -> [01-01 18:12:18 TUYA Notice][lr:0x92d3f] gw_cntl.gw_if.tp:0, input:0
12:15:02.212 -> [01-01 18:12:18 TUYA Notice][lr:0x92d4f] gw_cntl.gw_if.firmware_key:keys83qyuhuqrdn7, input:keys83qyuhuqrdn7
12:15:02.212 -> [01-01 18:12:18 TUYA Notice][lr:0x74508] device_init ok free_mem_size:56128
12:15:03.195 -> [01-01 18:12:19 TUYA Notice][lr:0x73c8c] get wf state:0
12:15:03.195 -> [01-01 18:12:19 TUYA Notice][lr:0x72f10] wifi_stat:0
12:15:04.084 -> [01-01 18:12:20 TUYA Notice][lr:0x7387c] clear onoff cnt!
btsimonh wrote:Read the bootloader from 0x0 - 0x11000, and drop zip here or in openbeken github issue,
It looks like a different bootloader from serial output.
Compare to another read from another device?
You can re-flash the bootloader - but maybe only from SPI?
btsimonh wrote:anderson007104 wrote:How do I read the bootloader?
I believe BKwriter can do this if you set the startaddr to 0, and len to 11000, and read flash.
But I always use hid_program ... so have not used bkwriter for ages.
btsimonh wrote:anderson007104 wrote:I did this and got an 11kb bin file
try again with 0x11000![]()
br,
Simon
btsimonh wrote:hmm.. that's not working too well for me. I tested decrypt of the SDK encrypted bootloader, and it matches the unencrypted one, so I know the encrypt command line is correct, yet the data in your dump seems garbage (after de-crc and decrypt).
I suspect as @p.kaczmarek2 said, you need to use hid_download_py (https://github.com/OpenBekenIOT/hid_download_py) with the appropriate options to read 0x0 - 0x11000.
If your then take the resulting file (no spaces in name please!) and run:
python uartprogram "yourname.bin" -p
this will un-crc your file (reduce each 34 bytes to 32 bytes).
BUT discard yourname.unpackage.cpr, yourname.unpackage.out, yourname.unpackage_enc.out - these have been unencrypted with wrong start address.
then use:
encrypt yourname.unpackage.bin 510fb093 a3cbeadc 5993a17e c7adeb03 0
to get un-encrypted executable data.
Then with a hex editor, examine yourname.unpackage_enc.bin you should find some readable text...
We'd expect the original encrypted file to have possible (unencrypted) partition data on the end.
Upon 'decryption' this will become encrypted....
If success, pls post both files here.
P.s. I can find all the text from your logs in the normal bootloader.
Once you have hid_program_py, please try the flashing procedure using that... maybe it just did not flash correctly...
Open a terminal/cmd.exe, create esphome directory and cd into it.
git clone https://github.com/libretiny-eu/libretiny-esphome
cd into the newly created libretiny-esphome directory.
Check if it works by typing python -m esphome
pip install -e . --break-system-packages
python -m esphome wizard yourdevice.yml
esphome:
name: test
bk72xx:
board: wa2
family: bk7231q
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "xxxxx"
ota:
password: "xxxxx"
wifi:
ssid: "xx"
password: "xxxxxx"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Test Fallback Hotspot"
password: "F0gJM6nfV6S9"
esphome:
name: test
bk72xx:
board: wa2
family: bk7231q
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "xxxxx"
ota:
password: "xxxxx"
wifi:
ssid: "xx"
password: "xxxxxx"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Test Fallback Hotspot"
password: "F0gJM6nfV6S9"
text_sensor:
- platform: libretiny
version:
name: LibreTiny Version
binary_sensor:
- platform: gpio
id: binary_switch_1
pin:
number: P6
inverted: true
mode: INPUT_PULLUP
on_press:
then:
- switch.toggle: switch_1
switch:
- platform: gpio
id: switch_1
name: Relay 1
pin: P18
status_led:
pin:
number: P8
inverted: true
/libretiny-esphome/.esphome/build/test/.pioenvs/test/
python -m esphome upload testdevice.yml
ValueError: Chip CRC value 6A339F12 does not match calculated CRC value 4A5A80CD