Difference between revisions of "ECE497 Project Programmable Light Show"

From eLinux.org
Jump to: navigation, search
(Executive Summary)
(Work Breakdown)
Line 60: Line 60:
 
== Work Breakdown ==
 
== Work Breakdown ==
  
List the major tasks in your project and who did what.
+
Here are some of the big accomplishments of the project to date:
  
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.
+
* Integrated Blockly (hosted externally) into a web page hosted from the bone
 +
* Added custom blocks to Blockly to 1) track the state of the lights being changed 2) sends the lights that are being changed via the program to the bone via socket.io
 +
* Added an html5 canvas / javascript powered display of the state of the lights to the top of the web display, though it doesn't yet know how to handle the recently added delay function, so it only shows the end result of running the program.
 +
* Added some new socket.io message handling to the server.
 +
* Added message queuing to the server code, allowing it to do things like delays in an intelligent way. This is queuing behavior also lays the groundwork for multiuser handling, as well as "recording" and "playing" back light shows, all of which require something other than "just display the lights when we're told".
  
 
== Future Work ==
 
== Future Work ==

Revision as of 23:03, 17 November 2013


Team members: Taylor Purviance

Executive Summary

The idea of this project is to have a Beglebone controlling a strand of LEDs and drive the LEDs to flash different colors and patterns. The patterns and colors being displayed will be programmed via a simple web interface, allowing anyone to program the lights.

The system works pretty well with a single user, allowing them to program the lights via web interface and have the lights update. Most issues of the light update speed have been rectified and now updates fast enough.

Somewhere, the first light on the chain isn't always getting set properly for some reason (which I suspect is kernel driver related). Also, there's no support yet for remembering your Blockly program if you accidentally close the tab which you were working in, and every programmer knows irreversibly losing code can be infuriating.

The project is actually in a really good position right now, though it isn't ready yet for public / multiuser access. With a few exceptions, it does what it does well and is enjoyable to use and see used, so the focus of future development can be on any of a plethora of possible new features.

Installation Instructions

Give step by step instructions on how to install your project.

  • Include your github path as a link like this to the read-only git site: https://github.com/MarkAYoder/gitLearn.
  • Be sure your README.md is includes an up-to-date and clear description of your project so that someone who comes across you git repository can quickly learn what you did and how they can reproduce it.
  • Include a Makefile for you code.
  • Include any additional packages installed via opkg.
  • Include kernel mods.
  • If there is extra hardware needed, include links to where it can be obtained.

User Instructions

1. Run the setup script

Run the included setup.sh file.

2. Start the boneserver

Start the included boneserver.js file.

3. Navigate a the page via web browser

With the boneserver now running, point your web browser to your bone's IP address on port 8080.

4. Drag and drop blocks

Although there are a plethora of blocks available in blockly, you will likely be interested in the blocks under the "lights" category. One of the blocks if for setting a light at a position to a color. The position value should be between 0 and 159, while the red, green, and blue values should be between 0 and 127. However, this is just queuing up the changes locally. To display the changes you've made, use the send lights block. If you want more than one light to change at the same time, use the set lights block multiple times before using the send lights block. If you're doing some animation, you'll likely want to give it a number of milliseconds to delay after the lights are changed before they will be set again.

5. Click the "run" button

Once you are ready to see your code run, click the "run" button near the top of the web page. If you get a message saying something about "bad code" make sure that your blockly blocks have all of their input spots filled or simplify your design and try again.

Highlights

The thing about this project is that it's really just an enabler; it enables anyone that connects to the server to come up with their own ideas about what they want to have the LED string display, and it lets them do it. That being said, here's a video to demonstrate some of the things you can have it do.

PUT VIDEO HERE

In the video there are 3 things demo'd:

  • A red sine wave and a shorter-wavelengthed red sine wave
  • A single red light the races to the end of the strand and races back blue, then does the same thing but as a group of 10 lights.
  • A simplified no-controls version of pacman, which spawns some random white pellets and has a yellow group of pacman lights go down the strand until he's eaten them all, at which point he blinks a few times to show that he's won.

These are just some of the things someone could make. Creativity and time were my limiting factors for this demo, but I hope to see others make more interesting displays with this tool.

Theory of Operation

LightShowDiagram.png

This diagram gives a good macro-scale view of the design. The Blockly code, both my custom blocks and the default ones, produce and run javascript code in the browser. The blocks that I added also send messages via socket.io to the boneserver. Each message contains a list of the lights that need changed, what they need changed to, and how long the boneserver should wait before processing the next message. The boneserver maintains a queue of the received messages which it process in the order they are received. The contents of the message are read and the bonescript writeToTextFile() method writes the appropriate batch of light changing data to the kernel driver, which then parses those messages and shifts the appropriate data down the light chain.

Work Breakdown

Here are some of the big accomplishments of the project to date:

  • Integrated Blockly (hosted externally) into a web page hosted from the bone
  • Added custom blocks to Blockly to 1) track the state of the lights being changed 2) sends the lights that are being changed via the program to the bone via socket.io
  • Added an html5 canvas / javascript powered display of the state of the lights to the top of the web display, though it doesn't yet know how to handle the recently added delay function, so it only shows the end result of running the program.
  • Added some new socket.io message handling to the server.
  • Added message queuing to the server code, allowing it to do things like delays in an intelligent way. This is queuing behavior also lays the groundwork for multiuser handling, as well as "recording" and "playing" back light shows, all of which require something other than "just display the lights when we're told".

Future Work

Suggest addition things that could be done with this project.

Conclusions

Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.