These instructions assume you have installed LightShow Pi, and have setup your hardware for controlling lights. Now it’s time to test out your hardware out with LightShow Pi and get your lights blinking!
Default Hardware Configuration
The default hardware configuration for LightShow Pi assumes you are using the first 8 GPIO ports (GPIO0 – GPIO7) to control 8 channels of lights. There are several other user contributed configurations provided to support commonly used hardware configurations in the lightshowpi/config/contrib directory of the install.
Verifying Your Hardware Configuration
You can verify your hardware setup and configuration are setup properly by blinking each channel one at a time using the following command from the main LightShow Pi directory (/home/pi/lightshowpi if you’ve followed the default install steps):
sudo python py/hardware_controller.py --state=flash
You can also fade each channel in and out using software PWM using the following command:
sudo python py/hardware_controller.py --state=fade
Press <CTRL>-C in the same terminal window to stop the blinking / fading lights test.
Note that software PWM fading will not work with all hardware configurations and all lights (it works best with either direct powered LEDs, or SSR controlled incandescent lights). The default configuration has each channel using software PWM fading. You can override this default behavior with the pin_modes configuration option (search for pin_modes in lightshowpi/config/defaults.cfg for more details).
Hardware Controller
The hardware controller provides other useful tools for testing your hardware and software configuration, see the command line help for more details:
sudo python py/hardware_controller.py -h
Hello,
I used BananaPi Pro to install lightsshowpi. The installation went okay without any errors but, the test failed with the error below.
Unable to determine hardware version. I see: Hardware : sun7i
,
– expecting BCM2708 or BCM2709. Please report this to projects@drogon.net
Anything needs to be changed in the script.
regards,
Sanjay
Hi Sanjay. LightshowPi uses wiring pi for controlling GPIO, and the error you are getting is coming from the wiring pi code. I’ve not worked with / used a BananaPi – but a quick google search shows some ported libraries of wiring pi for BananaPi that you might try:
https://github.com/LeMaker/WiringBP
That said – I didn’t see a port to python for WiringBP, so it may not be a perfectly easy port to move to WiringBP.
You could also try to contact the author of WiringPi and see if he has recommendations, or the author of WiringBP. Hope this helps!
I seen that Wiringpi is installed during the setup of lightshowpi in the same directory. This could be a Raspberry Pi specific installation. But, I have installed WiringpiBP from the lemaker site and it works with GPIO. Seems I need to change something in the script to use the Bananapi wiringpi code.
Which file to be modified.
BTW I also have a RaspberryPi rev A (256 MB) version which I ordered by mistake. Then purchased BananaPi from a china site before RPi-2 was available. I couln’t wait 🙁
Let me try RPi today with lightshow.
You’ll want to look at the code in the hardware controller:
https://bitbucket.org/togiles/lightshowpi/src/master/py/hardware_controller.py?fileviewer=file-view-default
Note that we attempt to detect the platform and substitute a “stub” when not on a raspberry pi … would be great if you get this working on the banana pi – would love to add support directly “out of the box”!
I didn’t have that section to detect the raspberrypi.
But after installing a wiringpi2-python for Bananapi it solved my problem. I got it working.
https://github.com/BPI-SINOVOIP/BPI-WiringPi2-Python
Good to know! Did you have to modify the lightshowPi code at all to get things working on your bananapi, or just installing that library worked?
I also have a BPI Pro that I want to use with ws2812 strings. Did you get the info to make this work out of the box yet or did the user disappear after they got it working?
Didn’t get a response … you might try posting on the community forums though to see if others out there have got it working.
I tried Raspberry Pi rev.A
The test for flash and fade works. I am unable to play the sample music file. the following error comes after about a minutes.
root@osmc:/home/osmc/lightshowpi# sudo python py/synchronized_lights.py –file=/home/os
mc/lightshowpi/music/sample/ovenrake_deck-the-halls.mp3
ALSA lib confmisc.c:768:(parse_card) cannot find card ‘0’
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_card_driver returned erro
r: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_concat returned error: No
such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No
such file or directory
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
Traceback (most recent call last):
File “py/synchronized_lights.py”, line 465, in
play_song()
File “py/synchronized_lights.py”, line 364, in play_song
output = aa.PCM(aa.PCM_PLAYBACK, aa.PCM_NORMAL)
alsaaudio.ALSAAudioError: No such file or directory
root@osmc:/home/osmc/lightshowpi#
I am using a Raspberry Pi 2. I followed the instructions up to verifying the hardware configuration.
When I run either command, the USB ports and the ethernet port power off and I can not exit out of the code. Could it be the power adapter that I am using?
Matt — I’ve not experienced this before, try posting on our G+ community – more eyes to see this and someone else there might have ran into this issue. https://plus.google.com/u/0/communities/101789596301454731630
I just setup my pi2 and its work good so for I just want to add some songs . The sounds are MP3 how to make a play list of 10 songs and put it on a loop . And will I be able to control it from my iPhone . Please give some ideas . Thanks for your time.
Hi Tom, welcome to the LightshowPi community! Your use-case of looping over 10 songs is a very typical one, have you taken a look at setting up your own play list yet? (http://52.89.57.254/play-music/)
As for controlling it from your iPhone, I’d suggest taking a look at one of the web ui options:
https://plus.google.com/communities/101789596301454731630/stream/f45605f2-7561-422c-b47f-192333819459
Every time i type in :
sudo python py/hardware_controller.py –state=flash
It always displays: command not found.
I have downloaded lightshow pi, but when I went to install it I saw a few “Failed” words throughout the installation. It said stuff like “Failed to fetch…” I don’t know if this is the reason for the configuration to not work.
Jordan – mind re-posting your question on our community page, you’ll get much more timely support there by a large group of users:
https://plus.google.com/communities/101789596301454731630
I’m happy to help here as well, mind sending the exact error message? Also, what directory were you in when running the command?
Hi Guys,
Hoping you can help.
When I run the “sudo python py/hardware_controller.py –state=flash” command my relays click and their corresponding lights come on, but when it goes through the cycle of flashing my relay’s / lights don’t flash at all.
I have tried all the different combo’s for the GPIO connectors in case I had those wrong.
Can anyone help at all? or head me down the right track 🙂
My set up is:
Raspberry Pi Model B Rev 1.
2x 4 Mechanical Relay’s
Skill Level: beginner to average
Hayden – could you post your inquiry to the community page – you’ll get much quicker support there by a large audience:
https://plus.google.com/communities/101789596301454731630
I’d have to have more details on the actual relay model and how you’ve wired things. One thing you might try is changing the active_low_mode = yes in your config overrides. (as most mechanical relays I’ve seen are active low)
I’m doing this for a school project and it the schools wifi has blocked me from reaching the google+ community page for help.
I’m having an issue when running: sudo py/synchronized_lights.py
I get an import error that says no module named alsaaudio. However, I installed and ran the drivers for alsa but still get the same issue
Silly question, but did you successfully run the install script?
Turns out I did not actually. My mistake for not paying attention to the logs and rushing ahead. The site brailleweb is blocked by my school and am in the process of getting it unblocked. Sorry for the rookie mistake!
when trying to run this i get the following error message.
Error:root devices not defined or not in JSON format.
expeting property name line1 column2(char1)
i still get the music playing but no lightshow also i have wired it up as suggested but does each individual led have to be wired up to the 3.3v supply on breadboard as well as wired to a gpio pin
Hi Gary,
That message indicates there is a formatting issue in your configuration file – the devices definition must be setup for your specific hardware. How do you have it wired up?
Also – you may get more feedback by posting on our community page:
https://plus.google.com/communities/101789596301454731630
Regards,
-Todd
Hi,
I am new to using a Raspberry Pi for Christmas light control and am wondering if it is possible to do fading with a string of low voltage LED fairy lights. Most of what I have seen on this site show straight switching on/off using a relay. Any help would be much appreciated.
Thanks
The software supports PWM dimming which works well for low voltage lights. If you post your request to our Google+ Community page you’ll likely get several responses with more details on hardware configurations, etc…
https://plus.google.com/u/0/communities/101789596301454731630
Hey,
can u please make a guide how to stream music from Android device ( with AirAudio vor sth else ) to LightShowPi?
Thanks!
Hi Matthias, please visit our community page for support: https://plus.google.com/communities/101789596301454731630
Why is any link from plus community not opening. https://plus.google.com/u/0/communities/101789596301454731630
I wanted to refer to previous comments which helped me.
Do you have a specific link that isn’t working? They seem to be working for me?!?
What would cause only my first 3 relays to flash when I run this?
sudo python py/hardware_controller.py –state=flash
Potentially many things … hardware not setup properly, configuration setup to only trigger 3 pins. Please visit the community forum with more details and I’m sure we’ll be able to sort things out: https://plus.google.com/u/0/communities/101789596301454731630
I just set up my RaspberryPi 3 with LightShow Pi following the “Getting Started” guide. Now, at the step “Configuring and Testing your Hardware”, when I try to run “sudo python py/hardware_controller.py –state=flash” out of the main LightShowPi directory, it says “Need to setup SYNCHRONIZED_LIGHTS_HOME environment variable, see readme” as an error message and none of the LEDs connected to the GPIOs turns on.
I already visited your community homepage, but I don´t receive an answer there, so I´m asking here.
Perage
There are several possible issues, take a look at the community forum for others with this same issue:
https://plus.google.com/communities/101789596301454731630/s/Need%20to%20setup%20SYNCHRONIZED_LIGHTS_HOME%20environment%20variable%2C%20see%20readme
@Todd or anyone, Since the G+ community is gone. Is there an article on this in the Reddit Community. I am not finding one if there is. Thanks.
Hi, I’m having the same issue, and I can’t access the Google Plus forum. I already tried removing spidev, and that didn’t solve the problem. If anyone could please post a possible solution, that would be great, and much appreciated. Thanks
Sorry – the Google Plus forum is long gone, but we do have an active community still on Reddit! https://www.reddit.com/r/LightShowPi
Good luck!
Hi, I installed lightshowpi, but when I try to verify my hardware setup, the LEDs are not flashing. I can turn them on using commands like “gpio write 0 1”, … Can someone help me please?
Your best bet for help is in the community:
https://plus.google.com/communities/101789596301454731630
Hi,
This issue is back now.
The previous remedy doesn’t work this time.
any suggestions?
Kind Regards
Hari
What issue?
Hi, when I execute “sudo python py/synchronized_lights.py –file /path/to/music.mp3” ly LEDs don’t flash or anything they just stay turned off.
There could be many reasons why … try visiting our community page and there will be those who have time to walk you through things:
https://plus.google.com/communities/101789596301454731630
sudo python py/hardware_controller.py –state=flash
why do I get Errno 2 no such file or directory when I go to run the above
Are you running it from the base directory where you installed the software?
when I run the command above, I get an error: No module named biblio.colors
Error: No module named bibliopixel.colors
Sorry, this is the error I get, not the biblio.colors
Has anyone combined this yet with the Google AIY Voice Kit? I would like to combine the two so that I can have the Pi play music based on an initiating action (button press or ‘OK Google Play’) and the name of the song. For example, “OK Google, play ‘A Mad Russian’s Christmas'”. The Voice Hat uses all of the GPIO pins, so direct LED control is out, but that’s not my goal here. I want a voice and button-controlled Christmas jukebox. My programming skills are somewhere between poor and adequate, so any help would be much appreciated!
Hello, I am just installing the software and when I run the below command to test the hardware I get the following response. Any ideas? Thank you all!
pi@raspberrypi:~/lightshowpi $ sudo python py/hardware_controller.py –state=fade
Traceback (most recent call last):
File “py/hardware_controller.py”, line 62, in
cm = configuration_manager.Configuration()
File “/home/pi/lightshowpi/py/configuration_manager.py”, line 81, in __init__
self.load_config()
File “/home/pi/lightshowpi/py/configuration_manager.py”, line 116, in load_config
self.config.readfp(open(self.config_dir + ‘defaults.cfg’))
IOError: [Errno 2] No such file or directory: ‘/home/pi/lightshowpi\r/config/defaults.cfg’
By the way, I meant to say I have not made any changes to the configuration. everything i installed was per the instructions of the website.
i get the following when running the first hardware test. Any help would be appreciated.
Traceback (most recent call last):
File “/usr/local/lib/python3.9/dist-packages/numpy/core/__init__.py”, line 24, in
from . import multiarray
File “/usr/local/lib/python3.9/dist-packages/numpy/core/multiarray.py”, line 10, in
from . import overrides
File “/usr/local/lib/python3.9/dist-packages/numpy/core/overrides.py”, line 8, in
from numpy.core._multiarray_umath import (
ImportError: libopenblas.so.0: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/local/lib/python3.9/dist-packages/numpy/__init__.py”, line 130, in
from numpy.__config__ import show as show_config
File “/usr/local/lib/python3.9/dist-packages/numpy/__config__.py”, line 4, in
from numpy.core._multiarray_umath import (
File “/usr/local/lib/python3.9/dist-packages/numpy/core/__init__.py”, line 50, in
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.9 from “/usr/bin/python”
* The NumPy version is: “1.26.2”
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: libopenblas.so.0: cannot open shared object file: No such file or directory
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “/home/edwin/lightshowpi/py/hardware_controller.py”, line 38, in
import led_module
File “/home/edwin/lightshowpi/py/led_module.py”, line 17, in
import numpy
File “/usr/local/lib/python3.9/dist-packages/numpy/__init__.py”, line 135, in
raise ImportError(msg) from e
ImportError: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.
Have you tried asking for help on the reddit page – there are more eyes on the posts there? https://www.reddit.com/r/LightShowPi/