From c55e0aa6c786ed86e47852afc649106abdcd48ed Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 15 Aug 2024 17:04:23 +0200 Subject: [PATCH] Misc --- LJ.conf | 14 ++++----- README.md | 14 ++++++++- configureUI.py | 9 ++++-- examples/Processing/leapdots/leapdots.pde | 2 +- libs3/cli.py | 4 +-- main.py | 35 +++++++++++++++-------- 6 files changed, 52 insertions(+), 26 deletions(-) diff --git a/LJ.conf b/LJ.conf index 43bf1a7..a4594c8 100644 --- a/LJ.conf +++ b/LJ.conf @@ -1,6 +1,6 @@ [General] lasernumber = 1 -debug = 1 +debug = 0 rediserverip = 0.0.0.0 wwwip = 192.168.2.43 nozoscip = 127.0.0.1 @@ -14,14 +14,14 @@ color = -1 type = LOCAL dac_family = helios ip = 127.0.0.1 -kpps = 32692 -centerx = -5376.0 -centery = 11844.0 -zoomx = 29.15625 -zoomy = 31.21875 +kpps = 194 +centerx = 7.0 +centery = 61.0 +zoomx = 312.0 +zoomy = 1039.0 sizex = 32000.0 sizey = 32000.0 -finangle = 0.0 +finangle = -0.02263757042605427 intens = 255.0 red = 100 green = 100 diff --git a/README.md b/README.md index 3964d9e..2dd2529 100644 --- a/README.md +++ b/README.md @@ -155,7 +155,19 @@ an ISO is available here : https://www.tmplab.org/wp-content/lazer-iso.zip ## Postinstall for all : -You probably want redis bound to all network interfaces : comment the bind line in /etc/redis/redis.conf and restart it. +You probably want redis bound to all network interfaces : + +- locate redis.conf + +redis-cli INFO server | grep config_file + +Macos : +arm : /opt/homebrew/etc/ +intel : /usr/local/etc/redis.conf + +- comment the bind line + +- redis-cli CONFIG SET protected-mode no The configure script to enter your etherdreams IPs,... is launched during install. You can use anytime, i.e if your network/etherdream setup change : python3 configure.py diff --git a/configureUI.py b/configureUI.py index 79ca5da..5dd613e 100755 --- a/configureUI.py +++ b/configureUI.py @@ -3,10 +3,12 @@ # -*- coding: utf-8 -*- # -*- mode: Python -*- ''' -LJay/LJ +LJ v0.7.0 -Config HI +Config UI + +brew install python-tk LICENCE : CC ''' @@ -185,11 +187,12 @@ def UIelements(currentLaser): save = tk.Button(UI, text="Save", command=Write).grid(row=12, column=1) ok = tk.Button(UI, text="Ok", command=Exit).grid(row=12, column=3) - UI.title(string='LJ2 config') + UI.title(string='LJ config') def Exit(): UI.destroy() + quit() def validate(input): diff --git a/examples/Processing/leapdots/leapdots.pde b/examples/Processing/leapdots/leapdots.pde index 30852ab..5e01695 100644 --- a/examples/Processing/leapdots/leapdots.pde +++ b/examples/Processing/leapdots/leapdots.pde @@ -46,7 +46,7 @@ void draw() { points.clear(); pointList = pointList.substring(0, pointList.length() - 1); // remove the last comma pointList += "]"; // close the point list string - System.out.println(pointList); + //System.out.println(pointList); Jedis jedis = new Jedis("localhost"); jedis.set("/pl/0/0", pointList); jedis.close(); diff --git a/libs3/cli.py b/libs3/cli.py index 3a68bbe..96880b0 100644 --- a/libs3/cli.py +++ b/libs3/cli.py @@ -68,8 +68,8 @@ def handle(): oport = gstt.oport if gstt.debug > 0: - print("Accept OSC on port",gstt.oport) - print("gstt.iport:",gstt.iport) + print("Accept OSC port arg : ",gstt.oport) + print("Send OSC to port arg :",gstt.iport) # X Y inversion arguments diff --git a/main.py b/main.py index 035df8d..f37e951 100755 --- a/main.py +++ b/main.py @@ -72,6 +72,16 @@ r = redis.StrictRedis(host=gstt.RediServerIP , port=6379, db=0) # r = redis.StrictRedis(host=gstt.RediServerIP , port=6379, db=0, password='-+F816Y+-') args =[0,0] +os_name = sys.platform +print(f"Système d'exploitation: {os_name}") +# Plateformes spécifiques +if os_name == "Windows": + print("Plateform: Windows") +elif os_name == "Darwin": # macOS + print("Plateform: macOS") +elif os_name == "Linux": + print("Plateform: Linux") + def dac_process(number, pl): @@ -107,11 +117,10 @@ def dac_process(number, pl): # Init variables # -print("Start Scene number :",gstt.SceneNumber) - debug = gstt.debug print("Debug :", debug) +print("Start Scene number :",gstt.SceneNumber) print("Laser feedbacks resetting...") for laserid in range(0,gstt.LaserNumber): @@ -480,7 +489,7 @@ if __name__ == '__main__': # Bug in 3.8.4 MacOS default multiprocessing start method is spawn. Spawn doesn't work properly set_start_method('fork') - print("gstt.LaserNumber", gstt.LaserNumber) + #print("gstt.LaserNumber", gstt.LaserNumber) if gstt.LaserNumber == -1: log.infog("Autodetected DACs mode") commands.DAChecks() @@ -493,7 +502,7 @@ if __name__ == '__main__': print("LaserNumber = ", gstt.LaserNumber) log.info("Starting "+str(gstt.LaserNumber) + " DACs process...") - # Launch one process (a tracer3 instance) by etherdream + # Launch one process (a tracer3 instance) by laser dac_worker0= Process(target=dac_process, args=(0,0,)) dac_worker0.start() commands.worker0 = dac_worker0 @@ -527,16 +536,18 @@ if __name__ == '__main__': log.info("Starting servers...") hostIP= get_Host_name_IP() if hostIP != gstt.wwwIP: - log.err("Host IP is : "+str(hostIP)) - log.err("wwwIP in LJ.conf : "+str(gstt.wwwIP)) - log.err("Update LJ.conf : python3 configure.py") + print("Host IP is : "+str(hostIP)) + print("wwwIP in LJ.conf : "+str(gstt.wwwIP)) + log.err("Host and wwwIP different : you must update Update LJ.conf :") + print("python3 configure.py") + log.err('Exiting...') #gstt.wwwIP = hostIP commands.LJautokill() sys.exit() # Launch OSC thread listening to oscserver - print("Launching OSC server to receive messages (UI,...)") - print("binding at", oscserverIPin, "port",str(oscserverPORTin)) + print("OSC server to receive messages (UI,...)") + print("binded at", oscserverIPin, "port",str(oscserverPORTin)) oscserver.addMsgHandler( "/noteon", commands.NoteOn) oscserver.addMsgHandler( "/scim", commands.Scim) oscserver.addMsgHandler( "/line1", commands.Line1) @@ -547,15 +558,15 @@ if __name__ == '__main__': #print() # Websocket listening port - print("Listening for WebUI WS...") + print("WebUI WS server...") - hostIP= get_Host_name_IP() + #hostIP= get_Host_name_IP() if hostIP != gstt.wwwIP: log.err("wwwIP in config is not set to "+str(hostIP)) gstt.wwwIP = hostIP #commands.LJautokill() - print("binding at", gstt.wwwIP, "port",str(gstt.wsPORT)) + print("binded at", gstt.wwwIP, "port",str(gstt.wsPORT)) wserver = WebsocketServer(gstt.wsPORT,host= gstt.wwwIP) plugins.Init(wserver) wserver.set_fn_new_client(new_client)