pvvx / THB2

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

TH05Y_v3.1 with TH05_V1.4 screen - TEMPERATURE/HUMIDITY not working #84

Open Pinni3 opened 2 days ago

Pinni3 commented 2 days ago

Flashed the unit(s) did try the firmwares BOOT_TH05_vNN.hex And BOOT_TH05F_vNN.hex Is a TH05_V1.4 screen with the marking TH05Y_v3.1 on pcb , chipset is QD01 2340 NT CJT 3353C After OTA No screen nor TEMP or humidity info , battery is displayed image image

BOOT_TH05F_v18.hex is running atm but still no data for temp and humidity image image

Is there a new firmware needed or coud this be adjusted with actions from my side?

pvvx commented 2 days ago

Is a TH05_V1.4 screen with the marking TH05Y_v3.1 on pcb

Perhaps this is a new version of the printed circuit board and the sensor layout is done on other Soc pins. https://github.com/pvvx/THB2?tab=readme-ov-file#internal-gpio-pinout

TH05F (marking psb TH05Y_V1.1/V1.2) has CHT8305 sensors. The program uses the AHT2x type if the sensor type is not recognized. Due to the fact that AHT2x does not have ID recognition functions.

Pinni3 commented 2 days ago

How can i help in getting this on track ? Pictures , measurements or original firmware extract ?

Pinni3 commented 2 days ago

As seen in the PCB picture it is a AHT20 sensor (if you can go off the markings) IMG_4259 IMG_4258

pvvx commented 2 days ago

PCB layout is different from TH05Y_v1.1/v1.2


How can i help in getting this on track ?

What markings are on the sensor itself?

(In terms of case, it looks more like SHT4x. Not AHT20, 21, 25, 30...)

tomasz-kos commented 2 days ago

Hi, I have the same device - with the same behaviour after reprogramming. On my device temperature sensor is CHT8320 (marking ML). From datasheet I got that it uses 0x88 I2C address which after short checking isn't use in that code. As I have few of these devices I will try to log I2C communication on not reprogrammed device. Sensor is in 4 pin case and it also doesn't have alarm pin

Pinni3 commented 2 days ago

i have good eyes but can't capture this with a camera So here you go this is the markings center dot is the sensor Afbeelding van WhatsApp op 2024-11-20 om 15 32 10_618c1530

pvvx commented 2 days ago
Sensylink Order PN Address Accuracy Green1 Package Marking ID2 Packing MPQ Operation Temperature
CHT8320ADNR 0x88 ±0.1℃±2.0%RH Halogen free DFN2X2-4 ML YWXA Tape & Reel 3,000 -40℃~+125℃

https://en.sensylink.com/html/web/product/wsdcgq/cwsdcgq/1694267611119996930.html

Datasheet does not describe how to work with it via I2C. https://en.sensylink.com/upload/1/net.sensylink.portal/1717568489156.pdf

The address on the I2C bus has only 7 bits. 0x88 cannot be. This is another Chinese error - the real address is most likely 0x44.

tomasz-kos commented 2 days ago

Do you have access to advanced datasheet for that sensor? On Sensylink datasheet for CHT8310 is also very short but you got advanced version.

pvvx commented 2 days ago

Extended description of CHT8310 found by internet search (google).

Pinni3 commented 2 days ago

If you need testing or firmware extract just let me know. i have 10 of these. 2already flashed and easy ota changes possible.

pvvx commented 2 days ago

Right now Google only finds these descriptions: CHT8310 Advanced Datasheet Ver1.1 20230927.pdf CHT8315 Advanced Datasheet Ver1.6 20230927.pdf CHT8305C Advanced Datasheet Ver2.5 2021-10-26.pdf

