banner



How To Setup Camera On Pi Zero

Contributors: SFUptownMaker

Favorited Favorite 11

Configure the Raspberry Pi

Now that we've hooked upward our Pi Servo Hat and assembled the hardware, we're gear up to boot the Raspberry Pi Zero W for the start fourth dimension! To configure the Raspberry Pi, we demand to:

  • Ability the Pi Zero West.
  • Connect the Pi Servo Hat's Serial-to-USB Converter.
  • Connect to the series debugging console on the Pi Zero West.
  • Enable camera interface, I2C, and SSH on the Pi Zero W.
  • Update the software on the Pi Cypher W.
  • Download and install the camera interface software from GitHub.
  • Make some changes to enable the pan-tilt control functionality.
  • Download the Pi Servo Hat interface software from GitHub.
  • Make some changes to showtime the Pi Servo Hat interface software on boot.

Allow'south walk through these steps in more detail!

Power the Pi Zippo W

Using a sufficient 5V wall adapter, we tin can power the Pi Nothing W. Plug the wall adapter into a wall outlet for power. Then connecting the micro-b from the power supply to the Pi Nix W's micro-b connector labeled as "PWR IN."

Connect the Pi Servo Chapeau's Series-to-USB Converter

With the Pi Servo Hat stacked on the Pi Zip W, take a micro-B USB cablevision and connect information technology to the Pi Servo Hat'south micro-B connector. Insert the other end to a reckoner'south standard USB port. This will allow you to connect the Pi through a serial port connection.

Open a Serial Concluding

Starting time by checking out our serial terminal nuts tutorial. This will get you upwards and running with a serial concluding. Open a series terminal program (i.e. PuTTY) to connect.

When you make your connection to the Raspberry Pi, yous'll need to connect the serial terminal to the COM port that it enumerated on and connect at a baudrate of 115200. Failure to use the proper baud charge per unit setting will result in weird characters and your connection declining to work.

To effigy out which port to connect to, I recommend using the Arduino IDE. Under the "Tools" carte, in that location is a sub-menu for "Port". Since we had connected the USB cable to a computer'south COM port already, brand note of the items on the listed COM Ports. So unplug a micro-B USB cable from your computer. Give information technology a few seconds, then re-open that sub-card to see what item has disappeared. By process of elimination, nosotros can decide the COM port that the Raspberry Pi enumerated to. Reconnect the cable to the COM port to verify. The COM port should reappear equally the same COM number in the sub-carte.

Windows

If you don't have the Arduino IDE installed and don't desire to install information technology, you tin notice the same information using built in tools. Under Windows, open up your device manager (if yous don't know how to do this, exercise a search online for Bone specific information on how to do it since information technology'southward slightly different under various versions of Windows). Take note of the devices on the list, and so unplug the Pi and see which port on the list disappears. The port which disappeared from the list is the one you desire.

Windows device manager

Mac

Using a Mac Bone, you'll need to open up a terminal window. To figure out which port the Pi has continued to, blazon this command:

          language:bash ls /dev/cu.usbserial-*                  

This will return a listing of USB-Serial converter ports on the system. Take annotation of the devices on the listing, and so unplug the Pi and run across which port on the list disappears. The port which disappeared from the listing is the one you want. Y'all tin and so connect to the port in question by typing

          language:bash screen /dev/cu.usbserial-XXXXXXXX 115200                  

where the XXXXXXXXX is replaced by information gleaned from the beginning control.

Linux

Under Linux, the process is like to Mac OS, merely utilize this command to place the serial port:

          language:bash ls /dev/ttyUSB*                  

You may utilize "screen" to connect to the Pi:

          linguistic communication:fustigate screen /dev/ttyUSBX 115200                  

Again, the "X" should be replaced with data gleaned from the ls command above. If you receive an error nigh screen not being installed, you can install screen past typing this command:

          linguistic communication:fustigate sudo apt-get install screen                  

Then re-enter the higher up command to connect via screen.

Log In to the Pi

When the Pi finishes booting (about 30 seconds) you should see a prompt on your serial terminal screen that looks like the epitome below. If you don't, try hit the enter (or return) cardinal. This will bring up the login data if it printed before you had your series last fix.

Raspi login prompt

