Page 1 of 1
OLA Python API needed
Posted: Sat Sep 10, 2016 3:33 pm
by philipptrenz
Hi there,
I'm new at the new forum, but generally not new to QLC+, Linux, Raspberry Pi and so on.
For a small project, I want to be able to switch wireless sockets over 433.92MHz frequence via QLC+ in an own universe. Therefore I wrote a small Python Script using the OLA Python API to receive inputs to interpret them for sending signals to the sockets. I now wanted to bring it together with the latest QLC+ Raspberry Pi image and saw, that OLA is already installed. That's pretty amazing. But the Python API seems to be missing.
I wasn't able to install it from the OLA repository, seems to not fit together with the installed OLA. Does anyone know a simple way to get the Python API installed?
Thanks!
Re: OLA Python API needed
Posted: Sat Sep 10, 2016 5:14 pm
by mcallegari
Maybe you need to build OLA from sources for the Raspberry Pi.
Apparently they haven't updated their repositories in a while, so you need to follow the instructions here
https://wiki.openlighting.org/index.php ... spberry_Pi
Re: OLA Python API needed
Posted: Sat Sep 10, 2016 5:19 pm
by philipptrenz
I guessed it ...
Okay, if it wouldn't take that long ...
Is it a big thing to integrate the Python Libs of OLA into the next image release? Do you also compile OLA for the image?
Thanks a lot!
Re: OLA Python API needed
Posted: Sat Sep 10, 2016 5:33 pm
by philipptrenz
Thanks Massimo,
I hoped to get around this.
Do you compile OLA for the images? If so would it be possible to compile the next time with python libs? Not sure if I'm the only one using this, but in my opinion OLA is a pretty good wrapper to write some custom applications for "virtual dmx" and python is perfect for beginners also than experts.
Would be very grateful!
Re: OLA Python API needed
Posted: Sat Sep 10, 2016 7:29 pm
by mcallegari
Do you compile OLA for the images?
No. I installed the OLA package available on the Jessie repositories:
https://packages.debian.org/jessie/armhf/ola
As you can see, it's a pretty old version but it seems there's also the python package:
https://packages.debian.org/jessie/armhf/ola-python
Try to install it
Re: OLA Python API needed
Posted: Tue Sep 13, 2016 4:28 pm
by philipptrenz
Installing from repository didn't worked for me. I compiled OLA in version 0.10.2
For everyone reading this and having the same in mind:
1. Run this command to install all needed libraries and programs
Code: Select all
sudo apt-get update
sudo apt-get install rpi.gpio git libcppunit-dev libcppunit-dev uuid-dev pkg-config libncurses5-dev git libtool autoconf automake libmicrohttpd-dev g++ libmicrohttpd-dev protobuf-compiler libprotobuf-lite9 python-protobuf libprotobuf-dev libprotoc-dev zlib1g-dev bison flex make
2. For compiling on a Raspberry Pi you have to use the
CXXFLAGS='-ftrack-macro-expansion=0' at the end of your ./configure command, otherwise g++ runs out of RAM. This worked for me:
Code: Select all
./configure --enable-python-libs --disable-milinst CXXFLAGS='-ftrack-macro-expansion=0'
3. The 'make' took several hours for me, make shure you have a beer in the fridge
--------------------------------------------------------------------------------------------------------
OLA now works fine, but QLCPlus does not. It says 'Illegal instruction' when trying to start it with regular user. Does it need root rights?
The service says
Code: Select all
qlcplus.service - LSB: Q Light Controller Plus
Loaded: loaded (/etc/init.d/qlcplus)
Active: active (exited) since Tue 2016-09-13 16:03:24 UTC; 23min ago
Shouldn't it be
active(running)? Where can I find the log files for qlcplus while running as service?
Has QLC+ dependencies to OLA? Before I installed the compiled program I removed the original OLA from the image.
Thanks!
Re: OLA Python API needed
Posted: Wed Sep 14, 2016 7:27 am
by philipptrenz
I now tried the original image again (qlcplus_raspbian_jessie_20160529.img) and even there qlcplus does not start.
At boot the service says [ok], but I have no process running. I run the image on a Raspberry Pi B+. Is this a known issue?
How can I debug the service?
Re: OLA Python API needed
Posted: Thu Sep 15, 2016 7:27 am
by mcallegari
As stated here:
http://www.qlcplus.org/raspberry.html and in the PDF guide, that image supports only RPi 2 and 3 models.
Since I received a lot of requests to have Raspberry Pi 1 (and Zero) support back, the next image will restore the compatibility.
To me it seems a bad idea to run QLC+ on such limited devices when RPi2/3 offer much more power...but still....