openshwprojects / OpenBK7231T_App

Open source firmware (Tasmota/Esphome replacement) for BK7231T, BK7231N, BL2028N, T34, XR809, W800/W801, W600/W601, BL602 and LN882H
https://openbekeniot.github.io/webapp/devicesList.html
1.47k stars 274 forks source link

suport for #215

Open sstudent opened 2 years ago

sstudent commented 2 years ago

Very good job! Could I please you to add support for Tuya Curtain Smart Switch with WB3S chip. Below I put pictures of the device. 20220926_202556 20220926_202655 20220926_202728 20220926_202737 20220926_202748 Thank you

DSchndr commented 2 years ago

Do you have a logic analyzer / serial adapter? Hook up rx from dongle to rx and later tx pad (gnd and vcc too) and monitor what ofw sends and receives (DO NOT CONNECT THE MAINS PART)

Product link would be nice :)

sstudent commented 2 years ago

In the attached I send you logs from logic progam (Logic analyzer), and from logs from serial loging. Here is the link to the product: https://pl.aliexpress.com/item/1005001936724990.html?spm=a2g0o.order_list.0.0.21ef1c24JLr7hK&gatewayAdapt=glo2pol rx2_tx2.log logs.zip Thanks for your interest.

DSchndr commented 2 years ago

Pardon, did you use the rx/tx near the microcontroller (which I assumed are uart1) or did you solder to uart2 (log) on the module?

There should be data similar to this: https://tasmota.github.io/docs/TuyaMCU/#tuya-protocols

sstudent commented 2 years ago

Here is the answer on uart1 loged on realterm: 00 11 FF FF FF And after push the batons: 00 11 FF FF FF CC 04 07 CC 04 0F CC 02 0B CC 02 0F CC 01 0D CC 01 0F CC 02 0B CC 02 0F CC 01 0D CC 01 0F In the attached I send you logs from logic progam (Logic analyzer)

0XFF.zip

sstudent commented 2 years ago

Was it about these logs? Will it be possible to implement OpenBK on this device?

DSchndr commented 2 years ago

Probably, the logic analyzer logs seem to be empty, could you hook it up and save them in multiple files like "button up" You have to do something when you log them

sstudent commented 2 years ago

Here you have all logs logs.zip

DSchndr commented 2 years ago

Sorry, since uni started I don't have a lot of time

Doesn't seem to be tuyamcu protocol, but seems to be something simple to implement, uart seems to run at 115200 baud

0x11 0xff 0xff 0xff -> Keepalive from mcu? 0xCC (static) 0x?? (button) 0x?? (state)

Do you have logs from changing states from the tuya app too?

sstudent commented 2 years ago

Here you have logs when I switch off and on the curtain from the smartlife app. Is sims to be empty. logs_smartlife.zip

DSchndr commented 2 years ago

Wierd, have you connected both UART lines to the Logic Analyzer?

sstudent commented 2 years ago

Only tx. Rx should be also conected?

DSchndr commented 2 years ago

Yes, since you need both the data that gets sent as well as received (on both sides)

sstudent commented 2 years ago

Nothing there on both Tx or Rx, when I turn on the curtain from smartlife app (everything works). Only when I push physically the button logs are ok. Can you make software for tests?

DSchndr commented 2 years ago

Need device to reverse engineer how it works and test, sorry

Cant do anything since I have no plan on how that thing works. You could try to find out how the wifi module is connected to the rest and document it though