PI Zero - DMX interface (FT245RL) - Python/C++

633 views
Skip to first unread message

Terry Clark

unread,
Sep 10, 2017, 1:23:58 PM9/10/17
to open-lighting
Hi there,

I have been struggling to find information about how to correctly setup the pi so that I am able to program DMX through a header I bought at BitWizard here.

I would like to plug in the DMX light into the header and from the pi zero send either python and C++ code to the light.

I understand there is an OLA daemon and I am confused whether I need to run this in order to pass the messages across. I am also unsure how I can compile the C++/Python and the OLA Library together.

any help to clarify what i need to do would be amazing! I find that documentation is a bit low or outdated.

I am running newbs on the PIZero also will this cause problems?

Cheers

Terry

Peter Newman

unread,
Sep 10, 2017, 1:43:44 PM9/10/17
to open-lighting
Which documentation have you been looking at? What version of Raspbian is Noobs giving you?

Do you just want to run the BitWizard interface in UART mode to send DMX?

You should just be able to:
sudo apt-get update && sudo apt-get install ola ola-python

Then it just needs some config, see here:
https://wiki.openlighting.org/index.php/OLA_Device_Specific_Configuration#Raspberry_Pi

Arjan van Vught

unread,
Sep 10, 2017, 3:48:37 PM9/10/17
to open-l...@googlegroups.com
Hi Terry,

Your link is referring to "DMX interface for Raspberry Pi with usb (FT245RL)". This is an DMX USB Pro compatible device. See the details here -> http://www.raspberrypi-dmx.org/raspberry-pi-rdm-controller.

When you are intended to use it directly on the host with the OLA server, then the OLA native UART plug-in is used.

Greets, Arjan

Op 10-9-2017 om 18:55 schreef Terry Clark:
--
The Open Lighting Project: open-l...@googlegroups.com, #openlighting (irc.freenode.org)
To unsubscribe from this group, send email to open-lightin...@googlegroups.com
For more options, visit https://groups.google.com/groups/opt_out?hl=en


Terry Clark

unread,
Sep 11, 2017, 12:15:19 PM9/11/17
to open-lighting
Thanks for your reply! Although slightly confused about all of this as I am quite knew to working with headers.

You are correct in that this is my setup from the link you provided. and that the pi is running the OLAD when I go to the IP-ADDRESS:9090 

However, I would like to write a program that interacts with the lights.

Does this mean that I can or cannot run a c++ / python program from the pi Zero to send messages to the header and then to the light?

sorry I am not very expert at this kind of stuff.

Terry Clark

unread,
Sep 11, 2017, 12:18:16 PM9/11/17
to open-lighting
I have been looking at a lot of documentation unfortuantely,

1) on how to use the pi and run software to use it like an entecc box, which I have done before.
2) how to set up the Daemon
3) how to write code in C++ or python to send DMX messages (somehow?? ) <- this is what I want to do.

I thought that this bitwizard interface was so that I could write a program on the pi Zero and send DMX through the interface I have attached. (Please tell me if this is not the case)

Arjan van Vught

unread,
Sep 11, 2017, 2:53:55 PM9/11/17
to open-l...@googlegroups.com
Hi Terry,

When you would like to use the Raspberry Pi Zero to run C++/Python with the OLA server, then you need to configure the board with the native UART plugin. And not using the board as a USB Pro compatible device.

- Arjan
http://www.raspberrypi-dmx.org/

Op 11-9-2017 om 18:15 schreef Terry Clark:

Peter Newman

unread,
Sep 11, 2017, 5:57:29 PM9/11/17
to open-lighting
So there's two parts to this Terry, sending DMX data from OLAd, and getting data into OLAd using the APIs. Assuming you've only got/want to use one Pi, then as Arjan says you want the UART plugin.

So you've got OLAd running, have you done the UART config I linked to as well? There should be a UART plugin in OLA, is it enabled? You should be able to create a new universe, patch the UART plugin to it and the use the OLA webpage to generate some DMX data. I'd get that bit working first if I were you.

Next up is talking to OLAd from one of the APIs, pick an API:
https://www.openlighting.org/ola/apis/

