Menu

Deployment

MeduZaPaT Chris Newton

Building LEDSpicer

Preparing

Upgrading

To upgrade ledspicer simply follow the installation 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 these 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 build 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
 libpigpio-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

for raspberry GPIO install this:

sudo apt-get install pigpio

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 you will need git

sudo apt install git -y

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:

configure: error: pigpio.h header not found.

solution:
install the raspberry library.
error:

 ./autogen.sh
configure.ac:1: error: Autoconf version 2.71 or higher is required

solution:
Edit the file configure.ac and in the fist line replace 2.71 with 2.69

nano configure.ac

error (same for any other library):

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

solution:

apt install libpthread-stubs0-dev

error:

configure: error: libpulse development library not found.

solution:
This is due to the missing sound library (same for ALSA) if you want pulse audio plugin install the library (is on the section #libraries)
if you don't what the audio plugins add this to the end of configure

--disable-pulseaudio  --disable-alsaaudio

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 example's 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 sometimes 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.


Related

Wiki: Quick Start

Discussion

  • Chris Newton

    Chris Newton - 2020-08-14

    On Raspberry Pi, this example:

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

    Should instead be this:
    (different directories, and an extra sudo thrown in to keep from triggering a permissions error

        sudo cp /usr/local/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 && sudo udevadm trigger
    

    Also, the docs say that this is a configuration option, but it was not recognized when I was setting it up.

    --enable-samples

     
    • MeduZaPaT

      MeduZaPaT - 2020-08-15

      Hello Chris,

      Thanks for the notes, I fixed all of them by now, if you find more
      errors, missing stuff, outdated information or anything out of the
      normal, let me know.

      I'm sorry that the docs are kinda outdated and with errors, I was
      focused most of the time on the code and is just me, so I just typed the
      docs on the fly, with almost no review.

      I really appreciate your help finding that errors, hope they now works
      for you.

      Patricio

      On 8/14/20 3:43 PM, Chris Newton wrote:

      On Raspberry Pi, this example:

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

      Should instead be this:
      (different directories, and an extra sudo thrown in to keep from
      triggering a permissions error

      sudo cp /usr/local/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 && sudo udevadm trigger
      

      Also, the docs say that this is a configuration option, but it was not
      recognized when I was setting it up.

      --enable-samples
      

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/ledspicer/wiki/Deployment/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • MeduZaPaT

    MeduZaPaT - 2020-08-14

    thanks Christ, fixed!

     
  • Carl Southcott

    Carl Southcott - 2021-03-17

    This looks great and exactly what I'm after.

    I'm trying to install everything before buying the parts in case I have problems.

    When compiling and after typing ‘sudo make install’ I’m getting the warnings in the attached picture. Is that ok or do I need to do something?

    Also, Step 6. Copy and edit config.
    Should read sudo cp /usr/local/share/doc/ledspicer/examples/ledspicer.conf /etc

    Thanks,

    Carl

     
    👍
    1

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.