The Connection Machine LED Matrix

Introduction

We (student research assistants Florian Braun and Vincent Diener) created a Bluetooth-controlled LED matrix that we built into the decommissioned Connection Machine in the Infobau (Bldg. 50.34, 2nd floor) for everyone to see and use.

 

10393998_829432490410564_2836931147000649989_n     10553459_829432483743898_6169206387495467097_n     10606268_829432493743897_7185944170258321804_n

proto1

Writing apps

If you want to write your own apps, please refer to the protocol specification [link] to see how to communicate with the LED matrix.
The test app contains the class LEDMatrixBTConn.java that you can use to easily connect and send data to the LED matrix.

We will be happy to publish your apps on our website teco.edu/cm. If you have written an app and want us to publish it, please send us the code, a short description and a couple screenshots.

Reference app (Android)

We provide code for a simple app that you may use as a reference. It connects to the LED matrix and displays a pattern (shown below). You can download the the source code as Android Studio project [link] and modify/use it in any way you want for your own apps.

If you have questions or feedback, please let us know at diener@teco.edu.

Before starting the app, make sure your device is Bluetooth-paired with “ledpi-teco”. The app only consists of one button. By pressing it, the app will connect to the LED matrix and display the pattern shown below, moving left and right:

cm_pattern

Reference app (PhoneGap)

We also provide a simple reference app for PhoneGap. It is currently only available to students of the Mobile Computing lecture and can be found on the lecture’s ILIAS page.

The PhoneGap reference app implements the protocol described in the “Writing apps”-Section of this page.

Emulator

We provide an emulator for Windows and Linux that includes all the functionality of the real hardware. You can use it to test your apps on your own computer.
You can download it from the MoCIoT VAB (works only with Python 2.7) or get the current version on GitHub (works only with Python 3.x). Make sure you download the correct version of Python, or else the emulator will not work correctly.

The emulator requires the following Python libraries to be present on your system:

On Linux, you can get them by installing the packages python-pyglet, python-numpy and python-bluez.
On Windows, you can download them here: http://www.lfd.uci.edu/~gohlke/pythonlibs/

Screenshot 0     Screenshot 1     Screenshot 2     Screenshot 3

How to use the emulator:

To use the emulator, your system needs to have Bluetooth hardware and the Bluetooth drivers of your operating system have to be set up correctly. Your smartphone has be paired with your computer before attempting to create a Bluetooth connection with the emulator.
You can then start the emulator from the command line with ‘python cm_2015.py‘. Once it’s done loading (3-20 seconds), check the command prompt for any error messages. If there’s nothing, the RFCOMM server should be running. You can also check the logs in the subfolder ‘/logs/events.log‘.

Now just follow the instructions on the screen to connect to the server just like you would connect to to the Connection Machine, as explained in our protocol specification [link].

It is recommended to not connect directly to the Bluetooth address of the server but instead perform a Bluetooth scan from your app first, then select the device by name and get its Bluetooth address from there. You can find out the Bluetooth name of your system in the Bluetooth settings.
This is also preferred because some Bluetooth drivers on Linux report the wrong address to Python (address  sometimes shown as 00:00:00:00:00:00). However, a Bluetooth scan for the device will still reveal the correct address.

In the first few lines of the file ‘cm_2015.py‘, you can change various constants for framerate and resolution. There is also a constant that sets the update speed of the emulator’s LED matrix. To get a feel for how your app looks on the real Connection Machine, try lowering that value to about 10 FPS.
Bugs in the emulator can be reported directly to diener@teco.edu.