Then just follow the steps to get going. If you installed ola using apt-get, just:
sudo apt-get install libola
or
sudo apt-get install ola-python

Terry Clark

unread,
Sep 12, 2017, 8:27:44 AM9/12/17
to open-lighting
I understand now the issue I was having was conceptual.

The PiZero with the header combined makes an entecc box (understood now). and I need another pi or PC/laptop to do the OLAD and C++ api stuff.

I just thought I could use one pi to speak to the header and send directly out instead of having to use two pi's which would have been a little more succinct hardware wise in my head, but I am sure there is reason for this.

I appreciate the help guys.

Peter Newman

unread,
Sep 12, 2017, 8:45:57 AM9/12/17
to open-lighting
Hi Terry,

You can use it like that.

You either run bare metal code (like an overgrown Arduino) on the Pi Zero and put the board on it, and the whole thing then emulates an Enttec box, which you can plug into another Pi or another device running OLA (or other software).

Or, you run Linux on the Pi, use it's onboard UART for output (via our UART plugin) and just use the board to deal with balancing the RS485 DMX signal. Then you can run OLA and output DMX from the same Pi (as well as running the API code on there too).

Terry Clark

unread,
Sep 12, 2017, 8:53:06 AM9/12/17
to open-lighting
Wicked, I re-read your previous post and this also confirms what I thought originally.

The second option is exactly what I want to do!. So now I will follow all the resources you both sent me and get back to you. 

Thank you very much again!
Message has been deleted

Terry Clark

unread,
Sep 12, 2017, 10:16:09 AM9/12/17
to open-lighting
Peter,

I am very close i think to sorting this.

I have so far

- installed Linux on piZero
- set UART clock speed (no need to do the bluetooth as it is not pi 3)
- sudo apt-get install ola ola-python libola-dev (libola was not found)
- My OLAD is up and running with :

Hostnameraspberrypi
Primary IP0.0.0.0
Primary Broadcast Address0.0.0.0
Primary MAC Address00:00:00:00:00:00
Version0.9.1
StartedTue Sep 12 13:37:41 2017

Which is weird as my ip isn't showing but the UART native DMX plugin is enabled here.

- ran the code using g++ example.cpp $(pkg-config --cflags --libs libola)
and I get this error:

/usr/bin/ld: cannot find -lprotobuf

collect2: error: ld returned 1 exit status



I think there is something i haven't installed yet libprotobuf (watch the install command for this please?)

thanks in advance

Terry Clark

unread,
Sep 12, 2017, 10:22:02 AM9/12/17
to open-lighting
I did it! I needed libprotobuf-dev

Do i need to still setup a universe in OLAD if the UART native DMX plugin is on?

Peter Newman

unread,
Sep 12, 2017, 7:29:15 PM9/12/17
to open-lighting
Sorry, some of the package names change (or I just get them wrong).

Yes next you want to add a universe and patch the UART plugin to it. If it's all working, if you go to the faders for that universe and move them, you should get DMX out.

Then you can make the API bit work (and watch/test by looking at the channel values in the web UI).

The missing IP is probably because OLAd is starting before the Pi's network is up.

Terry Clark

unread,
Sep 13, 2017, 12:19:39 PM9/13/17
to open-lighting
Thanks for that again Peter, 

I have the UART native DMX active and when I look at the devices i'm not sure it's showing a usable device. I see Dummy Device, is this the header?

Sorry for all the questions.


Peter Newman

unread,
Sep 13, 2017, 1:26:19 PM9/13/17
to open-lighting
No, it should show up as a UART device.

We'll probably need to see your OLAd log file. SSH to your pi, run "ps aux | grep -i olad". Then kill that process/stop olad and run the same command again, only changing --log-level or -l to 4 and removing --syslog, -f or --daemon if present and it should spit out lots of logs, if you can copy and paste them all here we can take a look.

Terry Clark

unread,
Sep 15, 2017, 6:08:52 AM9/15/17
to open-lighting
Would this be enough of the log, it is failing to find the device name for the DMX header i think
 

PluginManager.cpp:112: Started USB

PluginManager.cpp:108: Trying to start Pathport

PosixInterfacePicker.cpp:157: skipping lo because it's a loopback

