Python art net interface. with patterns you can run for the ledpoles and the ledmatrix fridgefire made.
or anything that has a network based artnet interface.
I made it easier to config and run patterns with python code.
- python2.7 source
- pypng source
- pygame source
- pyserial-2.7 source
- pygtk source
- pygtksourveiw2source
- PyOpenGl source
- SciPy source
- NumPy source
- PyAudio source
- alsaseq source
- alsaaudio source
make you pattern, import it into patterns.py
then in configs folder created a config file or edit a existing one.
create it like:
name_conf.py
use a existing config as a template and follow it.
you can run multiple devices from a signle config file.
as wel as multpile patterns like:
TARGETS {
target1_ip:pattern(),
target2_ip:nextPattern(),
target3_ip:anotherPattern(),
}
Then to run the actual patterns you run from the command line:
:$ python runPatternJob.py --fps=<fps> --config=<config>
for example:
:$ python runpatternJob.py --fps=25 --config=myLamps_conf.py
both fps and config are optional,
the default framerate is 15 Fps which is the delay that dictates how fast the refresh is ran, or packets are sendout.
and the default config is default_conf.py
which won't work if you didn't put the right things in it. like the right ip.
etc etc.
if you want to run the code with the build in simulator just add --matrixSim=enabled
to the command line options and it will run localy on your screen.
for example:
:$ python runpatternJob.py --fps=25 --config=myLamps_conf.py --matrixSim=enabled
but ofcourse this wouldn't look right if you config file contains code for anything other than a matrix display.
but you can view the display as a string of pixels though, cause basicly in reality it is just that.
PixelMatrix with artnet interface
robert@Laptop:~/py-artnet$ python runPatternJob.py --gui=enabled
what if you see a message like: '''shell /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/init.py:57: GtkWarning: could not open display warnings.warn(str(e), _gtk.Warning) '''
that meens your version of pygtk is to old. you are required to have a version installed thats above 2.0
http://soc.if.usp.br/manual/python-gtksourceview2/html/
- been working on a gui/editor to make patterns on the go, which features live code reloading, and a build in simulator
- need to put downs some ideas soon like a line number ruler thing and indentation follow.[line numbers implemented, syntaxhighlighting implemented, indentation follow implemented]
- and more things like that.
- create a few editeable settings like fps. and maybe a a live mode (sending out udp artnet to devices)
- find ways to discover devices and display.
- put some diagnostic output under the matrix simulator. [partialy implemented]
- auto indentation follows indentation level.
- indentation after a : and unindent after break pass return continue.
- basicly ported this to my code: http://osdir.com/ml/gnome.apps.gedit/2008-06/msg00027.html
- it has syntax highlighting.
- dynamic reloading triggerd on key-releases.
- dynamic looking for generate function (has to be inside a class)
- indenting in spaces, where spaces are show as spaces with dots in them to show the level
- has some action that can be performed through the menu.
- you can open files save them in a tempfile names new_file.py (Control - O, Control-S)
- reload code with Control-R and menu item
- Control-Q or quit through menu.
- undo changes (Control-Z)
- redo changes (Control-Y)
- output for easy showing where errors are and what kind of errors are/were generated. (under the simulator)
compile:
run:
artmonitor #tells a bit more info on the device like mac address and more.
artpoll #finds all the devices on the network. writes that data to a file. make sure field-devices exist (file)
artdmxtest #runs a fading pattern, usefull for testing if the art-net device works.
-
FallingStars [it is broken it worked it was done and now it doesn't even run. only half the code is there. probably a commit thing happend.]
-
implentation of pixelbros [W.I.P]
-
pong [Done]
-
snake [Done]
-
tron [W.I.P]
-
tetris
-
arcadia
-
game of life (conway) [Done it's called PixelLife]
-
VU meter [partialy done, have a effect running]
-
network monitor
-
make mario appear on the matrix or other mobs from the game or any other image from other games.
-
problem with pwm not being linear (the amount of power it gives per pulse)
thus implement a scale which does make it linear. so fading is nice and even.
-
link that gave me the Yes that's it! moment:
-
http://forum.arduino.cc/index.php?PHPSESSID=fiq8nr1j9sstegstf2o6btdgq2&topic=286351.0
-
break out patterns in patterns.py in to seperate files. [done]
-
I think it would be helpfull to implement a "Graphics" library [This is done the class is called Graphics]
also implemented a color library, and classes for making color objects. handy for pallets and much more.
more a hardware todo is make firmware for the ESP8266 wifi module that does artnet. no need for utp cables any more. [W.I.P ()] for example this video is what i have been working on.