Setup issues (new scripts)

Forums:

Post here for queries regarding setup problems with the new driver free scripts.

We recommend you try using the troubleshooting instructions here first if you have not already.

Please try to list as much about the problem as you can (OS distribution, versions et cetera), the more we know the easier it is to help :)

OS: Debian "Wheezy" 3.12.22+
Wiringpi most updated version from Git Repository.

I run into the issue of easy_install is not recognized as an internal command. As far as I can tell the wiringpi was successfully installed. (According to the gpio -v gpio readall commands)

I've even wiped the SD card and restarted, not exactly sure what's going wrong. Is it a possible Debian update that may of messed things up?

Thanks.

piborg's picture

You probably need to install the Python setup tools package to get easy_install:
sudo apt-get -y install python-setuptools

I will add this to the setup instructions ^_^

After doing this it works, however now I cannot compile anything. I get the error command 'gcc' failed with exit status 1. Any suggestions?

piborg's picture

It sounds like the Python development tools are missing.

You should be able to use the following command to get them:
sudo apt-get -y install python-dev
after that easy_install should work properly.

Many thanks! Sorry for the later reply!

I am trying to get the ledborg working again using the new scripts,, but it seems to fail at the point where I try to install wiringpi2.

I get the following errors (similar if I try installing via pip or using git version). Any ideas where or how to start debugging this one?

