Raspberry Pi locking door
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 28
- Joined: Wed Sep 11, 2013 4:05 am
Raspberry Pi locking door
So im to the training stage of the tutorial, however I cannot run the first script. I've reinstalled all the dependencies from the previous step but no luck. Please advise
- Attachments
-
- 1964947_778340498872448_392005347015287868_n.jpg (110.14 KiB) Viewed 1117 times
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Raspberry Pi locking door
You're missing the shared object library libmmal.so
It looks like you haven't installed the picamera library?
Have you done all these commands from the tutorial? Did they all complete successfully?
It looks like you haven't installed the picamera library?
Have you done all these commands from the tutorial? Did they all complete successfully?
Code: Select all
sudo apt-get install python-pip
sudo apt-get install python-dev
sudo pip install picamera
sudo pip install rpio
-
- Posts: 28
- Joined: Wed Sep 11, 2013 4:05 am
Re: Raspberry Pi locking door
Still not working :( Yes the picamera library is installed and they did complete. Does running Occidentalis make any difference?
- tdicola
- Posts: 1074
- Joined: Thu Oct 17, 2013 9:11 pm
Re: Raspberry Pi locking door
That's odd that picamera can't find a certain shared library. Can you run this command to list any location where the libmmal.so might be on the system? We can try adding that path to the path that Linux searches for shared libraries to see if it helps. Run this command:
sudo find / -name libmmal.so
On my Pi running Raspbian I see this result:
/opt/vc/lib/libmmal.so
Let's check what you see on your Pi.
sudo find / -name libmmal.so
On my Pi running Raspbian I see this result:
/opt/vc/lib/libmmal.so
Let's check what you see on your Pi.
-
- Posts: 28
- Joined: Wed Sep 11, 2013 4:05 am
Re: Raspberry Pi locking door
This is what comes up
- Attachments
-
- image.jpg (169.24 KiB) Viewed 1076 times
- tdicola
- Posts: 1074
- Joined: Thu Oct 17, 2013 9:11 pm
Re: Raspberry Pi locking door
Thanks for running the command, good to see the file is there in the /opt/vc/lib path. Now run this command in a terminal to tell Linux that it should search for shared libraries in that /opt/vc/lib path:
export LD_LIBRARY_PATH=/opt/vc/lib
Then in that same terminal try to run the capture-positives.py script again (sudo python capture-positives.py). Let's see if that helps Linux find the shared library.
export LD_LIBRARY_PATH=/opt/vc/lib
Then in that same terminal try to run the capture-positives.py script again (sudo python capture-positives.py). Let's see if that helps Linux find the shared library.
- tdicola
- Posts: 1074
- Joined: Thu Oct 17, 2013 9:11 pm
Re: Raspberry Pi locking door
Interesting--a couple more commands to run to help check if there's some sort of architecture/compilation issue that's causing the library not to load. Run these two commands and grab the output:
uname -a
file /opt/vc/lib/libmmal.so
The first command will print info on the current system like the kernel version and architecture. The second will print details on the libmmal.so file, like how it was compiled.
uname -a
file /opt/vc/lib/libmmal.so
The first command will print info on the current system like the kernel version and architecture. The second will print details on the libmmal.so file, like how it was compiled.
- tdicola
- Posts: 1074
- Joined: Thu Oct 17, 2013 9:11 pm
Re: Raspberry Pi locking door
Thanks for running, nothing jumps out as wrong with the architecture there.
Lets see if other tools can access the camera. The raspistill command will take a picture and save it as as jpeg. Can you try running this to see if it successfully grabs a picture with the camera:
raspistill -o photo.jpg
If it works it should save a picture under photo.jpg. If it fails, grab the output of the error so we can debug further. Thanks!
Lets see if other tools can access the camera. The raspistill command will take a picture and save it as as jpeg. Can you try running this to see if it successfully grabs a picture with the camera:
raspistill -o photo.jpg
If it works it should save a picture under photo.jpg. If it fails, grab the output of the error so we can debug further. Thanks!
-
- Posts: 28
- Joined: Wed Sep 11, 2013 4:05 am
Re: Raspberry Pi locking door
Im guessing this is because the camera library isnt installed?
One other thing to mention, when i go to install the picamera and rpio library i am prompted to upgrade, here is my window.
One other thing to mention, when i go to install the picamera and rpio library i am prompted to upgrade, here is my window.
- tdicola
- Posts: 1074
- Joined: Thu Oct 17, 2013 9:11 pm
Re: Raspberry Pi locking door
Yeah that's odd that raspistill isn't available. The picamera python library is actually a separate thing (it's a python library with basically the same functionality as raspistill), but it depends on the same libraries that raspistill uses internally. The upgrade message is actually just a warning that the library is already installed and to use the --upgrade option to force it to reinstall.
I was searching around a bit for raspistill not found errors, and this thread has some good advice to try running a firmware update on the board. Execute:
sudo rpi-update
Just in case the update does something unexpected, back up any important files from the Pi before you run it too. Let the update do its thing and then reboot the board when it's finished.
If all that still fails to work I think the best option would be reinstalling the OS. It's kind of drastic but unfortunately I don't see many other things to try. One thing that could help though, if you reinstall with Raspbian I actually have a script now to automatically upgrade Raspbian to the testing version of it so it can download a precompiled version of OpenCV. This would save you from having to compile the whole thing again.
I was searching around a bit for raspistill not found errors, and this thread has some good advice to try running a firmware update on the board. Execute:
sudo rpi-update
Just in case the update does something unexpected, back up any important files from the Pi before you run it too. Let the update do its thing and then reboot the board when it's finished.
If all that still fails to work I think the best option would be reinstalling the OS. It's kind of drastic but unfortunately I don't see many other things to try. One thing that could help though, if you reinstall with Raspbian I actually have a script now to automatically upgrade Raspbian to the testing version of it so it can download a precompiled version of OpenCV. This would save you from having to compile the whole thing again.
-
- Posts: 28
- Joined: Wed Sep 11, 2013 4:05 am
Re: Raspberry Pi locking door
Unfortunately that still didn't work so i've decided to take the drastic route. If you could upload that script it would be great.
Thanks heaps for all your help!
Thanks heaps for all your help!
- tdicola
- Posts: 1074
- Joined: Thu Oct 17, 2013 9:11 pm
Re: Raspberry Pi locking door
No problem, install the latest Raspbian image (2014-01-07) from http://www.raspberrypi.org/downloads/ Then grab install_dependencies.sh from the github repo here: https://github.com/tdicola/pi-facerec-box Copy that file to the Pi (or just clone the repository on the pi by running 'sudo apt-get update && sudo apt-get install git && git clone https://github.com/tdicola/pi-facerec-box.git' without quotes). Then run the install dependencies script as root with:
sudo ./install_dependencies.sh
This will prompt you to confirm the upgrade to Debian testing/'jessie' which you'll want to type ok and enter to continue. The script will automatically upgrade the OS to the testing build, download all the precompiled dependencies and install them. The whole process is unattended and should take about an hour.
Once it's done, run raspi-config and select the enable camera option to make sure it configures video memory, etc. for the camera. Execute:
sudo raspi-config
Reboot the pi, and at this point you should be ready to run capture-positives.py again. Give it a shot and let me know if you run into issues.
sudo ./install_dependencies.sh
This will prompt you to confirm the upgrade to Debian testing/'jessie' which you'll want to type ok and enter to continue. The script will automatically upgrade the OS to the testing build, download all the precompiled dependencies and install them. The whole process is unattended and should take about an hour.
Once it's done, run raspi-config and select the enable camera option to make sure it configures video memory, etc. for the camera. Execute:
sudo raspi-config
Reboot the pi, and at this point you should be ready to run capture-positives.py again. Give it a shot and let me know if you run into issues.
-
- Posts: 28
- Joined: Wed Sep 11, 2013 4:05 am
Re: Raspberry Pi locking door
I was hoping i wouldn't need to bother you with any more issues but there is a little one :)
it cannot find the command: Thanks
it cannot find the command: Thanks
Please be positive and constructive with your questions and comments.