PosixInterfacePicker.cpp:236: Found: wlan0, 192.168.0.10, b8:27:eb:de:dc:7b

InterfacePicker.cpp:92: Using interface wlan0 (192.168.0.10)

Socket.cpp:143: Binding to 0.0.0.0:3792

DeviceManager.cpp:116: Installed device: Pathport [192.168.0.10]:9-1

PluginManager.cpp:112: Started Pathport

PluginManager.cpp:108: Trying to start UART native DMX

UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyACM0

IOUtils.cpp:38: Failed to open /dev/ttyACM0: No such file or directory

UartDmxPlugin.cpp:70: Could not open /dev/ttyACM0 No such file or directory

PluginManager.cpp:112: Started UART native DMX

SelectPoller.cpp:160: ss process time was 0.000015

SandNetDevice.cpp:151: Sending Sandnet advertisement

SelectPoller.cpp:160: ss process time was 0.000015

HTTPServer.cpp:566: Adding 35 as a new socket

SelectPoller.cpp:160: ss process time was 0.001765

SelectPoller.cpp:160: ss process time was 0.000017

HTTPServer.cpp:566: Adding 36 as a new socket

SelectPoller.cpp:160: ss process time was 0.022573

RDMHTTPModule.cpp:834: Adding a new state entry for 1

RDMHTTPModule.cpp:677: Adding UID 7a70:ffffff00 to resolution queue

RDMHTTPModule.cpp:677: Adding UID 7a70:ffffff01 to resolution queue

RDMHTTPModule.cpp:677: Adding UID 7a70:ffffff02 to resolution queue

RDMHTTPModule.cpp:677: Adding UID 7a70:ffffff03 to resolution queue

RDMHTTPModule.cpp:677: Adding UID 7a70:ffffff04 to resolution queue

RDMHTTPModule.cpp:677: Adding UID 7a70:ffffff05 to resolution queue

RDMHTTPModule.cpp:735: sending manufacturer request for 7a70:ffffff00

Universe.cpp:437: Universe 1, RDM request to 7a70:ffffff00, SD: 0, CC 20, TN 0, PID 0x81, PDL: 0

SelectPoller.cpp:160: ss process time was 0.000017

SelectPoller.cpp:160: ss process time was 0.000018

SelectPoller.cpp:160: ss process time was 0.004168

RDMHTTPModule.cpp:747: sending device request for 7a70:ffffff00 

Arjan van Vught

unread,
Sep 15, 2017, 9:45:15 AM9/15/17
to open-l...@googlegroups.com
Hi Terry,

When I check on my Raspberry Zero W, then I have the following :

pi@raspberrypi-zerow:~ $ ls -al /dev/ttyA*
crw-rw---- 1 root dialout 204, 64 Sep  9 16:59 /dev/ttyAMA0

pi@raspberrypi-zerow:~ $
tail /boot/config.txt

enable_uart=1

# OLA DMX Output
dtoverlay=pi3-disable-bt
init_uart_clock=16000000

pi@raspberrypi-zerow:~ $ cat .ola/ola-uartdmx.conf
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Hope this helps.

Greets, Arjan
http://www.raspberrypi-dmx.org/


Op 15-9-2017 om 12:08 schreef Terry Clark:
Message has been deleted

Terry Clark

unread,
Sep 15, 2017, 11:26:18 AM9/15/17
to open-lighting

Hey Arjan,


I have checked all of that and I have the same settings now but still no device showing.

I stopped the initialised version of OLA on PI startup and started again using "olad -l 3" which starts ola fine and I receive the the dmx messages from api messages sent when I run a cpp example into the OLA Daemon so that part is working.

It is not just that i cannot see any UART device coming up for me to select, do I have to have a mini to mini usb to connect between the pi?.

any other ideas on what I may be able to check here.

PluginManager.cpp:112: Started USB

PluginManager.cpp:108: Trying to start Pathport

PosixInterfacePicker.cpp:157: skipping lo because it's a loopback

PosixInterfacePicker.cpp:236: Found: wlan0, 192.168.0.10, b8:27:eb:de:dc:7b

InterfacePicker.cpp:92: Using interface wlan0 (192.168.0.10)

