[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

Assumptions

  • No previous version of ledspicer is installed (but is not importan).
  • Updated version of the OS that supports C++11
  • Installation directories are:
    • prefix=/usr
    • configs are located on /etc
  • UDEV rules location is /etc/udev/rules.d/ (this is optional)
    If any of this assumptions is different for your system, change whatever is necessary.

The most common way to deploy ledspicer is by building it, but I'm working on create binary packages.
Download and extract the source code in a directory, you can also use git to get the source code.

Needed programs and libraries

Essential:

build-essential (with a C++11 compiler)
autoconf (autotools)
libtool
aclocal

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 libtools libtinyxml2-dev libusb-1.0-0-dev
#optional for pulseaudio plugin:
sudo apt install libpulse-dev

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 retreive the same code.

Prepare tools

1. Run autogen to generate configure script.

./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 harware you want to include:

  • --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 Howder [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 (an 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='-s -O3' --prefix=/usr --sysconfdir=/etc

if you get an error go back to step #1

Extras:
If you want to install some config and profile sample files on the first intall add --enable-samples to configure command line, that will copy a sample conf file and some sample data files, but be carefull, if you reinstall the program this will overwrite any installed config with the samples, is is very recomended to run a configure without this enable samples after the first install.

(DEVELOPERS ONLY)
For development or testing you can use:
CPPFLAGS='-DDRY_RUN=1' to run the daemon without connecting to any USB device.
DRY-RUN will dump the data to the screen, to avoid this you can add -DNO_OUTPUT=1 to the CPPFLAGS.
Also you can use --enable-develop to add extra development tools and output, like LIBUSB debug output, and backtraces; Also in this mode the logs will be printed to stdout and the program will not be daemonized.

3. Then compile with:

make

Install

sudo make install

4. (optional and for systemd systems only) If you want ledspicer to start on boot activate the service

sudo systemctl enable ledspicerd.service

5. If you are running lespicer with a normal user:
Your user should me part of the users group, this is necesary to give the user rights to connect to the USB device.
Also, if you want to use any input plugin, you may need to add you user to the input group or add the input rule placed on the rules file.
Copy the file 21-ledspicer.rules from the doc directory.

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

6. Then run the program (will fail to run if not configured first)

sudo service ledspicerd start

Uninstalling

1. (Optional if running systemd) Stop the program and disable the boot

sudo service ledspicerd stop
sudo systemctl disable ledspicerd.service

2. You can leave the udev rules there but if you want to remove them:

sudo rm /etc/udev/rules.d/21-ledspicer.rules

3. Then from the installation directory:

sudo make uninstall

Be carefull if you used --enable-samples, make unistall will delete the configuration file and default data samples, so make a backup if needed.

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 LEDSpicerd 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 LEDSpicerd 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.