Page 1 of 1

TCP/IP server with Python3 Example

Posted: July 31st, 2013, 9:18 pm
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: August 14th, 2013, 3:58 am
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: August 29th, 2014, 7:05 am
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