Socket.cpp:143: Binding to 0.0.0.0:3792

DeviceManager.cpp:116: Installed device: Pathport [192.168.0.10]:9-1

PluginManager.cpp:112: Started Pathport

PluginManager.cpp:108: Trying to start UART native DMX

UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA0

UartWidget.cpp:68: Opening serial port /dev/ttyAMA0

UartWidget.cpp:74: Opened serial port /dev/ttyAMA0

UartWidget.cpp:177: Failed to set baud rate to 250k

UartDmxPlugin.cpp:82: Unable to setup device for output, device ignored /dev/ttyAMA0

PluginManager.cpp:112: Started UART native DMX

SelectPoller.cpp:160: ss process time was 0.000013

HTTPServer.cpp:566: Adding 35 as a new socket

SelectPoller.cpp:160: ss process time was 0.001835

SelectPoller.cpp:160: ss process time was 0.000017

SelectPoller.cpp:160: ss process time was 0.020874

SelectPoller.cpp:160: ss process time was 0.000017

SelectPoller.cpp:160: ss process time was 0.000092

SelectPoller.cpp:160: ss process time was 0.000236

SelectPoller.cpp:160: ss process time was 0.001951

Arjan van Vught

unread,
Sep 15, 2017, 12:13:53 PM9/15/17
to open-l...@googlegroups.com
Hi Terry,

Your log is showing :

UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyACM0
The UART/PL011 is device -> /dev/ttyAMA0

olad/PluginManager.cpp:195: Trying to start UART native DMX
plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA0
plugins/uartdmx/UartWidget.cpp:70: Opening serial port /dev/ttyAMA0
plugins/uartdmx/UartWidget.cpp:76: Opened serial port /dev/ttyAMA0
common/io/ExtendedSerial.cpp:76: Port speeds for 25 are 250000 in and 250000 out
common/thread/Thread.cpp:194: Thread , policy SCHED_OTHER, priority 0
plugins/uartdmx/UartDmxPlugin.cpp:92: Started UartDmxDevice /dev/ttyAMA0
olad/plugin_api/DeviceManager.cpp:105: Installed device: UART native DMX:20-/dev/ttyAMA0
olad/PluginManager.cpp:200: Started UART native DMX

Which ola-uartdmx.conf is your OLA server using?

olad/Olad.cpp:94: OLA Daemon version 0.10.5
olad/OlaDaemon.cpp:121: Using configs in /home/pi/.ola

Greets, Arjan


Op 15-9-2017 om 17:23 schreef Terry Clark:
Hey Arjan,

I have checked all of that and I have the same settings now but still no device showing.

I stopped the initialised version of OLA on PI startup and started again using "olad -l 3" which starts ola fine and I receive the the dmx messages from api messages sent when I run a cpp example into the OLA Daemon so that part is working.

It is not just that i cannot see any UART device coming up for me to select, do I have to have a mini to mini usb to connect between the pi?.

any other ideas on what I may be able to check here.

Arjan van Vught

unread,
Sep 15, 2017, 12:16:29 PM9/15/17
to open-l...@googlegroups.com
Op 15-9-2017 om 17:23 schreef Terry Clark:
It is not just that i cannot see any UART device coming up for me to select, do I have to have a mini to mini usb to connect between the pi?.
You are using the DMX USB board with the native UART configuration.  When the attached Raspberry Pi Zero is running the USB Pro firmware, then you use this mini USB for the connection to the OLA server (running on a different host).

Greets, Arjan





On Friday, September 15, 2017 at 2:45:15 PM UTC+1, Arjan van Vught wrote:

Terry Clark

unread,
Sep 15, 2017, 12:44:36 PM9/15/17
to open-lighting

This is my current output and I can confirm that the changes made are all within the config:


UART native DMX

Config Location/home/pi/.ola/ola-uartdmx.conf
Enabled in Config FileYes
ActiveYes

Native UART DMX Plugin
----------------------

This plugin drives a supported POSIX UART (plus extensions)
to produce a direct DMX output stream. The host needs to
create the DMX stream itself as there is no external microcontroller.
This is tested with the on-board UART of the Raspberry Pi.
See here for a possible schematic:
http://eastertrail.blogspot.co.uk/2014/04/command-and-control-ii.html

