Revision as of 01:02, 27 October 2016

Contents

Introduction

DMX with case

The DMX interface for raspberry pi allows you to interface a raspberry pi with DMX hardware.

There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)

If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.

Software

There are several software packages that can be used with your DMX interface for Raspberry pi.

First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.

Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".

There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )

Locate your ola-uartdmx.conf (on some systems I'm told it is in /etc/ola/conf/, on others /var/lib/ola/conf/, and in some cases: /root/.ola/ola-uartdmx.conf or /home/pi/.ola/ola-uartdmx.conf. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add /dev/ttyAMA0-break = 100 and /dev/ttyAMA0-malf = 100 . It should then look like:

Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data, and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)

output mode

Then set the board to output mode. I would recommend creating a small script (sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode) :

I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)

Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins

gpio readall

and to set GPIO 18 (BCM) in output mode

gpio -g mode 18 out
gpio -g write 18 1

also, pin 14 & 15 need to be in the ALT5 mode, if this is not the case use

gpio -g mode 14 alt5
gpio -g mode 15 alt5

Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.

This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )