UART native DMX on raspberry

593 views
Skip to first unread message

Jerome Breheret

unread,
Oct 5, 2014, 5:30:45 PM10/5/14
to open-lighting
Hi,
I try to set up  a raspberry to use it with native UART dmx output and can't get it work.

here are the way I set it up
I follow instructions from page http://www.openlighting.org/ola/tutorials/ola-on-raspberry-pi/
Downloaded the latest ola-git image.

$ git pull
$ autoreconf
$ ./configure
$ make
$ sudo make install
$ sudo ldconfig

where fine without any errors

but when I start olad i got this in my log:

olad/PluginManager.cpp:108: Trying to start UART native DMX
common/io/ExtendedSerial.cpp:69: Port speeds for 26 are 9600 in and 9600 out
olad/DeviceManager.cpp:116: Installed device: UART native DMX:20-/dev/ttyAMA0
olad/PortManager.cpp:118: Patched 20-/dev/ttyAMA0-O-0 to universe 1
olad/PluginManager.cpp:112: Started UART native DMX

seem that UART is setup at 9600
looking signal on txt pin of raspberry, DMX time are not good, and so DMX device not repond

how i can correct this to have it working ?

@+
Jerome

Sean Sill

unread,
Oct 6, 2014, 2:43:04 PM10/6/14
to open-l...@googlegroups.com
I think on the pi there are some kernel settings that you have to set for the baud rate. I don't know where they are but it needs to be set to 250000 baud not 9600. If Richard doesn't comment on here its in the forums somewhere.

Sean Sill

unread,
Oct 6, 2014, 2:44:33 PM10/6/14
to open-l...@googlegroups.com

Jurrie Overgoor

unread,
Oct 6, 2014, 3:20:26 PM10/6/14
to open-l...@googlegroups.com
And also check http://fw.hardijzer.nl/?p=138 That link has helped me a lot.

WIth kind regards,

Jurrie

Richard Ash

unread,
Oct 6, 2014, 4:17:37 PM10/6/14
to open-l...@googlegroups.com
On Mon, 6 Oct 2014 12:20:26 -0700 (PDT)
Jurrie Overgoor <jurrieo...@gmail.com> wrote:

> And also check http://fw.hardijzer.nl/?p=138 That link has helped me
> a lot.

> On Monday, October 6, 2014 8:44:33 PM UTC+2, Sean Sill wrote:
> >
> > You should read through this.
> >
> > https://groups.google.com/forum/#!searchin/open-lighting/uart$20raspberry$20pi/open-lighting/PaqE0uc0nVk/8QskK5CV93QJ

Yes, the changes to raise the clock rate supplied to the UART are
essential to getting the system to work. Without them you can't exceed
115.2kbaud, and most attempts fall back to a low rate, as you
have found. I'm glad I left that message reporting the actual baud rates
in! We should do more with them, i.e. check the values and fail the
plug-in if they are not correct!

I suspect that 9600 is a default value which is selected if the rate
requested is not possible with the present clock settings. This is
useful to know for adding better diagnostics as well.

I wonder if we can convince Simon to alter the /boot/config.txt file on
the ola image to include these changes out of the box? It would make
life a little easier for new users, and I don't think it affects
anything else (probably a nominal power consumption increase in the
UART, but nothing to worry about).

Something to add to
http://www.opendmx.net/index.php/Building_a_Custom_Raspbian_Image
?

Richard

Jerome Breheret

unread,
Oct 6, 2014, 4:28:34 PM10/6/14
to open-lighting
hi,
thx for informations about adding init_uart_clock=16000000 to the /boot/config.txt I missed this
it would be a good idea to add it somewhere in pages about ola on raspberrypi

change was made and it's work



@+
Jerome


--
The Open Lighting Group: 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

Sean Sill

unread,
Oct 6, 2014, 4:31:57 PM10/6/14
to open-l...@googlegroups.com, ric...@audacityteam.org
Adding them to our raspbian image is probably a great idea! Also do you have access to the wiki? If not you can either ask Simon for it or write it up for others and I can try to stick on the webpage or wiki.

Simon Newton

unread,
Oct 7, 2014, 9:38:16 AM10/7/14
to open-lighting, Richard Ash
Please open a pull request against
https://github.com/OpenLightingProject/raspberrypi . That's what I use
to build the raspi images.

Simon

Peter Newman

unread,
Oct 10, 2014, 7:24:12 AM10/10/14
to open-l...@googlegroups.com, ric...@audacityteam.org
I've added it to http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX . As you say, it would be good if OLA flagged up/failed the plugin when it hadn't achieved the right speed. It would also be good if the config change required was in the plugin description within OLA. Want to open another PR for that Richard?

