Page 1 of 1

UART, GPIO and numbers

Posted: Wed Sep 09, 2015 3:05 pm
by mcallegari
Since when QLC+ was ported to the Raspberry Pi, a lot of feedbacks came into the project and it is now clear that many people are interested in DIY solutions.
Many topics have been discussed in the forum, from touchscreen displays to colorful usages of the 40 IO PINs now offered by RPi model B+ and RPi 2.
A Raspberry Pi can indeed act like a mini PC, but much of its "DIY power" is in its SPI, I2C, GPIO and UART IO.

So I decided to stop the QLC+ 5 developments for a moment and dedicate some time to cover a couple of "hot" topics, introducing 2 new plugins: UART and GPIO.

For those who build from sources, they can already be found on GitHub.
All the other users will have to wait for QLC+ 4.9.2 to be released, which will happen later this month.
Keep in mind that these plugins will not be available on the desktop versions.

UART Plugin

Although still possible, it is nowaday rare to see a RS232 interface on modern PCs (remember those DIN9 connectors ?)
So unless you specifically buy something like this (and hack the DIN9 to a DMX connector...), the new UART plugin is focused on working on embedded devices like the Raspberry Pi or similar, by reproducing the DMX signal on the Tx/Rx PINs.

The reference device with which I tested the plugin is this: DMX interface for Raspberry Pi
The BitWizard team kindly donated a couple of samples of their boards to the QLC+ project. Thank you !

Please note that they have 2 models, with different pricing. One with and one without a FTDI chip.
The FT245 model, mounts a FTDI chip, so you might think that it works out of the box with QLC+. Well, no.
The usage they had in mind with the FTDI version, was to use a Raspberry Pi + the FT245 hat as a "Enttec Pro" compatible adapter.
Basically they wrote a software using the bare metal programming technique, which doesn't provide a full operating system, but just the stricly necessary binary to flash onto a SD card to implement a specific usage.
So basically, this usage has nothing to do with QLC+, which instead runs on a full Debian OS.
You can indeed use the RPi+FT245 solution via USB with QLC+ running on a PC or on another Raspberry Pi. Exactly like if you were using a USB-DMX adapter.

For now the UART plugin supports only data output and in any case the BitWizard board doesn't support simultaneous input/output.
The board works out of the box and the only thing to tweak in the QLC+ RPi image is the data direction which, by hardware default, is set to input.
Setting the output direction can be done in this way (just add these lines in the /etc/init.d/qlcplus file)

Code: Select all

echo 18 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio18/direction
echo 1 > /sys/class/gpio/gpio18/value
GPIO Plugin

This long awaited plugin is finally here !
With GPIO PINs you can do many things and this new plugin is a starting point for ideas and discussions.
For example, those who built foot pedals destroying a USB keyboard :), well, now they can use this plugin natively on the Raspberry Pi, just by wiring a few buttons.

The reference schematics used for tests are the following. (to electronic guys...please don't laugh :D)
As you can see, very easy stuff, even for a software guy like me, struggling to make it on electronics exams at school :)

For now the plugin supports very basic digital states (high/low) either in input or output.
Depending on the feedbacks I will receive, more developments can go into this plugin, for example to have PWM output, encoder readings, or even more complex usages I might not even think about right now.

Project numbers

Last but not least, I'd just like to share a few numbers of the QLC+ project.
This is a pure self-satisfactory section of this article (kidding ;)) simply to say that the project is incredibly active and constantly growing each month.
Even if he doesn't read this, I would like to thank again Heikki Junnila, original creator of the QLC project. Without him, all this would not have been possible.

130000+: visits on the website (6000+ each month)
64000+: views of the official YouTube videos
10000+: posts on the forum
3000+: downloads per month (counting and SourceForge)
3000+: changes to the QLC+ sources (an average of 1000+ per year)
40: contributors to the project sources (but many more if we count fixtures)

So a big thank you to everyone who contributed to these results !

Re: UART, GPIO and numbers

Posted: Thu Sep 10, 2015 10:04 pm
by mumbles
Cann't wait to try this out! Ill probably try out GPIO's this weekend. My plan is to trigger scenes with motion sensors and photo beams. To make light shows interactive.

Keep up the good work Massimo!

Re: UART, GPIO and numbers

Posted: Thu Sep 10, 2015 10:23 pm
by mumbles
If the PWM was active I wonder how well an ultrasonic or GEO sensors would work to track a person across a stage automating Spots or chaser scenes for back lighting?

Also PWM would be really nice just for encoder use!

Re: UART, GPIO and numbers

Posted: Tue Jan 31, 2017 4:57 am
by SherwoodBC
While you are at the Serial Port changes, is it possible to have an option where the break at the start is skipped? As long at QLC leaves mark time between packets (MTBP) which is at least several byte times long then this would be sufficient for an embedded project to detect the frames. Make life a lot easier on Arduino projects trying to receive it.