Page 1 of 1

TCP/IP server with Python3 Example

Posted: 31 Jul 2013, 21:18
by fester
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()

Re: TCP/IP server with Python 3 Example

Posted: 14 Aug 2013, 03:58
by lindsayward
Thanks. I was googling (search box at top of forum) "Python" and not finding anything, so I'm posting this with a space between Python and 3 so people will be able to find it.

Are you the fester from the Line 6 forums?

Re: TCP/IP server with Python3 Example

Posted: 29 Aug 2014, 07:05
by jg5985
have you used this???
I tried running it, then ran it again.
It didn't work the second time and looking at freestyler it seems the connection was not gracefully terminated on the freestyler side and the socket is still open preventing a new connection.

I just copied and pasted your code into a .py file