aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.rst18
-rwxr-xr-xhost/server.py5
2 files changed, 16 insertions, 7 deletions
diff --git a/README.rst b/README.rst
index 376db26..3230d39 100644
--- a/README.rst
+++ b/README.rst
@@ -1,6 +1,9 @@
Mate Light
==========
-Transform a bunch of empty mate crates to a huge display using a 10 year old laptop, a 13US$ microcontroller board and a couple of cheap chinese christmas lights.
+
+.. image:: http://cbag3.c-base.org/media/cache/artefact_show/uploads/assets/52f6c9c16c72d.jpeg
+
+Transform a bunch of empty mate crates to a huge display using a 14 year old laptop, a 13US$ microcontroller board and a couple of cheap chinese christmas lights.
Hardware Setup
--------------
@@ -19,18 +22,18 @@ Each bottle contains a LED with a WS2801 driver. Each crate contains a chain of
Software
--------
-Currently, there are two versions of the control software around. The terribly slow legacy Python script and the WIP C implementation. The C implementation is about 10.000 times faster than the python script which is why we are working on it.
+The control software is a Python script accepting framebuffer data via UDP and text via TCP. Since it is run on a 900MHz Pentium 3, the two most time-critical pieces, pixel font rendering for scrolling text and USB communication are written in C and called from the Python script via ctypes.
Architecture
~~~~~~~~~~~~
-The server listens on TCP and UDP ports 1337. Any GIF data coming in over TCP is displayed, text is first rendered interpreting ANSI escape sequences (colors, blink etc.) and rendered as a marquee. The UDP port accepts CRAP, our Custom advanced video stReAming Protocol. A CRAP packet contains three bytes of RGB data per pixel in 40 rows of 40 columns (i.e. ``[R0,0 G0,0 B0,0 R0,1 G0,1 B0,1 ... R0,39 G0,39 B0,39 R1,0 G1,0 B1,0 ... R15,39 G15,39 B15,39]``).
+The server listens on TCP and UDP ports 1337. Any text arriving through TCP is rendered as a marquee, interpreting ANSI escape sequences (colors, blink etc.). The UDP port accepts CRAP, our Custom advanced video stReAming Protocol. A CRAP packet contains three bytes of RGB data per pixel in 40 rows of 40 columns (i.e. ``[R0,0 G0,0 B0,0 R0,1 G0,1 B0,1 ... R0,39 G0,39 B0,39 R1,0 G1,0 B1,0 ... R15,39 G15,39 B15,39]``) and an optional trailing CRC32 checksum.
There is at least one further server implementation of CRAP in the form of an `HTML5 CRAP emulator`_. There is `a Python script that plays gifs over CRAP`_.
Related Projects
----------------
* `A Python script that plays gifs over CRAP`_
-* `An HTML5 CRAP emulator`_
+* An `HTML5 CRAP emulator`_
* `A CRAP client for node.js`_
* `Webcam streaming on Mate Light`_
* `A game programming framework for Mate Light`_
@@ -39,9 +42,11 @@ Related Projects
* `Mate Light Android App`_
* `Blinkenlights for Mate Light`_
* `Postillon Newsticker for Matelight`_
+* `Movie Streaming and Live 3D Raytracing for Mate-Light in Javascript`_
+* `An audio spectrum analyzer`_
.. _`A Python script that plays gifs over CRAP`: https://github.com/uwekamper/matelight-gifplayer
-.. _`An HTML5 CRAP emulator`: https://github.com/sodoku/matelightemu
+.. _`HTML5 CRAP emulator`: https://github.com/sodoku/matelightemu
.. _`A CRAP client for node.js`: https://github.com/sodoku/node-matelight
.. _`Postillon Newsticker for Matelight`: https://gist.github.com/XenGi/9168633
.. _`Webcam streaming on Mate Light`: https://github.com/c-base/matetv
@@ -50,3 +55,6 @@ Related Projects
.. _`Game of Life for Mate Light`: https://github.com/igorw/conway-php#mate-light
.. _`Blinkenlights for Mate Light`: https://github.com/igorw/matelight-blm
.. _`Mate Light Android App`: https://github.com/cketti/MateLightAndroid
+.. _`Movie Streaming and Live 3D Raytracing for Mate-Light in Javascript`: https://github.com/MichaelKreil/matelight-playground
+.. _`An audio spectrum analyzer`: https://github.com/c-base/mlaudiospectrum
+
diff --git a/host/server.py b/host/server.py
index 2b42855..c011c82 100755
--- a/host/server.py
+++ b/host/server.py
@@ -164,10 +164,11 @@ if __name__ == '__main__':
elif userver.frame_da():
renderer = userver
else:
- static_noise = False #time() % 300 < 60
- if static_noise:
+ static_noise = time() % 300 < 60
+ if False:
foo = os.urandom(640)
frame = bytes([v for c in zip(list(foo), list(foo), list(foo)) for v in c ])
+ sleep(0.05)
else:
try:
frame = next(defaulttexts)