--- Config file : ola-uartdmx.conf ---

enabled = true
Enable this plugin (DISABLED by default).
device = /dev/ttyACM0
The device to use for DMX output (optional). Multiple devices are supported if the hardware exists. Using USB-serial adapters is not supported (try the ftdidmx plugin instead).
--- Per Device Settings (using above device name without /dev/) ---
<device>-break = 100
The DMX break time in microseconds for this device (optional).
<device>-malf = 100
The Mark After Last Frame time in microseconds for this device (optional).

///// Code from terminal output when running olad -l 3

Olad.cpp:84: OLA Daemon version 0.9.1

OlaDaemon.cpp:114: Using configs in /home/pi/.ola

OlaServer.cpp:494: Updated PID definitions.

OlaServer.cpp:212: Server UID is 7a70:0a00a8c0

HTTPServer.cpp:463: HTTP Server started on port 9090

PluginManager.cpp:77: Skipping FTDI USB DMX because it was disabled

PluginManager.cpp:108: Trying to start ArtNet

DeviceManager.cpp:116: Installed device: ArtNet [192.168.0.10]:2-1

PluginManager.cpp:112: Started ArtNet

PluginManager.cpp:108: Trying to start Dummy

DeviceManager.cpp:116: Installed device: Dummy Device:1-1

PortManager.cpp:154: Patched 1-1-O-0 to universe 1

PluginManager.cpp:112: Started Dummy

PluginManager.cpp:108: Trying to start E1.31 (sACN)

DeviceManager.cpp:116: Installed device: E1.31 (DMX over ACN) [192.168.0.10]:11-1

PluginManager.cpp:112: Started E1.31 (sACN)

PluginManager.cpp:108: Trying to start ESP Net

DeviceManager.cpp:116: Installed device: ESP Net [192.168.0.10]:4-1

PluginManager.cpp:112: Started ESP Net

PluginManager.cpp:108: Trying to start KarateLight

IOUtils.cpp:38: Failed to open /dev/kldmx0: No such file or directory

KaratePlugin.cpp:79: Could not open /dev/kldmx0 No such file or directory

PluginManager.cpp:112: Started KarateLight

PluginManager.cpp:108: Trying to start KiNET

DeviceManager.cpp:116: Installed device: KiNet Device:16-1

PluginManager.cpp:112: Started KiNET

PluginManager.cpp:108: Trying to start Milford Instruments

PluginManager.cpp:112: Started Milford Instruments

PluginManager.cpp:108: Trying to start Enttec Open DMX

IOUtils.cpp:38: Failed to open /dev/dmx0: No such file or directory

OpenDmxPlugin.cpp:80: Could not open /dev/dmx0 No such file or directory

PluginManager.cpp:112: Started Enttec Open DMX

PluginManager.cpp:108: Trying to start OSC

OSCDevice.cpp:88: No targets specified for OSC Output port 0

OSCDevice.cpp:88: No targets specified for OSC Output port 1

OSCDevice.cpp:88: No targets specified for OSC Output port 2

OSCDevice.cpp:88: No targets specified for OSC Output port 3

OSCDevice.cpp:88: No targets specified for OSC Output port 4

DeviceManager.cpp:116: Installed device: OSC Device:14-1

PluginManager.cpp:112: Started OSC

PluginManager.cpp:108: Trying to start Renard

PluginManager.cpp:112: Started Renard

PluginManager.cpp:108: Trying to start SandNet

DeviceManager.cpp:116: Installed device: SandNet [192.168.0.10]:7-1

PluginManager.cpp:112: Started SandNet

PluginManager.cpp:108: Trying to start ShowNet

DeviceManager.cpp:116: Installed device: ShowNet [192.168.0.10]:3-1

PluginManager.cpp:112: Started ShowNet

PluginManager.cpp:108: Trying to start SPI

PluginManager.cpp:112: Started SPI

PluginManager.cpp:108: Trying to start StageProfi

IOUtils.cpp:38: Failed to open /dev/ttyUSB0: No such file or directory

StageProfiDevice.cpp:79: StageProfiPlugin: failed to connect to /dev/ttyUSB0

