This commit is contained in:
Sam 2024-08-15 17:04:23 +02:00
parent ebe188592e
commit c55e0aa6c7
6 changed files with 52 additions and 26 deletions

14
LJ.conf
View File

@ -1,6 +1,6 @@
[General] [General]
lasernumber = 1 lasernumber = 1
debug = 1 debug = 0
rediserverip = 0.0.0.0 rediserverip = 0.0.0.0
wwwip = 192.168.2.43 wwwip = 192.168.2.43
nozoscip = 127.0.0.1 nozoscip = 127.0.0.1
@ -14,14 +14,14 @@ color = -1
type = LOCAL type = LOCAL
dac_family = helios dac_family = helios
ip = 127.0.0.1 ip = 127.0.0.1
kpps = 32692 kpps = 194
centerx = -5376.0 centerx = 7.0
centery = 11844.0 centery = 61.0
zoomx = 29.15625 zoomx = 312.0
zoomy = 31.21875 zoomy = 1039.0
sizex = 32000.0 sizex = 32000.0
sizey = 32000.0 sizey = 32000.0
finangle = 0.0 finangle = -0.02263757042605427
intens = 255.0 intens = 255.0
red = 100 red = 100
green = 100 green = 100

View File

@ -155,7 +155,19 @@ an ISO is available here : https://www.tmplab.org/wp-content/lazer-iso.zip
## Postinstall for all : ## 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 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

View File

@ -3,10 +3,12 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# -*- mode: Python -*- # -*- mode: Python -*-
''' '''
LJay/LJ LJ
v0.7.0 v0.7.0
Config HI Config UI
brew install python-tk
LICENCE : CC LICENCE : CC
''' '''
@ -185,11 +187,12 @@ def UIelements(currentLaser):
save = tk.Button(UI, text="Save", command=Write).grid(row=12, column=1) 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) 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(): def Exit():
UI.destroy() UI.destroy()
quit()
def validate(input): def validate(input):

View File

@ -46,7 +46,7 @@ void draw() {
points.clear(); points.clear();
pointList = pointList.substring(0, pointList.length() - 1); // remove the last comma pointList = pointList.substring(0, pointList.length() - 1); // remove the last comma
pointList += "]"; // close the point list string pointList += "]"; // close the point list string
System.out.println(pointList); //System.out.println(pointList);
Jedis jedis = new Jedis("localhost"); Jedis jedis = new Jedis("localhost");
jedis.set("/pl/0/0", pointList); jedis.set("/pl/0/0", pointList);
jedis.close(); jedis.close();

View File

@ -68,8 +68,8 @@ def handle():
oport = gstt.oport oport = gstt.oport
if gstt.debug > 0: if gstt.debug > 0:
print("Accept OSC on port",gstt.oport) print("Accept OSC port arg : ",gstt.oport)
print("gstt.iport:",gstt.iport) print("Send OSC to port arg :",gstt.iport)
# X Y inversion arguments # X Y inversion arguments

35
main.py
View File

@ -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+-') # r = redis.StrictRedis(host=gstt.RediServerIP , port=6379, db=0, password='-+F816Y+-')
args =[0,0] 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): def dac_process(number, pl):
@ -107,11 +117,10 @@ def dac_process(number, pl):
# Init variables # Init variables
# #
print("Start Scene number :",gstt.SceneNumber)
debug = gstt.debug debug = gstt.debug
print("Debug :", debug) print("Debug :", debug)
print("Start Scene number :",gstt.SceneNumber)
print("Laser feedbacks resetting...") print("Laser feedbacks resetting...")
for laserid in range(0,gstt.LaserNumber): 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 # Bug in 3.8.4 MacOS default multiprocessing start method is spawn. Spawn doesn't work properly
set_start_method('fork') set_start_method('fork')
print("gstt.LaserNumber", gstt.LaserNumber) #print("gstt.LaserNumber", gstt.LaserNumber)
if gstt.LaserNumber == -1: if gstt.LaserNumber == -1:
log.infog("Autodetected DACs mode") log.infog("Autodetected DACs mode")
commands.DAChecks() commands.DAChecks()
@ -493,7 +502,7 @@ if __name__ == '__main__':
print("LaserNumber = ", gstt.LaserNumber) print("LaserNumber = ", gstt.LaserNumber)
log.info("Starting "+str(gstt.LaserNumber) + " DACs process...") 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= Process(target=dac_process, args=(0,0,))
dac_worker0.start() dac_worker0.start()
commands.worker0 = dac_worker0 commands.worker0 = dac_worker0
@ -527,16 +536,18 @@ if __name__ == '__main__':
log.info("Starting servers...") log.info("Starting servers...")
hostIP= get_Host_name_IP() hostIP= get_Host_name_IP()
if hostIP != gstt.wwwIP: if hostIP != gstt.wwwIP:
log.err("Host IP is : "+str(hostIP)) print("Host IP is : "+str(hostIP))
log.err("wwwIP in LJ.conf : "+str(gstt.wwwIP)) print("wwwIP in LJ.conf : "+str(gstt.wwwIP))
log.err("Update LJ.conf : python3 configure.py") log.err("Host and wwwIP different : you must update Update LJ.conf :")
print("python3 configure.py")
log.err('Exiting...')
#gstt.wwwIP = hostIP #gstt.wwwIP = hostIP
commands.LJautokill() commands.LJautokill()
sys.exit() sys.exit()
# Launch OSC thread listening to oscserver # Launch OSC thread listening to oscserver
print("Launching OSC server to receive messages (UI,...)") print("OSC server to receive messages (UI,...)")
print("binding at", oscserverIPin, "port",str(oscserverPORTin)) print("binded at", oscserverIPin, "port",str(oscserverPORTin))
oscserver.addMsgHandler( "/noteon", commands.NoteOn) oscserver.addMsgHandler( "/noteon", commands.NoteOn)
oscserver.addMsgHandler( "/scim", commands.Scim) oscserver.addMsgHandler( "/scim", commands.Scim)
oscserver.addMsgHandler( "/line1", commands.Line1) oscserver.addMsgHandler( "/line1", commands.Line1)
@ -547,15 +558,15 @@ if __name__ == '__main__':
#print() #print()
# Websocket listening port # 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: if hostIP != gstt.wwwIP:
log.err("wwwIP in config is not set to "+str(hostIP)) log.err("wwwIP in config is not set to "+str(hostIP))
gstt.wwwIP = hostIP gstt.wwwIP = hostIP
#commands.LJautokill() #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) wserver = WebsocketServer(gstt.wsPORT,host= gstt.wwwIP)
plugins.Init(wserver) plugins.Init(wserver)
wserver.set_fn_new_client(new_client) wserver.set_fn_new_client(new_client)