forked from protonphoton/LJ
Network bugfixs
This commit is contained in:
parent
eb5b9b25f2
commit
904f920a4d
1
cli.py
1
cli.py
@ -116,6 +116,7 @@ def handle():
|
||||
else:
|
||||
gstt.oscIPin = '127.0.0.1'
|
||||
|
||||
|
||||
if args.nozoidIP != None:
|
||||
gstt.nozoscIP = args.nozoidIP
|
||||
else:
|
||||
|
2
main.py
2
main.py
@ -112,6 +112,8 @@ wsPORT = 9001
|
||||
# OSC Server : accept OSC message on port 8002
|
||||
#oscIPin = "192.168.1.10"s
|
||||
extoscIPin = serverIP
|
||||
|
||||
print "extoscIPin", extoscIPin
|
||||
extoscPORTin = 8002
|
||||
|
||||
# OSC Client : to send OSC message to an IP port 8001
|
||||
|
@ -341,7 +341,8 @@ def Starfield(hori=0,verti=0):
|
||||
|
||||
|
||||
def OSCidiotia(address,value):
|
||||
print("Pose bank idiotia got", address, "with value", value)
|
||||
print("idiotia",address,value)
|
||||
|
||||
|
||||
|
||||
def OSCfield(address, value):
|
||||
@ -401,6 +402,10 @@ anims =[[],[],[],[]]
|
||||
color = lj3.rgb2int(255,255,255)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
prepareIdiotIA()
|
||||
#prepareSTARFIELD()
|
||||
|
||||
|
@ -52,8 +52,8 @@ from osc4py3 import oscbuildparse
|
||||
from osc4py3.oscmethod import *
|
||||
|
||||
|
||||
redisIP = '127.0.0.1'
|
||||
r = redis.StrictRedis(host=redisIP, port=6379, db=0)
|
||||
#redisIP = '127.0.0.1'
|
||||
#r = redis.StrictRedis(host=redisIP, port=6379, db=0)
|
||||
|
||||
ClientNumber = 0
|
||||
|
||||
@ -225,11 +225,12 @@ def rgb2int(r,g,b):
|
||||
|
||||
|
||||
def Config(redisIP,client):
|
||||
global ClientNumber
|
||||
global ClientNumber, r
|
||||
|
||||
r = redis.StrictRedis(host=redisIP, port=6379, db=0)
|
||||
ClientNumber = client
|
||||
osc_udp_client(redisIP, 8002, "LJ 8002")
|
||||
return r
|
||||
|
||||
|
||||
def LjClient(client):
|
||||
|
@ -21,6 +21,7 @@ from osc4py3 import oscbuildparse
|
||||
from osc4py3.oscmethod import *
|
||||
|
||||
OSCinPort = 8004
|
||||
myIP = "192.168.2.52"
|
||||
|
||||
print ("")
|
||||
print ("Arguments parsing if needed...")
|
||||
@ -29,6 +30,7 @@ argsparser.add_argument("-r","--redisIP",help="IP of the Redis server used by LJ
|
||||
argsparser.add_argument("-c","--client",help="LJ client number (0 by default)",type=int)
|
||||
argsparser.add_argument("-l","--laser",help="Laser number to be displayed (0 by default)",type=int)
|
||||
argsparser.add_argument("-v","--verbose",help="Verbosity level (0 by default)",type=int)
|
||||
argsparser.add_argument("-m","--myIP",help="Local IP (127.0.0.1 by default) ",type=str)
|
||||
|
||||
args = argsparser.parse_args()
|
||||
|
||||
@ -49,6 +51,15 @@ if args.redisIP != None:
|
||||
else:
|
||||
redisIP = '127.0.0.1'
|
||||
|
||||
print("redisIP",redisIP)
|
||||
|
||||
# myIP
|
||||
if args.myIP != None:
|
||||
myIP = args.myIP
|
||||
else:
|
||||
myIP = '127.0.0.1'
|
||||
|
||||
print("redisIP",redisIP)
|
||||
|
||||
if args.verbose:
|
||||
debug = args.verbose
|
||||
@ -159,12 +170,12 @@ def Run():
|
||||
Left = []
|
||||
Right = []
|
||||
counter =0
|
||||
WebStatus("LaserGlyph")
|
||||
lj3.WebStatus("LaserGlyph")
|
||||
|
||||
# OSC Server callbacks
|
||||
print("Starting OSC at 127.0.0.1 port",OSCinPort,"...")
|
||||
print("Starting OSC at",myIP," port",OSCinPort,"...")
|
||||
osc_startup()
|
||||
osc_udp_server("127.0.0.1", OSCinPort, "InPort")
|
||||
osc_udp_server(myIP, OSCinPort, "InPort")
|
||||
osc_method("/ping*", lj3.OSCping)
|
||||
osc_method("/glyph/ljclient", OSCljclient)
|
||||
|
||||
@ -227,7 +238,7 @@ def Run():
|
||||
|
||||
finally:
|
||||
|
||||
WebStatus("Glyph Exit")
|
||||
lj3.WebStatus("Glyph Exit")
|
||||
print("Stopping OSC...")
|
||||
lj3.OSCstop()
|
||||
pass
|
||||
|
@ -15,6 +15,7 @@ from osc4py3 import oscbuildparse
|
||||
#from osc4py3 import oscmethod as osm
|
||||
from osc4py3.oscmethod import *
|
||||
|
||||
myIP = "127.0.0.1"
|
||||
|
||||
duration = 300
|
||||
|
||||
@ -35,6 +36,7 @@ else:
|
||||
print ("Words is checking arguments parsing if needed...")
|
||||
argsparser = argparse.ArgumentParser(description="Text Cycling for LJ")
|
||||
argsparser.add_argument("-r","--redisIP",help="IP of the Redis server used by LJ (127.0.0.1 by default) ",type=str)
|
||||
argsparser.add_argument("-m","--myIP",help="Local IP (127.0.0.1 by default) ",type=str)
|
||||
argsparser.add_argument("-c","--client",help="LJ client number (0 by default)",type=int)
|
||||
argsparser.add_argument("-v","--verbose",help="Verbosity level (0 by default)",type=int)
|
||||
|
||||
@ -52,6 +54,12 @@ if args.redisIP != None:
|
||||
else:
|
||||
redisIP = '127.0.0.1'
|
||||
|
||||
# myIP
|
||||
if args.myIP != None:
|
||||
myIP = args.myIP
|
||||
else:
|
||||
myIP = '127.0.0.1'
|
||||
|
||||
|
||||
if args.verbose:
|
||||
debug = args.verbose
|
||||
@ -116,9 +124,9 @@ def OSCquit():
|
||||
def Run():
|
||||
|
||||
# OSC Server callbacks
|
||||
print("Words starting its OSC server at 127.0.0.1 port",OSCinPort,"...")
|
||||
print("Words starting its OSC server at", myIP, "port",OSCinPort,"...")
|
||||
osc_startup()
|
||||
osc_udp_server("127.0.0.1", OSCinPort, "InPort")
|
||||
osc_udp_server(myIP, OSCinPort, "InPort")
|
||||
osc_method("/words/text/0*", OSCword0)
|
||||
osc_method("/words/text/1*", OSCword1)
|
||||
osc_method("/words/text/2*", OSCword2)
|
||||
|
@ -52,8 +52,8 @@ from osc4py3 import oscbuildparse
|
||||
from osc4py3.oscmethod import *
|
||||
|
||||
|
||||
redisIP = '127.0.0.1'
|
||||
r = redis.StrictRedis(host=redisIP, port=6379, db=0)
|
||||
#redisIP = '127.0.0.1'
|
||||
#r = redis.StrictRedis(host=redisIP, port=6379, db=0)
|
||||
|
||||
ClientNumber = 0
|
||||
|
||||
@ -225,11 +225,12 @@ def rgb2int(r,g,b):
|
||||
|
||||
|
||||
def Config(redisIP,client):
|
||||
global ClientNumber
|
||||
global ClientNumber, r
|
||||
|
||||
r = redis.StrictRedis(host=redisIP, port=6379, db=0)
|
||||
ClientNumber = client
|
||||
osc_udp_client(redisIP, 8002, "LJ 8002")
|
||||
return r
|
||||
|
||||
|
||||
def LjClient(client):
|
||||
|
@ -28,8 +28,8 @@ from osc4py3.as_eventloop import *
|
||||
from osc4py3 import oscbuildparse
|
||||
|
||||
|
||||
redisIP = '127.0.0.1'
|
||||
r = redis.StrictRedis(host=redisIP, port=6379, db=0)
|
||||
#redisIP = '127.0.0.1'
|
||||
#r = redis.StrictRedis(host=redisIP, port=6379, db=0)
|
||||
|
||||
ClientNumber = 0
|
||||
|
||||
|
@ -31,8 +31,10 @@ import pdb
|
||||
import types, ast, argparse
|
||||
from OSC import OSCServer, OSCClient, OSCMessage
|
||||
|
||||
|
||||
pl = [[],[],[],[]]
|
||||
|
||||
|
||||
print ("")
|
||||
print ("LJ v0.8.0 : Pygame simulator")
|
||||
print ("")
|
||||
@ -44,6 +46,7 @@ print ("Arguments parsing if needed...")
|
||||
|
||||
argsparser = argparse.ArgumentParser(description="Available commands")
|
||||
argsparser.add_argument("-r","--redisIP",help="IP of the Redis server used by LJ (127.0.0.1 by default) ",type=str)
|
||||
argsparser.add_argument("-m","--myIP",help="Local IP (127.0.0.1 by default) ",type=str)
|
||||
argsparser.add_argument("-c","--client",help="LJ client number (0 by default)",type=int)
|
||||
argsparser.add_argument("-l","--laser",help="Laser number to be displayed (0 by default)",type=int)
|
||||
argsparser.add_argument("-v","--verbose",help="Verbosity level (0 by default)",type=int)
|
||||
@ -76,14 +79,22 @@ else:
|
||||
r = redis.StrictRedis(host=redisIP, port=6379, db=0)
|
||||
|
||||
|
||||
# myIP
|
||||
if args.myIP != None:
|
||||
myIP = args.myIP
|
||||
else:
|
||||
myIP = '127.0.0.1'
|
||||
|
||||
|
||||
|
||||
#
|
||||
# OSC
|
||||
#
|
||||
|
||||
oscIPin = "127.0.0.1"
|
||||
oscIPin = myIP
|
||||
oscPORTin = 8008
|
||||
|
||||
ljIP = "127.0.0.1"
|
||||
ljIP = redisIP
|
||||
ljPort = 8002
|
||||
|
||||
print ("")
|
||||
|
@ -35,6 +35,7 @@ else:
|
||||
print ("Arguments parsing if needed...")
|
||||
argsparser = argparse.ArgumentParser(description="Text Cycling for LJ")
|
||||
argsparser.add_argument("-r","--redisIP",help="IP of the Redis server used by LJ (127.0.0.1 by default) ",type=str)
|
||||
argsparser.add_argument("-m","--myIP",help="Local IP (127.0.0.1 by default) ",type=str)
|
||||
argsparser.add_argument("-c","--client",help="LJ client number (0 by default)",type=int)
|
||||
argsparser.add_argument("-l","--laser",help="Laser number to be displayed (0 by default)",type=int)
|
||||
argsparser.add_argument("-v","--verbose",help="Verbosity level (0 by default)",type=int)
|
||||
@ -64,6 +65,14 @@ if args.redisIP != None:
|
||||
else:
|
||||
redisIP = '127.0.0.1'
|
||||
|
||||
|
||||
# myIP
|
||||
if args.myIP != None:
|
||||
myIP = args.myIP
|
||||
else:
|
||||
myIP = '127.0.0.1'
|
||||
|
||||
|
||||
lj3.Config(redisIP,ljclient)
|
||||
#r = redis.StrictRedis(host=redisIP, port=6379, db=0)
|
||||
|
||||
@ -101,8 +110,9 @@ def OSCquit():
|
||||
|
||||
lj3.OSCquit("cycl")
|
||||
|
||||
print("Cycl starting its OSC server at", myIP, "port",OSCinPort,"...")
|
||||
osc_startup()
|
||||
osc_udp_server("127.0.0.1", OSCinPort, "InPort")
|
||||
osc_udp_server(myIP, OSCinPort, "InPort")
|
||||
|
||||
osc_method("/ping*", OSCping)
|
||||
osc_method("/quit", OSCquit)
|
||||
|
Loading…
Reference in New Issue
Block a user