【树莓派相机】【转发记录】BerryCam 设置方法转发记录待翻译...

Icon for the BerryCam App


Steps to get BerryCam to run on your Raspberry Pi and iOS Device.

Make sure that you have the camera module for the Raspberry Pi installed. If you need more information on how to do this, visit http://www.raspberrypi.org/camera/
Once the camera has been installed, please make sure that you have Python. If you are using Raspbian OS, then this should be installed already.
Download the iOS App:

download_app_store


Installing BerryCam on Raspberry Pi

First of all, we will need to find the IP address of the Raspberry Pi on your network. Start LXTerminal on the Raspberry Pi using the icon on the desktop. Or if you use an SSH client you can connect to this from another machine using your username and password. Recommended SSH clients for Mac are the standard MacOSX Terminal app, or on Windows something like Putty. http://www.putty.org/
To get this information type:
ifconfig
This will return the IP address. Take a note of this and using the settings panel within the app, enter these details into the address field. The port number, as default is set to 8000 although advanced users may decide to change this is necessary.
The username is usually pi for the device. To connect using SSH:
ssh pi@XX.XX.XX.XX
and press (where the XX’s is the IP address) and supply your password at the following prompt.
It’s always good to make sure a lot of the libraries and packages are up to date. You can do this by using
apt-get update
Once updated it’s also a good idea to fetch the new updates with
apt-get upgrade
Once logged in use the following commands to download the necessary Python code to run on your Raspberry Pi.
Download and install the Python script into an easy to locate location. The /home directory is recommended (it’s easier to find)
cd /home
sudo wget https://bitbucket.org/fotosyn/fotosynlabs/raw/9819edca892700e459b828517bba82b0984c82e4/BerryCam/berryCam.py
To check this has been downloaded and unpacked, or set up as a file issue the command:
ls
This will list files currently in home. You will notice the new Python berryCam.py file. This is needed to provide the link between the iOS device and the Raspberry Pi.
Screen Shot 2013-08-14 at 21.48.28

Using BerryCam

Once you have entered the IP address, berryCam.py needs to be run as a Python process in order to provide the necessary links to allow the BerryCam iOS app to trigger the camera, provide previews and save files. To run simply enter:
sudo python /home/berryCam.py &
The Python script will run in the background and you will see the following message:
B E R R Y C A M -- Listening on port 8000
Please ensure your BerryCam App is installed and running on your iOS Device
Make sure both devices are connected on the same local network (generally your cellular connection won’t work. Wifi will be easiest). To set up the connection on the iOS App, tap the settings button (gears icon) and input the IP address you obtained earlier in the labelled input field. Close settings to return to the main camera controls.
Tap the refresh button within the BerryCam app on your iOS device. If your device has been recognised you will see the Connected message and the refresh icon will change to a camera icon. Pressing this will trigger the camera on the Raspberry Pi. In the terminal window you will see some activity as the Raspberry Pi handles the requests.
After a short pause, the image will then appear in your iOS device.
BRaUrN6CEAIbd2E

Viewing and Saving images to your iOS Device

By default, images are captured into a folder named berrycam. Images are organised by timestamped folders. You can access these directly on an iOS device by choosing the enlarge button (overlaid right bottom of preview). From here, your image will be opened up in Safari, where you can view full size and tap and hold to save to your camera roll. At any time you can access your save imaages in a web broeser by simply typing:
http:XX.XX.XX.XX:8000/berrycam/ (where XX.XX.XX.XX is the IP address of your Raspberry Pi)

No comments:

Post a Comment