sudo easy_install wiringpi2
Traceback (most recent call last):
  File "/usr/bin/easy_install", line 5, in 
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2727, in 
    add_activation_listener(lambda dist: dist.activate())
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 700, in subscribe
    callback(dist)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2727, in 
    add_activation_listener(lambda dist: dist.activate())
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2230, in activate
    map(declare_namespace, self._get_metadata('namespace_packages.txt'))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1827, in declare_namespace
    _handle_ns(packageName, path_item)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1797, in _handle_ns
    loader.load_module(packageName); module.__path__ = path
  File "/usr/lib/python2.7/pkgutil.py", line 246, in load_module
    mod = imp.load_module(fullname, self.file, self.filename, self.etc)
  File "/usr/lib/pymodules/python2.7/mpl_toolkits/__init__.py", line 3, in 
    except ImportError:
  File "/usr/lib/pymodules/python2.7/mpl_toolkits/axes_grid1/__init__.py", line 2, in 
    from axes_divider import Divider, SubplotDivider, LocatableAxes, \
  File "/usr/lib/pymodules/python2.7/mpl_toolkits/axes_grid1/axes_divider.py", line 14, in 
    import matplotlib.transforms as mtransforms
  File "/usr/lib/pymodules/python2.7/matplotlib/__init__.py", line 134, in 
    from matplotlib.rcsetup import (defaultParams,
  File "/usr/lib/pymodules/python2.7/matplotlib/rcsetup.py", line 15, in 
    
ImportError: No module named pygments.lexer
piborg's picture

It sounds like Python has a library which has not been properly installed somehow.

Could you try adding the missing package using the following command:
sudo apt-get install python-pygments

If that works then you can try the easy_install command again.

Thanks. I think my mistake was to not realise that the python packages are named for installation in the format python-package, and not just package. So I installed pygments and that brought in chardet. Next I neeeded sphinx and that installed fine.
Different problem now.

Traceback (most recent call last):
  File "/usr/bin/easy_install", line 5, in 
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2727, in 
    add_activation_listener(lambda dist: dist.activate())
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 700, in subscribe
    callback(dist)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2727, in 
    add_activation_listener(lambda dist: dist.activate())
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2230, in activate
    map(declare_namespace, self._get_metadata('namespace_packages.txt'))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1827, in declare_namespace
    _handle_ns(packageName, path_item)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1797, in _handle_ns
    loader.load_module(packageName); module.__path__ = path
  File "/usr/lib/python2.7/pkgutil.py", line 246, in load_module
    mod = imp.load_module(fullname, self.file, self.filename, self.etc)
  File "/usr/lib/pymodules/python2.7/mpl_toolkits/__init__.py", line 3, in 
    except ImportError:
  File "/usr/lib/pymodules/python2.7/mpl_toolkits/axes_grid1/__init__.py", line 2, in 
    from axes_divider import Divider, SubplotDivider, LocatableAxes, \
  File "/usr/lib/pymodules/python2.7/mpl_toolkits/axes_grid1/axes_divider.py", line 14, in 
    import matplotlib.transforms as mtransforms
  File "/usr/lib/pymodules/python2.7/matplotlib/__init__.py", line 134, in 
    from matplotlib.rcsetup import (defaultParams,
ImportError: cannot import name defaultParams
piborg's picture

I am not so sure what the error you are now receiving is actually caused by.

My first thought would be to try installing matplotlib using apt-get:
sudo apt-get install python-matplotlib

I had tried installing matplotlib before and got the message that it was already on the latest version. So I tried removing with purge, and then re-installing which seemed to fix everything. So following that wiringpi2 installed without a hitch, thank you

I have been testing the unit and the RED led is not turning on. i used the script and the manual testing steps to try and go through the color system. i am using a raspberry pi b+ and raspbian.

piborg's picture

It sounds like the LedBorg you have received has a fault :(
This is a rare problem so I think you just got unlucky.

We will send you out a replacement board to the same address on your order (#5694).

Apologies for the fault, feel free to keep the broken LedBorg.

Hi I've been through the lessons and all works fine but how can I set it so that the light is always on while my pi is powered. I'm looking to constantly have it lit up blue so it lights up the inside of the box I'm fitting my pi into :)

piborg's picture

Proobably the easiest way will be to make a simple shell script that turns the red / green / blue pins on or off and have it run when the Raspberry Pi boots up.

First create a new script file using Nano:

cd ~
nano ledborg-startup.sh

Next copy these lines into the script:

#!/bin/sh
 
# Set up GPIO 17 and set to output for the red channel
echo "17" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio17/direction
 
# Set up GPIO 27 and set to output for the green channel
echo "27" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio27/direction
 
# Set up GPIO 22 and set to output for the blue channel
echo "22" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio22/direction
 
# Write the output colours (red, green, blue)
echo "0" > /sys/class/gpio/gpio17/value
echo "0" > /sys/class/gpio/gpio27/value
echo "1" > /sys/class/gpio/gpio22/value

The last three lines determine the colour, blue in this case.
Press CTRL+O followed by ENTER to save the file.
Press CTRL+X to close Nano.

Make the script executable and check it works:

chmod +x ledborg-startup.sh
sudo ~/ledborg-startup.sh

The LedBorg should now be the specifed colour.

Finally we will use crontab to start the script with the Raspberry Pi.

crontab -e

Go to the bottom of the file and add the line:

@reboot sudo /home/pi/ledborg-startup.sh

Save and exit.

Now the LedBorg should come on when the Raspberry Pi boots up, about the same time as the login prompt is shown.
To change the colour simply edit the last three lines of the script.

Thanks so much for the help I'll do this later on :)

Just got my LedBorg and am going to implement it in a project I am doing. However when I try to run lesson 1 I get the error below. Not sure what to do about it. I followed the instructions on the installation tab including
"sudo easy_install wiringpi2"

I did the instructions to creating the file correctly as well. Thanks in advance!

Also using it on a raspberry pi 3

Images: 
piborg's picture

Try installing the standard copy of WiringPi using:
sudo easy_install wiringpi

Once that is done change the code from

import wiringpi2 as wiringpi

to simply

import wiringpi

Hopefully everything will now work as expected with the standard WiringPi version since WiringPi 2 is no longer in development.

It still wont execute. It says
"Unable to determine hardware version. I see: Hardware : BCM2835
,
- expecting BCM2708 or BCM2709.
If this is a genuine Raspberry Pi then please report this
to projects@drogon.net. If this is not a Raspberry Pi then you
are on your own as wiringPi is designed to support the
Raspberry Pi ONLY.

Does that have to do with the kernel that I have?

piborg's picture

It looks like this is a known problem, the version of WiringPi being installed is outdated and does not fully work with more recent kernel versions.

Based on this post: https://github.com/WiringPi/WiringPi-Python/issues/47
you may be able to fix the issue by building a fixed version of WiringPi.

These are the commands they suggest:

git clone --recursive https://github.com/neuralpi/WiringPi-Python.git
cd WiringPi-Python/WiringPi
sudo ./build
cd ..
swig2.0 -python wiringpi.i
sudo python setup.py install
sudo python3 setup.py install

If that does not work downgrading the kernel to an older version should work, but fixing WiringPi is preferable.

Pardon my ignorance, I'm fairly new to all this. Is Swig a software that I need to download, because it doesn't recognize the command "swig2.0". Also when I am executing "sudo ./build" it says "To compile programs with wiringPi, you need to add: -lwiringPi" does this have anything to do with it. Thank you for the help, I really appreciate it.

piborg's picture

You should be able to install the missing program using these commands:

sudo apt-get update
sudo apt-get install swig2.0

Edit:
The message seen at the end of the sudo ./build that reads:

To compile programs with wiringPi, you need to add: -lwiringPi

is perfectly normal. It is just explaining how to use the C library which the Python one does for you.

I have run through the setup on the problematic version of Jessie and these are all the required steps

sudo apt-get update
sudo apt-get install swig2.0
cd ~
git clone --recursive https://github.com/neuralpi/WiringPi-Python.git
cd WiringPi-Python/WiringPi
sudo ./build
cd ..
swig2.0 -python wiringpi.i
sudo python setup.py install
sudo python3 setup.py install

I can't make Ledborg to light RED color. Fresh install on Rasbian Strech. I have tested to install Ledborg on 2 different PI3 with same results. Others colors (blue, green) works fine and looking at :gpio readall looks that gpio 0 (BCM 17) is reacting right but there is no light from Ledborg. Any clues how to see if this is PI, Ledborg or another issue?

piborg's picture

I would suggest we start by using WiringPi to see if it detects any GPIO pin problems.

First disconnect everything from the GPIO.

Next download and build the WiringPi code:

cd ~
git clone git://git.drogon.net/wiringPi
cd wiringPi
./build

After it has built run the GPIO pin tester:

~/wiringPi/gpio/pintest

You should see some diagnostics after pressing ENTER:

PinTest
=======

This is a simple utility to test the GPIO pins on your Raspberry Pi.

NOTE: All GPIO peripherals must be removed to perform this test. This
  includes serial, I2C and SPI connections. You may get incorrect results
  if something is connected and it interferes with the test.

This test can only test the input side of things. It uses the internal
pull-up and pull-down resistors to simulate inputs. It does not test
the output drivers.

You will need to reboot your Pi after this test if you wish to use the
serial port as it will be left in GPIO mode rather than serial mode.

This test only tests the original pins present on the Rev A and B. It
does not test the extra pins on the Revision A2, B2 nor the A+ or B+

Please make sure everything is removed and press the ENTER key to continue,
or Control-C to abort...

          The main 8 GPIO pins  0: 7:  OK
                The 5 SPI pins 10:14:  OK
               The serial pins 15:16:  OK
                  The I2C pins  8: 9:  OK

Hopefully all of the end lines say OK, otherwise the GPIO is not working correctly on the Raspberry Pi itself.

If that comes back all okay then the next thing to check is the pin output. If you have a multimeter you can do this by probing between the GPIO 0 and GND pins looking at voltage. If the green LED is supposed to be on it should read about 3.3 V. If the green LED is supposed to be off it should read about 0 V.

Thank You for replay. I run pintest and everything looks fine:
The main 8 GPIO pins 0: 7: OK
The 5 SPI pins 10:14: OK
The serial pins 15:16: OK
The I2C pins 8: 9: OK

and multimeter test seems to be ok too:
I used lesson4.py script to switch colors and switching to RED shows status OUT and 3.3v between GPIO (BCM17) and GROUND (pin 6) and switching to GREEN or BLUE or OFF shows status OUT and 0.1v between GPIO 0 (BCM17) and GROUND (pin 6).

so it seems that maybe Ledborg is no functional but it sounds strange because it was working without any problems from day one and I never take it out from my Raspberry PI3 until now. Is this possible that Rasbian update could damaged Ledborg ?

piborg's picture

It seems unlikely that the problem is with Raspbian or the Pi itself since the GPIO pin is behaving as it is supposed to. I think it is reasonable to assume the problem is with the LedBorg itself.

What we will do is send you out a replacement LedBorg which is working. You can keep the faulty one as well :)

Could you please send us a message using our order contact form to tell us what address to send the replacement LedBorg to. Explain that you have a faulty LedBorg which needs to be replaced in the message.

Best support ever! Thank You very much for your assistance and help. That be great to bring Ledborg back to life with some REDs!

I received my new Ledborg replacement and everything works great. Reds is back again! Thank You for all help :)

Subscribe to Comments for "Setup issues (new scripts)"