TCP/IP server with Python3 Example
Posted: July 31st, 2013, 9:18 pm
Couldn't find it anywhere else so pasting this here.. Hopefully this will help with people googling!
This will hit the blackout button on freestyler
import socket
TCP_IP = '127.0.0.1'
TCP_PORT = 3332
BUFFER_SIZE = 1024
FREESTYLERCOMMAND = bytes("FSOC002255", "ASCII")
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))
s.send(FREESTYLERCOMMAND)
s.close()
This will hit the blackout button on freestyler
import socket
TCP_IP = '127.0.0.1'
TCP_PORT = 3332
BUFFER_SIZE = 1024
FREESTYLERCOMMAND = bytes("FSOC002255", "ASCII")
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))
s.send(FREESTYLERCOMMAND)
s.close()