(https://www.elektroda.com/rtvforum/viewtopic.php?p=21106861#21106861)

Copied to github...

Pinni3 commented 2 days ago

Right now Google only finds these descriptions: CHT8310 Advanced Datasheet Ver1.1 20230927.pdf CHT8315 Advanced Datasheet Ver1.6 20230927.pdf CHT8305C Advanced Datasheet Ver2.5 2021-10-26.pdf

(https://www.elektroda.com/rtvforum/viewtopic.php?p=21106861#21106861)

Copied to github...

I see but none of them is the same shape as the one used in the model i have picture of. Shape is the same as in the non advanced pdf image

pvvx commented 2 days ago

I see but none of them is the same shape as the one used in the model i have picture of. Shape is the same as in the non advanced pdf

To work with CHT8320 (mark "ML"), you need a description of the I2C protocol and coefficients for calculating temperature and humidity. But they are not in the shortened datasheet from the Sensylink website.

Pinni3 commented 2 days ago

I have checked on wechat, no extra documentation contact was only mail even via wechat. I did send them (support) a mail, hoping on a reply from them.

pvvx commented 2 days ago

Test firmware

TH05F_v19t.zip

Sensor ID unknown. Run Service->Command with parameter "05" and publish the response from the log.

Pinni3 commented 2 days ago

This is with the Normal boot (APP19) and Testfirmware -> v19T

18:12:25: Command response (05): 0000aaaa38

pvvx commented 2 days ago

TH05F_v19t2.zip

Pinni3 commented 2 days ago

18:39:50: Command response (05): ffffffff44 Also => Humidity is now 99% Afbeelding van WhatsApp op 2024-11-20 om 18 41 10_994c5dcf

Pinni3 commented 2 days ago

TH05F_v19t2.bin : image image image

pvvx commented 2 days ago

This means that control options similar to CHT8305..8315 are not suitable for this sensor. Doesn't even give the standard Manufacturer ID Sensylink (0x5959) Documentation is needed...

Pinni3 commented 2 days ago

i hope i will get some feedback by mail or somewhere else.

Pinni3 commented 1 day ago

[divadiow] from the Elektroda forum is also asking from his side. Lets hope on some quick emails with the advanced info in PDF

tomasz-kos commented 1 day ago

If that helps, I2C communication with official software and monitor by phone (from power on and next 7 measurement every few seconds: write to 0x44 ack data: 0x37 0x81 read to 0x44 ack data: 0x59 0x59 0x53 write to 0x44 ack data: 0x24 0x00 read to 0x44 ack data: 0x64 0x69 0x64 0x76 0x0E 0xFF write to 0x44 ack data: 0x24 0x00 read to 0x44 ack data: 0x64 0x34 0x56 0x77 0x5C 0x17 write to 0x44 ack data: 0x24 0x00 read to 0x44 ack data: 0x63 0xF7 0xEC 0x78 0x2D 0x47 write to 0x44 ack data: 0x24 0x00 read to 0x44 ack data: 0x63 0xDC 0x80 0x78 0x21 0x3A write to 0x44 ack data: 0x24 0x00 read to 0x44 ack data: 0x64 0xFE 0xCA 0x79 0xF7 0x6C write to 0x44 ack data: 0x24 0x00 read to 0x44 ack data: 0x6A 0xF8 0x01 0xCC 0x85 0x10 write to 0x44 ack data: 0x24 0x00 read to 0x44 ack data: 0x66 0x97 0x20 0x93 0x70 0x19

Measurement shown on phone: 23.6 46 23.5 46 23.3 46 23.2 46 24 47 28.1 79 25.1 57

Pinni3 commented 1 day ago

CHT832X Advanced  Datasheet Ver1_NO-watermark.pdf

Hope this contains the info you need.

pvvx commented 18 hours ago

TH05F_v19t3.zip

Pinni3 commented 11 hours ago

Think wrong IC2 adress ? image

image and if needed the 05 service responce image

pvvx commented 10 hours ago

I don't have a TH05Y v3.1 thermometer and I don't have the ability to check the firmware for all sensor variants. There are already 4 sensor types to service, plus subtypes... Polling different types during initialization can cause some sensors to fail... It is necessary to select the polling sequence by types during initialization, etc.

I'll try to make another version later...

Pinni3 commented 10 hours ago

I understand the situation. If i knew where to start and modify i would certainly help. But i am clueless atm.

Just for identification purposes and other people (to be temporary warned) they came from this shop: RightSitu Official Store This item

If you need any help testing, etc just let me know ;-)

Pinni3 commented 10 hours ago

Is the IC2 adress defined in the firmware ? as it jumped from 0x44 (where it had 'something' )to 0x38 (where it has ''nothing')

before on the 0x44 image image image

On the 0x38 image image image

pvvx commented 9 hours ago

Apparently, the sensor did not respond to the MID query command, since other types were polled before and this confused it... On the existing TH05Y v1.1 with the CHT8305 sensor, the "t3" firmware file works.

pvvx commented 8 hours ago

TH05F_v19t4.zip

Pinni3 commented 8 hours ago

i think we have a winner! 10:21:54: Commandoreactie (05): 5959832044 image image image

Pinni3 commented 8 hours ago

So sensor is working, now just letting it sit next to original FW that came straight out of the packaging. Waiting to see if there is a big difference. Will let them sit for 1 hour or so and check back in. Afbeelding van WhatsApp op 2024-11-22 om 10 29 41_4329d5b3

Pinni3 commented 7 hours ago

After 1 hour temps settled in and i can say it looks good! Afbeelding van WhatsApp op 2024-11-22 om 11 33 16_426cfd99

Any more changes needed ? because it is working fine now. Thank you for the help!

pvvx commented 6 hours ago

It is necessary to measure average and peak consumption. Mainly duration of activity and what the sensor consumes - what contributes to the total consumption. The documentation does not clearly describe when the CHT832x sensor goes into sleep mode. It is advisable to do all measurements using PowerProfiler, not a tester... That is, a professional approach to measurement is needed...

pvvx commented 5 hours ago

Version 2.0(beta) published. @Pinni3 - There are no changes from "TH05F_v19t4.bin".

tomasz-kos commented 3 hours ago

Hi, I measured current with power profiler:

I noticed 2 things:

pvvx commented 41 minutes ago

in normal mode BT transmission is every 5s (ok) but I2C communication is also every 5s once make conversion once read value, but in connected mode I2C is only every 10s - I assume that is expected behaviour

The measurement interval is set in BLE advertising periods. The minimum quantity is 2. Before the last advertising period, the sensor starts measuring - a measurement command is transmitted. In the next SoC activity cycle (after last advertising period) measurements are read from the sensor.


max for BT transmision about 22mA

If this is PowerProfiler II from nRF, then these are emissions from the range switch of the measurement circuit. In reality, there are peaks of about 8 mA (RF TX +0 dBm). These nRF glitches do not significantly affect the average measurement. But they distort the current picture. image image