PluginManager.cpp:112: Started StageProfi

PluginManager.cpp:108: Trying to start Serial USB

PluginManager.cpp:112: Started Serial USB

PluginManager.cpp:108: Trying to start USB

PluginManager.cpp:112: Started USB

PluginManager.cpp:108: Trying to start Pathport

DeviceManager.cpp:116: Installed device: Pathport [192.168.0.10]:9-1

PluginManager.cpp:112: Started Pathport

PluginManager.cpp:108: Trying to start UART native DMX

UartWidget.cpp:177: Failed to set baud rate to 250k

UartDmxPlugin.cpp:82: Unable to setup device for output, device ignored /dev/ttyAMA0

PluginManager.cpp:112: Started UART native DMX

RDMHTTPModule.cpp:677: Adding UID 7a70:ffffff00 to resolution queue

Arjan van Vught

unread,
Sep 16, 2017, 11:21:36 AM9/16/17
to open-l...@googlegroups.com
Hi Terry,

Please will you do a olad -l 4 and grab the output between PluginManager.cpp:108: Trying to start UART native DMX / PluginManager.cpp:112: Started UART native DMX.

Greets, Arjan
http://www.raspberrypi-dmx.org/

Op 15-9-2017 om 18:44 schreef Terry Clark:

Terry Clark

unread,
Sep 17, 2017, 6:50:51 AM9/17/17
to open-lighting

I was soooo close!


I restarted the whole process 

- installed 0.10.5 following these instructions https://opendmx.net/index.php/The_Newbie_Guide_for_OLA_on_Ubuntu
- I compiled an example no issues at all (first time thats happened ha)
- I amended /boot/config.txt and /home/pi/.ola/ola-uartdmx.conf as suggested in the above posts.
- I ran olad -l 3 and it worked! the UART Device appeared! and I could select it (amazing) I think rebooted the pi
- ran olad -l 3 and it wasn't there anymore! (noooo)
- I also test olad -l 4, still not there :(
- Below is the output of olad -l 4 for Arjan (thank for sticking with me on this guys) its very complicated for me ha

olad/PluginManager.cpp:195: Trying to start UART native DMX

plugins/uartdmx/UartDmxPlugin.cpp:67: Trying to open UART device /dev/ttyAMA0

common/io/IOUtils.cpp:39: open(/dev/ttyAMA0): No such file or directory

plugins/uartdmx/UartDmxPlugin.cpp:70: Could not open /dev/ttyAMA0 No such file or directory

olad/PluginManager.cpp:200: Started UART native DMX



The search of ttyA* shows this.

pi@raspberrypi:~ $ ls -al /dev/ttyA*

ls: cannot access /dev/ttyA*: No such file or directory


When before it was showing

crw-rw---- 1 root dialout 204, 64 Sep  9 16:59 /dev/ttyAMA0

Is there a way to start this?

Arjan van Vught

unread,
Sep 17, 2017, 10:26:31 AM9/17/17
to open-l...@googlegroups.com
Hi Terry,

Please can you confirm that you have the following last lines in /boot/config.txt

enable_uart=1

# OLA DMX Output
dtoverlay=pi3-disable-bt
init_uart_clock=16000000
 The `dtoverlay=pi3-disable-bt` is needed when you are using the Raspberry Pi Zero W.

The above would bring back:
pi@raspberrypi-zerow:~ $  ls -al /dev/ttyA*
crw-rw---- 1 root dialout 204, 64 Sep 15 18:17 /dev/ttyAMA0

Thanks, Arjan
http://www.raspberrypi-dmx.org/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi

Op 17-9-2017 om 12:50 schreef Terry Clark:

Peter Newman

unread,
Sep 17, 2017, 7:20:16 PM9/17/17
to open-lighting
Terry, personally I'd recommend sticking with the debs, but it's probably not worth changing now if you can get it to work.

If you just rebooted, I'm struggling to see how your serial port could have dropped out. Unless you either did stuff in raspi-config or /boot/config.txt.
To unsubscribe from this group, send email to open-lighting+unsubscribe@googlegroups.com
Reply all
Reply to author
Forward
0 new messages