[go: up one dir, main page]

Menu

Deployment

MeduZaPaT Chris Newton
There is a newer version of this page. You can find it here.

Building LEDSpicer

Preparing

Upgrading

To upgrade ledspicer simply follow the install steps.

Assumptions

  • You have an updated version of the OS that supports C++11.
  • You have updated libraries.
  • Installation directories are:
    • prefix=/usr
    • configs are located on /etc

If any of this assumptions is different for your system, change whatever is necessary.

The easy way is to install from the PPA providing binary packages in DEB format for PC and arm.
Or you can building it from source code.

Install from PPA (Ubuntu and derivatives only)

Follow the PPA tutorial.

Install from source:

Needed programs and libraries

Essential:

build-essential (with a C++11 compiler)
pkg-config
autoconf (autotools)
libtool (name maybe different for other distributions)
aclocal

I found that different distros install or not this programs by default, if not, I added an error / solution section.

Libraries:

libusb-1.0
tinyxml2 6.0
libpulse-dev (for pulseaudio plugin)
libpthread-stubs0-dev

Debian/Ubuntu based systems just get them by:

sudo apt install build-essential pkg-config libtool libtinyxml2-dev libusb-1.0-0-dev libpthread-stubs0-dev -y
#optional for pulseaudio plugin:
sudo apt install libpulse-dev -y

Check the version of tinyxml, it should be 6 or more
use this command to find it:

pkg-config --short-errors --modversion tinyxml2

Installing

Get the code

Two options
1 git clone https://github.com/meduzapat/LEDSpicer.git OR git clone https://git.code.sf.net/p/ledspicer/code ledspicer-code
2 download the tar.gz file and decompress
Is up to you, both ways will retrieve the same code.

Prepare tools

1. Run autogen to generate configure script.

cd LEDSpicer # (or whatever the name you used to get the source code)
./autogen.sh

2. Then run configure, the prefix and systconf can be other directories, I just used the most common ones.
You will need to add here any controller hardware you want to include (you can add multiple controllers):

  • --enable-nanoled Enables the output plugin nanoled [default=no]
  • --enable-pacdrive Enables the output plugin pacdrive [default=no]
  • --enable-pacled64 Enables the output plugin pacled64 [default=no]
  • --enable-ultimateio Enables the output plugin ultimateio [default=no]
  • --enable-ledwiz32 Enables the output plugin ledwiz32 [default=no]
  • --enable-howler Enables the output plugin WolfWare Tech Holder [default=no]
  • --enable-raspberrypi Enables the output plugin RaspberryPi GPIO (only on That platform) [default=no]

Possible errors:
error:

./autogen.sh 
configure.ac:24: error: possibly undefined macro: AC_LIBTOOL_DLOPEN
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

solution:

apt install libtool

error:

bash: pkg-config: command not found

solution:

apt install pkg-config

error (same for any other library):

checking for PTHREADSTUBS... no
configure: error: pthread development library not found.

solution:

apt install libpthread-stubs0-dev

For more details run ./configure --help

./configure CXXFLAGS='-g0 -O3' --prefix=/usr --sysconfdir=/etc 

if you get an error go back to step #1

3. Then compile with:

make

Install

sudo make install

4. Set rights for normal users (this step is optional if you want to run as root, root already have access to the USB and inputs):

Add your user to users and input groups:

sudo usermod -a -G users user #replace user with your username
sudo usermod -a -G input user #replace user with your username

Copy 21-ledspicer.rules rules file.

sudo cp /usr/share/doc/ledspicer/examples/21-ledspicer.rules /etc/udev/rules.d/
sudo chmod 744 /etc/udev/rules.d/21-ledspicer.rules
sudo udevadm control --reload-rules && udevadm trigger

6. Copy and edit config

sudo cp /usr/share/doc/ledspicer/examples/ledspicer.conf /etc

Now you need to edit your config file with your hardware values or use LEDSpicerUI (very experimental) to create one for you.
Follow this guide if you need help.

7. Tests

After this you will be all set, to test the program run this:

ledspicerd -v

and to test the configuration run:

ledspicerd -d

to test a profile run:

ledspicerd -p default  # change default with any other profile.

Uninstalling

Then from the installation directory:

sudo make uninstall

(Very Optional) Running as Root at boot.

If you really want to run ledspicerd at boot AS root you can use the service file I added to the examples directory, just keep in mind that the pulseaudio plugin will not work on a multi user environment.

sudo cp /usr/share/doc/ledspicer/examples/ledspicerd.service /etc/systemd/system
sudo systemctl enable ledspicerd.service

After that ledspicerd will load on boot as root.
you can start/stop or restart it with:

sudo service ledspicerd start
sudo service ledspicerd stop
sudo service ledspicerd restart

Issues

Stretch based retropie

I found that on raspberry pi based systems some times the libraries are not at the last version, for example the tinyxml2 provided is 4.x and ledspicer needs 6.x
To solve this you can download the tinyxml code and compile it over the other and then edit the tinyxml2.pc file to match the version and new path, or get an already compiled package for rpi.
For more details click here

Running LEDSpicer as root

I found an issue if you run the program as root, the pulseaudio plugin gets no input, that is because the user and root are different users, I'm working to solve this by added the user ID on the config and relax the running user to that user, but for now the only two solutions are: run the program as the user, or run pulseaudio system wide.

Running LEDSpicer as non root

If you run the program as a normal user, you will need to give rights to your user to access any hardware you want to use, USB is mandatory, then inputs devices if you use the input plugins, if you get an error about not opening a device most likely is rights or wrong config.