pvvx / THB2

Custom firmware for Tuya devices on the PHY622x2 chipset
Other
92 stars 13 forks source link

THB2, I can't program. Error read Revision! #21

Closed artur1702 closed 4 months ago

artur1702 commented 4 months ago

Hi, As in Title. Linux operating system. THB2 flashes once blue led, but ends with the error shown below and cannot be programmed.

python3 rdwr_phy62x2.py -p /dev/ttyUSB1 -e -r wh BOOT_THB2_v14.hex

PHY62x2 Utility version 25.01.24

Connecting... PHY62x2 - Reset Ok Error read Revision!

What can I do?

pvvx commented 4 months ago
Adapter Device
GND -Vbat
+3.3В +Vbat
TX RX1
RX TX1
RTS RESET
artur1702 commented 4 months ago

This is exactly how it is connected. If I replace any of the cables, the error is different. Connecting... PHY62x2 - Error Reset! Check connection TX->RX, RX<-TX and Chip Power!

Could this programmer be a problem? ESP32 programs without problems. Unfortunately I don't have anything else to try.

IMG_20240226_115846776 jpg_compressed

pvvx commented 4 months ago

RTS->RESET connected?

artur1702 commented 4 months ago

Yes, connected. Without it, error as above. The blue LED will flash once when the program starts.

pvvx commented 4 months ago

What operating system do you have? In Linux, character reception delays in USB-UART and much more do not work normally. Try increasing self._port.timeout https://github.com/pvvx/THB2/blob/master/rdwr_phy62x2.py#L227

artur1702 commented 4 months ago

Yes, I have been using only Linux for many years. I'll try to find a laptop with Windows and give it a try. Thank you for the tip.

artur1702 commented 4 months ago

You were right. It works without any problems under Windows. Thanks!

pvvx commented 4 months ago

Yes, I have been using only Linux for many years.

Linux hasn't been updated to new hardware standards in ten years. Including SSD and CPU. As a result, it is outdated and can only be used with outdated equipment, and even then not with all... Bluetooth 5.0 does not exist in Linux and does not work, like many other things.

1500WK1500 commented 3 months ago

I had the same issue under linux. The problem was that RTS was toggled shortly when the serial connection gets closed and reopen again. I could fix it by removing the two lines which closed and reopen the serial connection for the baud rate change. self._port.close() and self._port.open() https://github.com/pvvx/THB2/blob/52e87b987b2f3fe7a5cc2916081ba5ae1b605b56/rdwr_phy62x2.py#L246C1-L248C21

As far as I know there is no need for closing the connection before changing the baud rate in pyserial.