Skip to content

Instantly share code, notes, and snippets.

@aSmig
Created July 11, 2017 22:12
Show Gist options
  • Save aSmig/eb9af054b0f4a6b214983cd2731252d2 to your computer and use it in GitHub Desktop.
Save aSmig/eb9af054b0f4a6b214983cd2731252d2 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
# Use YardStick One and RfCat to transmit a fan remote control signal as
# observed by int10h here: https://i.imgur.com/JZ3pdF1.png
import bitstring
from rflib import *
device = RfCat()
device.setMdmModulation(MOD_ASK_OOK)
device.setFreq(433e6)
device.setMdmSyncMode(0x00)
device.setMdmDRate(5215)
device.makePktFLEN()
device.setMdmNumPreamble(0)
device.setPktPQT(0)
device.setMaxPower()
# Repeating is probably not necessary and may need to be rate limited
for i in range(3):
device.RFxmit(bitstring.BitArray(bin='001001011011011011011011011011001001001').tobytes())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment