GPIO plugin on other platforms?... for config only

All the topics related to QLC+ on the Raspberry Pi
Post Reply
User avatar
rawbengal
Posts: 18
Joined: Fri Jul 10, 2015 5:23 am
Location: Los Angeles, CA, USA
Real Name: Rob Engle

I am working on a project in which I am doing all my show programming on a Mac and then transferring the finished project to a Raspberry Pi for playback. I am using the GPIO plugin which (currently) is only available on the RPi. I have noticed one problem with this setup is that I need to be on the RPi in order to configure the GPIO pins. For my own build on the Mac, I have included the GPIO plugin and modified it to do a runtime test of the existence of GPIO support.

Essentially, in the plugin ::init method, I am setting a variable indicating if '/sys/class/gpio' exists and then disabling all the file and IO operations if it doesn't.

So, is there any interest in me submitting a merge request with this change? It seems like this may go against the philosophy of how things are set up in QLC+ since several of the input/output plugins available seem to be dynamic with the machine you are on.

Rob
User avatar
mcallegari
Posts: 4481
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

The GPIO plugin is disabled on desktop platforms on purpose.
It is quite dangerous to act on GPIOs of a PC, so it's not a good idea to enable it by default. (so I won't merge such change, sorry)

What you can do is this:
1- create your project on your PC
2- transfer it on the RPi
3- configure the GPIO plugin on the Pi and save the project again
4- copy it back to the PC and open the qxw file with a text editor. Copy the whole <InputOutputMap> section in another text file
5- every time you edit the project on your PC, before transferring it to the RPi, replace the <InputOutputMap> section back again

This is a safe way which preserves the IO mapping.
User avatar
rawbengal
Posts: 18
Joined: Fri Jul 10, 2015 5:23 am
Location: Los Angeles, CA, USA
Real Name: Rob Engle

It is quite dangerous to act on GPIOs of a PC, so it's not a good idea to enable it by default.
I was not aware that there are any desktop machines with GPIO support let alone dangerous GPIO hardware exposed to an unprivileged user.

I suppose I could just do:

Code: Select all

m_hasGPIO = QLCFile::isRaspberry()
instead of:

Code: Select all

m_hasGPIO = QDir("/sys/class/gpio").exists();
Does that work?

Any solution that requires copying contents of the .qxw file does not work in my situation because the guy eventually doing the show programming is not a technical user. It needs to be as simple as "save this file and copy it to the RPi (or transfer it via the web interface)." I *love* that QLC+ uses XML for the .qxw format so that we can inspect and edit it but, I prefer not to rely on that for normal use.

If needed, I'll keep this in my local fork but it seems the general problem of being able to set up a project on one machine and easily transfer it to another could be improved.

thanks again!
Rob
Post Reply