Skip to content

Instantly share code, notes, and snippets.

@Elwell
Created August 7, 2022 06:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Elwell/792a401c586c8949ecd86ed37df02393 to your computer and use it in GitHub Desktop.
Save Elwell/792a401c586c8949ecd86ed37df02393 to your computer and use it in GitHub Desktop.
Trivial script to sniff slow Tuya traffic between an embedded MCU and the TYWE3S serial pins
#!/usr/bin/python3
import serial
TX = serial.Serial(port = "/dev/ttyS2", baudrate=9600, timeout=1)
RX = serial.Serial(port = "/dev/ttyS4", baudrate=9600, timeout=1)
while True:
tx = TX.readline().hex()
if tx != '':
print('TX: ', tx)
rx = RX.readline().hex()
if rx != '':
print('RX: ', rx)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment