Unable to control GPIO outputs

All the topics related to QLC+ on the Raspberry Pi
Post Reply
bikeNomad
Posts: 8
Joined: Fri Oct 22, 2021 4:59 pm
Real Name: Ned Konz

I'm trying to get an animatronic display working by this Friday, and need to use the GPIO outputs (and inputs if I can).
I am able to use a homemade FTDI DMX adapter to control DMX lights.

However, I can't get GPIO outputs to work.

I have the qlcplus_raspios_buster_20210627 image loaded on my Raspberry Pi 4.

I'm able to control the GPIO outputs via the /sys/class/gpio tree from the command line.

I've defined a fixture with 32 dimmer channels (numbered 1-32), and assigned it to universe 2, which is using the GPIO driver for inputs and outputs.

However, I"m unable to control the GPIO outputs (trying to use GPIO 18, I'm changing the values of the DMX channel 19 and I don't see any change across the range of output values from 0 to 255).

It doesn't make any difference if I do

Code: Select all

       echo 18 > /sys/class/gpio/export
       echo out > /sys/class/gpio/gpio18/direction
first before running QLC+.

I've tried using "-d 3 -g" in my QLC+ command but saw no messages in the QLC+.log file. However, I don't know how this output stream is buffered (I killed QLC+ by closing its X window) so I don't know whether it was trying to say something.

What can I do to get this working?

Thanks in advance.
QLC+ really would be great for my application if I could get it to work.
bikeNomad
Posts: 8
Joined: Fri Oct 22, 2021 4:59 pm
Real Name: Ned Konz

Is there any more information I can give that would help?
bikeNomad
Posts: 8
Joined: Fri Oct 22, 2021 4:59 pm
Real Name: Ned Konz

I've installed the latest buster image on my Pi4.

I want to use GPIO outputs to control animatronics.

I've defined a GPIO fixture with 30 or so dimmer channels.

I can control the GPIO from the command line via the /sys/class/gpio tree.

I've read the QLC+ GPIO controller code, and that is apparently what it's using as well.

However, nothing I do in QLC+ causes any change to the GPIO lines.

I've tried turning the debug level up to 3 and turning on logging, but see no log messages either on stderr or in the QLC+ log file

Further, I don't see any GPIO files being opened, gpios being exported, etc.

I'm about to give up on QLC+ altogether (or maybe just use it for controlling my PAR lights and playing sounds, though I keep getting sound underruns on a 16-bit mono 44100 sps file).

Has anyone gotten GPIO to work with this image? If so, how did you do it?
User avatar
mcallegari
Posts: 4482
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

[moderator] don't open a new thread with the same information just to get more attention. I moved the content here.

If the latest image is broken, have you tried with an older image?
If you look at this post (viewtopic.php?f=7&t=14656) GPIO was working up to last year.
Have you tried with simple desk too?
Btw release versions don't have debug messages!
You need to build QLC+ (or the GPIO plugin) yourself to see what's happening
bikeNomad
Posts: 8
Joined: Fri Oct 22, 2021 4:59 pm
Real Name: Ned Konz

Sorry about the duplicate threads.

I've tried simple desk, and have seen no GPIO activity.

I've also tried watching it with strace, and have seen no attempt to even open any of the /sys/class/gpio files.

I see no GPIOs being exported.

I have tried versions 4.12.4, 4.12.3, and 4.12.2 (installing the .deb files using dpkg then rebooting), with no change, testing with Simple Desk and the DMX keypad.

Do I need to burn a new SD card to try these earlier versions (I suppose I would for the Stretch versions).

Have people had success using GPIO on 4.12.3 or 4.12.2?

I have defined a Generic fixture with 20 channels starting at channel 1 (trying to get GPIO18/DMX19 to work).

I have also tried defining a Generic fixture with 1 channel starting at channel 19.

BTW, I have also seen that if I have multiple network interfaces up (even if one doesn't have an ipv4 address) the web interface does not appear (I would expect that QLC+ would listen on 0.0.0.0 but that doesn't seem to be the case).
bikeNomad
Posts: 8
Joined: Fri Oct 22, 2021 4:59 pm
Real Name: Ned Konz

I have just tried burning a new SD card with the 4.12.2 (buster 20190825) image, and it also does not do anything with the GPIO (no exports, no open files in the /sys/class/gpio tree as reported by /proc/PID/fd).

Do I need to try a Stretch image?
bikeNomad
Posts: 8
Joined: Fri Oct 22, 2021 4:59 pm
Real Name: Ned Konz

I'm compiling my own, and it looks like the GPIO and UART plugins aren't being built.
I'm trying again, having uncommented the uart and gpio lines in plugins/plugins.pro.
User avatar
mcallegari
Posts: 4482
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

You don't need to build the whole QLC+ sources tree.
Make sure variables.pri is in debug (as it is right now on git) and go to plugins/gpio
Run qmake and make and that's it.
Copy the plugin .so file in /usr/lib/arm-linux-gnueabihf/qt5/plugins/qlcplus or simply run sudo make install.
Then launch qlcplus -d and let me see the debug messages.
bikeNomad
Posts: 8
Joined: Fri Oct 22, 2021 4:59 pm
Real Name: Ned Konz

When I compiled, I saw that debugging was disabled. So I edited variables.pri and re-compiled.
Now I have debug messages (BTW, the --help output implies that "-d 3" sets the debug level to maximum; this is incorrect. -d by itself enables debug messages, but "-d 3" turns them off).
Anyway, after enabling the commented-out debug messages in gpioplugin.cpp, I see the following possibly-relevant messages when I add a 30-channel Generic fixture to the GPIO universe:

Code: Select all

[SetParameter] 0 0 "UniverseChannels" "30"
[GPIO] invalid parameter name! "UniverseChannels"
I've attached a full debug log (from the console; I tried "qlcplus -d -g" but it did not log to a file).
This was a session in which I defined Universe 1 as having GPIO for input and output, then added a 30-channel Generic fixture to that universe and went to Simple Desk to move sliders.
Attachments
rpi_debug.txt
debug log showing GPIO issues
(6.19 KiB) Downloaded 69 times
bikeNomad
Posts: 8
Joined: Fri Oct 22, 2021 4:59 pm
Real Name: Ned Konz

The backtrace at the "invalid parameter name!" point was this:

Code: Select all

1 GPIOPlugin::setParameter        gpioplugin.cpp  395 0xa8318130
2 OutputPatch::setPluginParameter outputpatch.cpp 148 0xb6ef209c
3 Universe::dumpOutput            universe.cpp    702 0xb6f1ded8
4 Universe::processFaders         universe.cpp    312 0xb6f1c43c
5 Universe::run                   universe.cpp    336 0xb6f1c584
6 ??                                                  0xb58d8b58
7 start_thread                                        0xb57f8494
and the "UniverseChannels" name came from the macro "PLUGIN_UNIVERSECHANNELS".
Post Reply