Log in to the organisation using the username "pi" and the password "raspberry". Yous're now logged in to the Raspberry Pi, and everything else we do we'll practise from this command prompt.

Employ the raspi-config Utility to Enable Camera, I2C, and SSH

In that location's a swell text-only utility called "raspi-config" that will allow y'all to enable the camera interface, I2C, and remote admission via SSH. To utilize it simply type this command:

          language:bash sudo raspi-config                  

If you're curious, the "sudo" portion of the command tells the OS to run the command every bit a superuser -- basically, a user with full arrangement permissions. This is the menu that you'll then be presented with:

raspi config menu

From hither you can make several changes. The starting time change you lot should make is to change the countersign for the default user. Highlight option 1 and hit enter. Yous'll get a alert that you will be asked to modify the password, then a prompt will appear at the bottom of the screen asking you to enter a new password. You'll be asked to repeat information technology, just to make certain that the countersign is every bit you intended, so you'll receive a message that the countersign has been inverse.

Please change your user password! Leaving the default user password with SSH enabled is a security gamble that could allow a malicious user to take over your device remotely.

Now, use the arrow keys to move downwardly to choice 5, "Interfacing Options". Y'all'll exist presented with this bill of fare:

Interfacing options

Highlight choice "P1 Camera", and striking enter. That volition bring up this screen:

Camera enable

Highlight "Yeah" and hitting enter. You'll receive a confirmation bulletin:

Camera enabled

Hit enter to leave this screen. You'll be back at the main card. Return to the "Interfacing Options" menu over again and repeat the process two more times, in one case for the "I2C" pick and in one case for the "SSH" option.

This concludes the work you need to do with the raspi-config utility. From the master card, press tab twice to highlight "Finish", then hit enter. If yous're asked whether to reboot now, select "Aye" and hit enter. Again, it will accept as much equally 30 seconds for the login prompt to reappear.

Configure the /etc/network/interfaces File

You lot'll now need to tell the Raspberry Pi to use the "wpa_supplicant.conf" file that yous created before. Type the following command in the series terminal:

          language:bash sudo nano /etc/network/interfaces                  

Add the following lines to the terminate of the file:

          language:bash auto wlan0 allow-hotplug wlan0 iface wlan0 inet dhcp wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf                  

Hitting CTRL+O and enter to salvage the file, then CTRL+Ten to quit the nano text editor.

At present reboot the Raspberry Pi past typing:

          language:bash sudo reboot                  

Update the Pi

You must now update your Pi'southward software to the latest version. To do this, enter these two commands at the command prompt:

          language:bash sudo apt-go update sudo apt-get dist-upgrade                  

This will ensure that your Pi software is upwards-to-date. The outset control takes a minute or two to run, but the 2d will have much longer. Be patient!

Install the Remote Camera Spider web Interface Software

You'll at present want to download and install the camera interface software. To do so, execute the following four commands in club:

          language:bash git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git cd RPi_Cam_Web_Interface chmod u+x *.sh ./install.sh                  

The first command fetches the software from GitHub. You don't need a GitHub account for this to work. However, if you enter the command or URL wrong, git may ask for a username. The second enters the directory that was but fetched from GitHub. The third changes the user permission of the shell scripts in that directory so a user can execute them. The fourth runs the install script for the software.

Running the 4th command volition launch an interactive script allowing you to modify various settings virtually how the software is gear up up. We'll walk yous through it so your setup mirrors ours for the sake of the rest of the tutorial. It takes a minute or two for the interactive section to come up. Again, patience!

Here'due south the interactive interface for the installation script. Use the arrow keys, not TAB, to movement through the fields! Notation that we've left everything the same. The only exception is that nosotros added a username and password (merely that'southward non shown). Once you've finished entering a username and password, you may hit the TAB primal to get to the "OK" button and hit "Enter" to select it.

Install script interface

The installation script will download and install all of the dependencies for the project. This can take some time (up to several minutes) and then be patient. When everything is finished, y'all'll be asked if you desire to start the service at present. Select "Yes".

Start now prompt


Source: https://learn.sparkfun.com/tutorials/setting-up-the-pi-zero-wireless-pan-tilt-camera/configure-the-raspberry-pi

Posted by: lambrightposix1941.blogspot.com

0 Response to "How To Setup Camera On Pi Zero"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel