tuya-cloudcutter / bk7231tools

This is a collection of tools to interact with and analyze artifacts for BK7231 MCUs
MIT License
40 stars 6 forks source link

Trying to extract dump from Tuya CBU Temp&Humidity sensor #10

Closed Liionboy closed 1 year ago

Liionboy commented 1 year ago

Hello,

I am trying to exatrct dump via UART but i got this error:

root@adrian-huawei-d16:~# bk7231tools read_flash -d /dev/ttyUSB0 temp_tuya_dump.bin Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/bk7231tools/main.py", line 468, in cli with closing(connect_device(args.device, args.baudrate, args.timeout, args.debug)) as device: File "/usr/local/lib/python3.10/dist-packages/bk7231tools/main.py", line 270, in connect_device s.connect() File "/usr/local/lib/python3.10/dist-packages/bk7231tools/serial/init.py", line 39, in connect raise TimeoutError("Timed out attempting to link with chip") TimeoutError: Timed out attempting to link with chip

adrian@adrian-huawei-d16:~/tuya-cloudcutter$ bk7231tools read_flash -d /dev/ttyUSB0 -s 0 -l 0x200000 dump.bin Traceback (most recent call last): File "/home/adrian/.local/lib/python3.10/site-packages/bk7231tools/main.py", line 468, in cli with closing(connect_device(args.device, args.baudrate, args.timeout, args.debug)) as device: File "/home/adrian/.local/lib/python3.10/site-packages/bk7231tools/main.py", line 270, in connect_device s.connect() File "/home/adrian/.local/lib/python3.10/site-packages/bk7231tools/serial/init.py", line 39, in connect raise TimeoutError("Timed out attempting to link with chip") TimeoutError: Timed out attempting to link with chip

Need to put device in flash mode?

This is the device: https://www.aliexpress.com/item/1005004857160939.html?spm=a2g0o.order_list.order_list_main.49.5c461802voyAJ0 with Wi-fi not zigbee

blakadder commented 1 year ago

It either isn't in flash mode (reset once read flash command is issued) or the wiring is wrong

Liionboy commented 1 year ago

Wiring is tx at rx1 and rx is at tx1 from sensor. I will try again today but i think is same problem

Liionboy commented 1 year ago

If i remember to put in flash mode need to know GPIO 0?

blakadder commented 1 year ago

that is for some ESP chips, for Beken it is https://docs.libretuya.ml/docs/platform/beken-72xx/flashing/

Liionboy commented 1 year ago

my bad, i forget this: You have 10 seconds to reset the chip (pull CEN to GND, or power-cycle the board) after running the command. The program will then begin dumping.