Giter Site home page Giter Site logo

jessecobra / beaglebone-dmx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from boxysean/beaglebone-dmx

0.0 1.0 2.0 377 KB

Library to turn BeagleBone into a DMX interface

Perl 0.32% Python 1.87% C 96.30% JavaScript 0.47% Shell 0.13% OpenEdge ABL 0.92%

beaglebone-dmx's Introduction

Output DMX from your BeagleBone

DMX is a standard in the lighting industry and is used in applications from architecture to art installations to stage production.

Build instructions

  1. build pasm by cding into pasm/pasm_source and running the appropriate pasm build script (linux, mac, windows)
  2. type make in the project's root directory

Features

  • Client-server architecture. One of the cool things about the client-server setup is that the client can either be on the BeagleBone or your computer. This makes it easy for both testing and production.

  • DMX interface and controller combined. Not only can you use this as a DMX interface for your computer, but now the BeagleBone can be a dedicated DMX controller.

  • Extensible. You can use this with all the other features that the Bone gives you, like an Ethernet port for easy Internet connection Internet, or add your own custom hardware interface to it.

  • Easy to use. You won't have to worry about the DMX protocol or low-level code. The client-server architecture allows you to control the DMX from python, Processing, OpenFrameworks, or whatever high-level languages with their awesome interactive libraries.

  • Example DMX client scripts. This comes with example client scripts in the controller directory to help you get started with your idea.

  • Cheap. No longer do you need a Mac Mini and ENTTEC DMX interface to run your lighting installation. Now all you need is an $80 (ahem now $45!) BeagleBone and a $5 circuit.

How to run: Software

  1. Run modprobe uio_pruss. *Note that step #1 is only valid with older pre 3.8 kernels such as the original Beaglebone (white). Since kernel 3.8 (BeagleBone black shipping or any newer Angstrom image for example) you should enable it in the device tree layout instead of modprobe (/boot). One persistent method is explained in the Issues #2 thread. Issue #2
  2. Launch DMX server: cd into bin and run ./dmx
  3. Launch DMX client: run a DMX client script, e.g., cd contollers; python cycle.py

How to run: Hardware

  1. Make this circuit.
  2. Connect pin 12* of the BeagleBone's P8 header to the input (pin 4) of the IC. (*Note: this was recently changed to pin 12 from pin 3 to accomodate both the original Beaglebone and black variant. See dmx.c history for details.)
  3. Connect pins 5, 6, and 7 to ground, signal, and signal inversion respectively to target unit.

image of DMX circuit

You can change the Bone's pin by editing the defined pin and local export/unexport in src/dmx.c and recompiling.

DMX Server Protocol

The DMX server expects UDP string packets in the following format:

N <value1> <value2> ... <valueN>

N refers to the number of channels, and valueI is the value of the Ith channel, an integer between 0-255. A single space is expected between the values, and there should be no space after the last value.

Send these packets to port 9930 on the BeagleBone. You can change the port by editing the variable in src/dmx.c and recompiling.

Production Mode

It's possible to make the DMX client and/or server launch when the BeagleBone boots up. Follow these instructions.

Benchmark

BeagleBone rev A6 running both the DMX server and a DMX client written in python. The client sends 1000 updates messages back-to-back, changing all 512 channels.

root@beaglebone:~/workspace/beaglebone-DMX/controllers# time python performance.py 1000

real    0m11.088s
user    0m8.610s
sys     0m0.120s

1000 frames updating all 512 channels takes 11.088s, which is about 90 FPS. No packet drops by the server.

How it works

This library takes advantage of the BeagleBone's PRU (Programmable Realtime Unit). The DMX server passes the DMX values to the BeagleBone's PRU, which is constantly bit-banging the DMX protocol in realtime. (Read more.) The hardware circuit converts the bit-banged protocol into RS-485, which is what all standard DMX units expect. For help with the newer kernel 3.8 device tree, gpio names, pin #s and assignments this was a good resource derek molloy boneDeviceTree docs.

beaglebone-dmx's People

Contributors

boxysean avatar jessecobra avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.