forked from protonphoton/LJ
better doc
This commit is contained in:
parent
cd9461a8fc
commit
0e9e7717c9
73
README.md
73
README.md
@ -74,30 +74,34 @@ LJ is in dev : versions in this repository will always be core functionnal : acc
|
||||
# Install
|
||||
#
|
||||
|
||||
With Linux, in LJ directory, type in a terminal window :
|
||||
|
||||
- Linux Buster : in LJ directory, type in a terminal window :
|
||||
|
||||
cd server
|
||||
./install.sh
|
||||
|
||||
Server directory also contains config files for optionnal nginx, supervisorctl and syncthing.
|
||||
|
||||
|
||||
For OS X, you need brew already installed, then :
|
||||
- OS X : you need brew already installed, then :
|
||||
|
||||
brew update
|
||||
brew upgrade
|
||||
brew install redis
|
||||
cd server
|
||||
type all install.sh commands beginning line 4. An OS X install script soon !!
|
||||
|
||||
For Linux and OS X :
|
||||
|
||||
- KVM :
|
||||
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.
|
||||
|
||||
WebUI pages needs to know the LJ IP address. So you need to change the line wwwIP = "192.168.2.43" in updateUI.py then run python updateUI.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
|
||||
|
||||
Using the same idea check all ip address in LJ.conf.
|
||||
- Webserver ?
|
||||
|
||||
There is a nice websocket debug tool : websocat.
|
||||
A webserver is useful if you want to use the webUI remotely. Bring Your Own Webserver.
|
||||
|
||||
|
||||
|
||||
@ -107,9 +111,9 @@ There is a nice websocket debug tool : websocat.
|
||||
|
||||
Correct launch order is :
|
||||
|
||||
- Switch on Dac/Laser (emulator or IRL)
|
||||
- Redis server, usually automatically start at boot if redis is a service or you launched manually : redis-server &
|
||||
- This program. see below.
|
||||
- Switch on Dacs/Lasers (emulator or IRL)
|
||||
- Redis server, usually automatically started at boot (if redis is a service) or you launched manually : redis-server &
|
||||
- LJ, see below.
|
||||
- Load/reload webUI page from disk in a browser (www/index.html). Javascript must be enabled.
|
||||
- Run a builtin plugin or your generator, to send pointlists in redis.
|
||||
|
||||
@ -141,14 +145,12 @@ redis-cli then ask for the key you want like : get /pl/0/0
|
||||
CASE 2 : Server and Client computers are different :
|
||||
|
||||
|
||||
1/ Say the laser server computer (running LJ) IP is 192.138.1.13, the client computer is 192.168.1.52, First remember to check on the server computer, if the redis server is listening to the right IP :
|
||||
|
||||
edit /etc/redis/redis.conf
|
||||
1/ Say the laser server computer (running LJ) IP is 192.138.1.13, the client computer is 192.168.1.52, First remember to check on the server computer, if the redis server is listening to the right IP : edit /etc/redis/redis.conf
|
||||
|
||||
2/ Launch LJ with -r argument :
|
||||
python3 main.py -r 192.168.1.13 -L 1
|
||||
|
||||
3/ If the webUI is launched on "client" computer, update uri line in LJ.js
|
||||
3/ If the webUI is launched on "client" computer, use the configure.py
|
||||
|
||||
4/ run a client/plugin on client computer, like :
|
||||
|
||||
@ -163,27 +165,28 @@ redis-cli -h redisserverIP monitor
|
||||
# Plugin
|
||||
#
|
||||
|
||||
A "plugin" is a software that send any number of pointlist(s). LJ comes with different plugins in python 3 :
|
||||
A "plugin" is a software that send any number of pointlist(s) to redis and . LJ comes with different plugins in python 3 :
|
||||
|
||||
- artnet receiver : port 6454
|
||||
- Aurora : Fill the input form and it's displayed. One word / laser.
|
||||
- custom1 and square.py.
|
||||
|
||||
#
|
||||
# Client Side : Program your own "plugin"
|
||||
#
|
||||
|
||||
The server approach is based on redis, so you can write and run your laser client software in any redis capable programming langage (50+ : https://redis.io/clients). An external program that just send pointlists is a "client". If you want some interactions from the webUI, like text status area support, crash detection, launch,... it's a "plugin" and some default code is needed. See custom1.py, a basic plugin you can modiffy. LJ and plugins signaling is mainly over OSC.
|
||||
The server approach is based on redis, so you can write and run your laser client software in any redis capable programming langage (50+ : https://redis.io/clients). An external program that just send pointlists to redis is a "client". If you want some interactions from the webUI, like text status area support, crash detection, autostart,... it's a "plugin" and some default code is needed. LJ and plugins signaling is over OSC.
|
||||
|
||||
- Read all this readme ;-)
|
||||
- Generate at least one pointlist array (say a square) with *enough points*, one point is likely to fail for buffering reason. See command reference below for more.
|
||||
- Feed your point list array in string format to redis server. i.e use "/pl/0/1" redis key to feed scene 0, laser 1.
|
||||
- Generate at least one pointlist array (say a square) with *enough points*, one point is likely to fail for buffering reason.
|
||||
- Feed your point list array in string format to redis server. i.e use "/pl/0/1" redis key to feed scene 0, laser 1. See /pl/ command in command reference below how to send your pointlist to i.e /pl/0/1 redis key.
|
||||
- Tell LJ.conf your plugin configuration : OSC port and command line to start it.
|
||||
- At least a plugin must reply /pong to OSC request /ping.
|
||||
- At least a plugin must reply /pong to OSC request /ping and must quit after an OSC command /quit.
|
||||
|
||||
Currently the WebUI (www/index.html) is static.
|
||||
|
||||
#
|
||||
# Client side dope mode : How to use lj23 (python3)
|
||||
# Client side dope mode for python 3 generators : How to use lj23
|
||||
#
|
||||
|
||||
lj23 have many very useful functions to not reinvent the wheel for advanced points generation "client" side : layers, sprites, built in rotations,..
|
||||
@ -191,7 +194,7 @@ lj23 have many very useful functions to not reinvent the wheel for advanced poin
|
||||
|
||||
4 Great TRICKS with lj23 :
|
||||
|
||||
First open square.py and learn how to declare different objects. square.py is a 2D shape example in 3D rotation (red/green anaglyph rendering) that use 2 layers : one for left eye and one for right eye.
|
||||
First open custom1.py and learn how to declare different objects. custom1.py is a 2D shape example in 3D rotation (red/green anaglyph rendering) that use 2 layers : one for left eye and one for right eye. custom1 is a copy of square.py
|
||||
|
||||
|
||||
1/ How to have another laser drawing the same thing ?
|
||||
@ -307,7 +310,7 @@ The need for a dedicated computer to act as "laser server" usually depends on ho
|
||||
For nice lines and angles all user pointlists are automatically resampled by tracers. There is 2 cases defined for resampling strategy : short and long distance between 2 points.
|
||||
|
||||
|
||||
short distance : has one step : (1.0, number repetition at destination position). 1.0 = 100% = end of the line between the 2 points. For example : (1.0, 8) means the end point will be repeated 8 times.
|
||||
short distance : has one step : (1.0, number repetition at destination position). 1.0 = 100% = end point of the line between the 2 points. For example : (1.0, 8) means the end point will be repeated 8 times.
|
||||
|
||||
long distance has 3 steps : (0.25, 3), (0.75, 3), (1.0, 10) : means an extra point at 25% is created and repeated 3 times, another at 75% repeated also 3 times and destination point is repeated 10 times.
|
||||
|
||||
@ -342,20 +345,18 @@ See links section for great etherdream managing tools.
|
||||
About hardware setup, especially if you have several lasers : ILDA cables are insanely expensive. For each DAC, buy a very small ILDA cable and RJ 45 cable, all DAC goes to a local switch and only one long cable to your
|
||||
You may also consider the Power Over Ethernet 'POE' option. Buy a POE splitter and connect everything to the ether dream fixed near your laser. You can have then a simple and very long network cable and use a Power Over Ethernet injector or switch close to the driving computer. Beware some vendors use 24V POE Injector : POE injectors and splitters must match.
|
||||
|
||||
#
|
||||
# Ethertools directory
|
||||
#
|
||||
|
||||
2 useful and always working tools from j4cdac github repository : sitter and talk
|
||||
- Sitter will display all real etherdreams available on the network and their state (playing, idle,...). python sitter.py or use the compiled version (for macOS).
|
||||
- Talk : will draw a 4 colors square. python3 talk3.py
|
||||
|
||||
#
|
||||
# Links
|
||||
#
|
||||
|
||||
Tools :
|
||||
|
||||
Display all connected etherdreams on the network : ![sitter](https://github.com/j4cbo/j4cDAC/tree/master/tools/sitter)
|
||||
python sitter.py
|
||||
|
||||
Draw simple square : ![talk](https://github.com/j4cbo/j4cDAC/tree/master/tools/tester)
|
||||
|
||||
python talk.py
|
||||
|
||||
|
||||
Generic :
|
||||
|
||||
@ -366,16 +367,22 @@ Generic :
|
||||
|
||||
![Laser Faq](https://www.repairfaq.org/sam/lasersam.htm)
|
||||
|
||||
There is a nice websocket debug tool : websocat.
|
||||
|
||||
#
|
||||
# LJ commands reference
|
||||
#
|
||||
|
||||
All commands are available via OSC (port 8002) or websocket (port 9001)
|
||||
All these commands are available via OSC (port 8002) or websocket (port 9001)
|
||||
|
||||
|
||||
/pl/scenenumber/lasernumber value : value is the pointlist to draw as string. Example :
|
||||
/pl/0/0 "[(150.0, 230.0, 65280), (170.0, 170.0, 65280), (230.0, 170.0, 65280), (210.0, 230.0, 65280), (150.0, 230.0, 65280)]"
|
||||
|
||||
Use the same syntax if you send your pointlist directly in redis : "/pl/0/0" is the key and value is "[(150.0,..."
|
||||
|
||||
Every point must be : (x,y,color). Color is the hex color #FFFFFF in decimal.
|
||||
|
||||
|
||||
/scale/X/lasernumber value
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# -*- mode: Python -*-
|
||||
'''
|
||||
LJay/LJ
|
||||
LJ
|
||||
v0.1.0
|
||||
|
||||
A console friendly interface to change important parameters
|
||||
@ -23,7 +23,7 @@ config.read(gstt.ConfigName)
|
||||
|
||||
qList = [
|
||||
{"q":"The server IP address ","c":"General","k":"ljayserverip"},
|
||||
{"q":"The IP address or domain for webui","c":"General","k":"wwwip"},
|
||||
{"q":"The IP address for webui","c":"General","k":"wwwip"},
|
||||
{"q":"How many lasers to use ","c":"General","k":"lasernumber"},
|
||||
{"q":"Laser 0 IP address ","c":"laser0","k":"ip"},
|
||||
{"q":"Laser 1 IP address ","c":"laser1","k":"ip"},
|
||||
|
@ -25,6 +25,8 @@ sudo apt install libjack-dev
|
||||
pip3 install python-rtmidi
|
||||
pip3 install mido
|
||||
git clone https://github.com/ptone/pyosc --depth 1 /tmp/pyosc && cd /tmp/pyosc && sudo ./setup.py install
|
||||
cd ..
|
||||
python3 configure.py
|
||||
# todo : ask for computer ip and run updateUI.py
|
||||
cd /tmp
|
||||
sudo apt install portaudio19-dev
|
||||
|
Loading…
Reference in New Issue
Block a user