Skip to content

py60800/tuyadump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tuyadump (experimental)

Tool to dump communication with tuya devices

Warning

This tool has been developped while coding a GO API to control Tuya devices (Available here)[https://github.com/py60800/tuya].

Despite being the result of quick and dirty coding, I found it great for debugging tuya communication.

Thanks to Erik Montnemery (@emontnemery), tuyadump now supports 3.3 protocol. If you encounter any issue, you can try the previous version (branch master).

Prerequisites

Get the keys and ids of the tuya devices : https://github.com/codetheweb/tuyapi/blob/master/docs/SETUP.md

Acknowledgements

@codetheweb for reverse engineering tuya protocol

@google team for providing gopacket libraries

@emontnemery for providing clues and examples to support 3.3 protocol

and many others...

Get and build (Linux)

Install libpcap dev package (i.e. sudo apt install libpcap<version>dev)

Get gopacket library:

go get "github.com/google/gopacket"

Get this library

go get "github.com/py60800/tuyadump"

Build:

go build tuyadump.go comm-msg.go crypto.go dodump.godebug.go

Run

Create a config file with the keys and id collected from tuya device (check example config for format)

To view traffic in real time sudo ./tuyadump -C tuyaconfig.jsonport 6668

To view trafic collected with tcpdump: tuyadump -C tuyaconfig.json -r dump.pcap

-d option can be used to dump packets as hex data

About

Dump and decrypt communication with tuya devices

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages