Skip to content
A Cinder block providing a basic implementation of the OpenPixelControl protocol for controlling large numbers of LEDs in real-time over TCP/IP. Networking provided by the Cinder-Asio block.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
samples
src
.clang-format
.gitignore
cinderblock.xml
license.txt
readme.md

readme.md

Cinder-OpenPixelControl

A Cinder block providing a basic implementation of the OpenPixelControl protocol for controlling large numbers of LEDs in real-time over TCP/IP. Networking provided by the Cinder-Asio block.

Getting Started

Run both the OpcBasicClient and OpcBasicServer samples simultaneously on the same machine to see OPC commands passing from client to (virtual) server.

The utility of a server implementation is somewhat dubious, since that role is usually taken care of by the micro controller (or similar) that's communicating directly with the LEDs — Cinder's much more likely to come in handy creating OPC data rather than consuming it. Nevertheless, the server can be useful for creating simulators and testing layouts. (Similar conceptually to the gl_server example included in the official OpenPixelControl library.)

This library foregoes direct support for JSON layout files, but the OpcLayoutClient and OpcLayoutServer samples provide examples of parsing and using layout JSON.

Channels are currently unsupported.

This implementation is certainly not the leanest out there, but it tries to leverage Cinder's abstractions where possible. (e.g. ci::Color, asio::io_service, etc.)

Origin

The OpenPixelControl spec and reference implementation was created by Ka-Ping Yee.

Micah Elizabeth Scott has done a ton of significant work on top of the OPC protocol for her Fadecandy project, including hardware controllers and OPC wrapper libraries for a number of frameworks and platforms.

Shortly after finishing this block, I discovered James Hurlbut's FadeCandyCinderClient which includes a very similar implementation of the client, and also ports over some of the neat visual effect classes from the Fadecandy project.

Dependencies

This block depends on the Cinder-Asio block. I recommend Jean-Pierre Mouilleseaux fork.

Known Issues

Xcode

Cinder-Asio needs to be added as the first include to the precompiled header file. See the examples for an example. If you forget this step, you will see "No member named 'error' in namespace 'asio::placeholders'" errors and similar.

Mac

If you're running your OPC client or server in the background, App Nap will slow down and eventually completely stop network transmissions.

To disable App Nap, add the following to your app's prepareSettings function:

	settings->setPowerManagementEnabled(true);

The sample projects are already set accordingly.

##TODO

  • Test on Windows.
  • Support for channels.
  • Better support for layout JSON.
  • Usue queue instead of deque for packet accumulation + parsing?
You can’t perform that action at this time.