clach04 / python-tuya

Python interface to ESP8266MOD WiFi smart devices from Shenzhen Xenon. NOTE I'm not using any devices with this library so I can't test :-(
MIT License
239 stars 54 forks source link

Missing CRC32 #40

Open SynAckFin opened 6 years ago

SynAckFin commented 6 years ago

Thanks for this. I've been looking at the communications with my device and the suffix isn't "000000000000aa55". It is CRC32 + "0000aa55". The CRC32 is of everything before (prefix -> payload) and is stored as a big endian. The demo code still works with the CRC set to zero but they may decide in future (or with some devices) to reject anything with an incorrect CRC. My device is labelled TECKIN WiFi Smart Plug

clach04 commented 6 years ago

@SynAckFin that makes more sense than blank padding, good catch :-)

Have you tried sending CRC32 instead of blanks or is this based on seeing comms from other clients?

BillSobel commented 6 years ago

My client correctly sets the CRC....

On Mon, Nov 12, 2018 at 9:59 PM clach04 notifications@github.com wrote:

@SynAckFin https://github.com/SynAckFin that makes more sense than blank padding, good catch :-)

Have you tried sending CRC32 instead of blanks or is this based on seeing comms from other clients?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/clach04/python-tuya/issues/40#issuecomment-438147356, or mute the thread https://github.com/notifications/unsubscribe-auth/ADLj6HVftUIPsUZJIFGzbE0vF8_IOXPWks5uul_GgaJpZM4XyVcK .

belzedaar commented 5 years ago

This is set correctly in latest version which includes support for 3.3 protocol.