pvvx / THB2

Custom firmware for Tuya devices on the PHY622x2 chipset
Other
230 stars 19 forks source link

rdwr_phy62x2.py error still showing #69

Closed gitterman closed 1 month ago

gitterman commented 1 month ago

I still get the error from issue #40 which is unfortunately closed without giving a solution. I tried with pyton 3.11 and 3.12 on windows and both resulted in the same error

python --version Python 3.12.7

python3 rdwr_phy62x2.py -p COM6 -e -r wh BOOT_THB1_v17.hex
=========================================================
PHY62x2 Utility version 11.03.24
---------------------------------------------------------
Connecting...
PHY62x2 - Reset Ok
Revision: b'001364c8 6222M005'
FlashID: 1364c8, size: 512 kbytes
PHY62x2 - connected Ok
Traceback (most recent call last):
  File "D:\Peter\Development\Tuya\THB2-master\rdwr_phy62x2.py", line 738, in <module>
    main()
  File "D:\Peter\Development\Tuya\THB2-master\rdwr_phy62x2.py", line 663, in main
    hp = ParseHexFile(args.filename)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Peter\Development\Tuya\THB2-master\rdwr_phy62x2.py", line 56, in ParseHexFile
    taddr = (int(hexstr[3:7],16))
             ^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 16: ''
pvvx commented 1 month ago

Python has nothing to do with it. Check the file BOOT_THB1_v17.hex

Tested:

C:\>C:\Python310\python.exe --version
Python 3.10.8
C:\>C:\Python312\python.exe --version
Python 3.12.3
C:\>C:\Python313\python.exe --version
Python 3.13.0 
gitterman commented 1 month ago

Oops. Thanks for pointing me to that. Indeed, I had downloaded the html page instead of the hex file. Sorry for bothering you.