Jerome Breheret

unread,
Oct 15, 2014, 1:20:23 PM10/15/14
to open-lighting
that's done !


@+
Jerome

Christian Windeck

unread,
Nov 16, 2014, 10:39:22 AM11/16/14
to open-l...@googlegroups.com
I'd like to add that setting init_uart_clock=16000000 didn't give correct timings for me.
But it worked well with setting the clock to 6500000.


Sean Sill

unread,
Nov 16, 2014, 1:41:57 PM11/16/14
to open-lighting

Hey christian did you have your pi over clocked or at stock?

On Nov 16, 2014 10:52 AM, "Christian Windeck" <wind...@gmail.com> wrote:
I'd like to add that setting init_uart_clock=16000000 didn't give correct timings for me.
But it worked well with setting the clock to 6500000.


Christian Windeck

unread,
Nov 16, 2014, 1:55:19 PM11/16/14
to open-l...@googlegroups.com
My pi was and is clocked at default 700MHz

Sean Sill

unread,
Nov 16, 2014, 2:24:05 PM11/16/14
to open-l...@googlegroups.com
That's probably the difference then. Richard did you overclock yours?

Peter Newman

unread,
Nov 16, 2014, 6:57:32 PM11/16/14
to open-l...@googlegroups.com
I don't know about Richard, but jblb's was judging by this PR:
https://github.com/OpenLightingProject/raspberrypi/pull/1

Perhaps we need to do something cleverer in the plugin to handle all uses cases, or at least report when it hasn't generated the right speed.

Steve French

unread,
Nov 18, 2014, 9:35:38 AM11/18/14
to open-l...@googlegroups.com
Peter,
Sorry for the dumb question, but how do you know when the UART is set to the right speed?  I know the lights will start working, but from an oscilloscope standpoint, when you are looking at the DMX data stream what do you measure?  Do you look for the low pulse width with the smallest time and do BaudRate = 1 / (min pulse width)?  By this logic the minimum pulse width should be 1 / 250kHz = 4uS.  What do *you* measure?  Thx!

respect,
Steve French

Peter Newman

unread,
Nov 18, 2014, 4:13:20 PM11/18/14
to open-l...@googlegroups.com
I haven't measured anything :), but I think Richard mentioned, and having checked, the code does read back the speed after setting it:
https://github.com/OpenLightingProject/ola/blob/master/common/io/ExtendedSerial.cpp#L69

Although it doesn't currently do anything if the speed isn't correct.

Sean Sill

unread,
Nov 18, 2014, 4:26:15 PM11/18/14
to open-lighting
If you want to measure with an oscope you should set all the bytes to 0. Then watch for the > 80us break. Then on the next falling edge measure to the rising edge. It should be 9 bit times. So 1/250000 = 4us 4us x 9 = 36us.
--
Sean Sill
Electronic Systems Consultant/Contractor
Electrical and Computer Engineering Alumni from
Missouri University of Science and Technology(Missouri S&T)

Richard Ash

unread,
Nov 22, 2014, 12:00:35 PM11/22/14
to open-l...@googlegroups.com
On Sun, 16 Nov 2014 11:24:05 -0800 (PST)
Sean Sill <sms...@gmail.com> wrote:

> That's probably the difference then. Richard did you overclock yours?
Yes, I think it is (I followed the recommendation on the Ola Pi page, I
think). I'm surprised overclock has this effect, because the UART
driver is smart enough to work out the correct multiplier based on the
clock rate configured on the command line (this fix has been in
Raspbian since before I started), which is supposed to make the speed
selection clock-independent (the clock only restricts the range which
can be selected).

The ola code does read what the UART reports as the achieved in/out
speed, but all it does is log it - there is no check / error if it is
out of range.

Christian, I'd really like to know what speeds the log on the Pi
reported when you were getting the wrong speed. I know without the
parameter at all, you end up set to 9600 baud (I have an ongoing todo
item to catch this case and print something informative), I would like
to know what happens in your case as well.

Can you confirm that you are using a reasonably up-to-date Raspbian
image on your Pi - it sounds like I need to do some testing!

Back in this list archive somewhere (22/02/2014 'Raspberry Pi built-in
UART') is a simple C program I wrote for checking if the correct baud
rate is achieved, which sends a magic byte value to produce a continuous
square wave (at the bit period), which is what I used for most of my
testing. This is easier than full DMX waveform to inspect with an
analogue scope!

Richard
Reply all
Reply to author
Forward
0 new messages