Tag Archives: STEM

Low Cost Raspberry Pi IP Camera

Raspberry Pi Camera
Low Cost IP Camera with Raspberry Pi

In this lesson we give you a step by step tutorial on how to create a low cost IP camera from a Raspberry Pi and the Raspberry Pi camera module.  (If you need to get a Raspberry Pi and Camera Module, we recommend this complete starter Kit, which you can order HERE.  If you already have a Raspberry Pi, and just need a camera, you can get the camera module HERE.) We are going to assume you already have your Raspberry Pi up and running, and are able to make a connection to it via Putty or SSH. If you are completely new to the Raspberry Pi, you should probably start with the  first two lessons on THIS PAGE.

This video will take you through the steps one at a time. In addition, the tutorial below has the commands that you can copy and paste. We recommend you both follow the video, and get the steps from the instructions below, so you do not have to manually type the commands. Be very careful . . . you must be precise in following these instructions for things to work.

OK, now assuming you have your Raspberry Pi up and running, and you can connect via Putty or SSH, These are the steps to get your dandy personal IP camera working. You will type or copy and paste these lines one at a time into the Raspberry Pi command line.

STEP 1: Get Your Raspberry Pi Up to Date:

STEP 2: Install Lighttpd Web Server:

STEP 3: Enable Server to Process PHP Scripts

STEP 4: Create a PHP WEB Page:

Now you will want to type or paste this info into the nano window.

STEP 5: Save your nano file with these key strokes:

To be clear, you press the Control key and the letter “O” at the same time. Then press the enter key. Then press the Control and “X” key at the same time.

STEP 6: Restart the Webserver:

STEP 7: Check That the WEB Server is Working:

Go to a browser on a Windows computer on your network, and type:

http://10.1.15.94/

(NOTE: You would use your Pi’s IP address above. The number I use above is the IP address of our Pi. Your number will be different. You can find out your IP address on the pi by typing ifconfig into the terminal window.)

If you configured things correctly, you should get an Apache info page pop up.

Also, you should be able to see your php information page by entering:

http:/10.1.15.94/php.php

Again, you should use your IP address. If you did things correctly you should have a page come up with lots of tables describing php configuration

STEP 8: Reboot Your Computer

STEP 9: Install the crtmpserver

STEP 10: Backup default crtmpserver file

STEP 11: Edit flvplayback.lua file

 Open the file in nano editor:

Now edit your file to these values:

STEP 12: Save and Exit 

To be clear, you press the Control key and the letter “O” at the same time. Then press the enter key. Then press the Control and “X” key at the same time.

STEP 13: Restart crtmpserver

STEP 14: Remove ffmpeg

We need to make sure we have a clean copy of ffmpeg, so safest thing to do is un-install it in case an old version is on your pi.

STEP 15: Intall Latest git-core and ffmpeg software

and then:

and then:

and then:

and then:

and then:

and then:

STEP 16: Now Make and Install the software:

These two commands will take a while. After inputting the commands go and get some coffee.

STEP 17: Install Samba:

 

We will want Samba to easily exchange files to and from windows.

STEP 18: Edit Samba File:

Now you need to add these lines to the smb.conf file. You should add them into the SHARE DEFINITIONS section, after the netlogin part.

After adding this code, my SHARE DEFINITIONS section looks like this:

Now save and exit the nano editor with:

Ctrl O
Enter
Ctrl X

At this point, your Raspberry Pi should show up on your Windows computer network on your windows machine.  On your windows machine, open a folder, click on “network” on the left, and you should see your raspberry pi show up. Now you can move files to and from your Raspberry Pi from Windows.

STEP 19: Install Strobe Software and WEB Page:

We will want to be able to view the live video stream in a browser, so we need to install the Strobe software. These next steps will install and enable the strobe feature.

Now the easiest way to get the strobe software is to download it on a windows computer. You can get the software by going to:

http://sourceforge.net/projects/smp.adobe/files/

and downloading the latest version of strobe media playback.

Now open the zipped folder and drag and drop the folder “for Flash Player 10.1” to your desktop.

Now move the CONTENTS of the unzipped “for Flash Player 10.1” folder onto your Raspberry Pi. You will want to move the CONTENTS of “for Flash Player 10.1” folder into the /home/var/www/html/strobe folder on your Raspberry Pi. If you installed Samba correctly, the Raspberry Pi should show up when you open a folder in Windows and click on “Network”.

Now you have the strobe software installed and you need to create a Strobe WEB page to display your live video.

First, make sure you are in the html folder by typing:

On your raspberry pi, now issue the command:

Now paste this code into your Nano window. You can paste by copying the code below, and then going to your Raspberry Pi command Window, and right mouse clicking.

Now you should save and exit nano with these commands:

To be clear, you press the Control key and the letter “O” at the same time. Then press the enter key. Then press the Control and “X” key at the same time.

STEP 20: Enable Raspbery Pi Camera Module:

At the command line enter:

Scroll down and enable the camera.

STEP 21: Start the Camera:

You are now ready to fire up the camera. You can start the camera by issuing this command in the Raspberry Pi command window.

STEP 22: View the Live Stream

Now to view the live stream just open a browser on a computer on your network and type in the IP address of your pi:

http://10.1.15.94

(Use your ip address. The one above is my IP address.

This has been a long project, but I hope well worth it. If you follow the instructions EXACTLY, it should work. Enjoy!

Raspberry Pi LESSON 35: Install a Free Office Like Product on Raspberry Pi

Now that we are booting in the Graphical User Interface on the Raspberry Pi, we can explore some useful applications that will run on the Pi. LibreOffice is a free product that will do many of the things Microsoft Office does. This is a great addition to your Raspberry Pi. You can install this product by going to the terminal window, and at the command prompt on your Raspberry Pi type:

$ sudo apt-get install libreoffice

Now the new software should show up under your menu button. The video above steps you through some of the cool features of the product.

Raspberry Pi LESSON 31: Making a Dimable LED with Python

In this lesson we are ready to bring together a lot of what we learned in earlier lessons. We will create dimable LEDs which will respond to two buttons. If one is pressed the LED will gradually grow dimmer. If the other is pressed, the LED will gradually grow brighter. This will require us to use our skills in using GPIO inputs, pullup resistors, GPIO outputs, and PWM.

For convenience we will use the same circuit we used in LESSON 30, shown below. Also, if you want to follow along with these lessons, you can buy the gear you need HERE.

Raspberry Pi LED Circuit
This Circuit Controls two LED from Push Buttons Using the Raspberry Pi

The objective of this circuit is that we want the LEDs to grow brighter each time the right button is pushed, and we want them to grow dimmer each time to left button is pushed.

The video above steps through and explains this code.

 

Raspberry Pi Linux LESSON 21: Adding an Admin User With Same Privileges as Pi


In LESSON 19 we showed how  to add users to the Pi with limited permissions. In this lesson we show how to add a user with Admin privileges just like the default “Pi” user.

Fist you will want to log on as the default “pi” user. After logging on, you can add another user with the command:

once the user is added, you can then give them admin privileges like the pi user my modifying the account with the command:

Now your user “paul” has the same admin privileges as “pi”. However if “paul” tries to execute a sudo command it will ask for his password. If you want “paul” to be able to execute sudo without entering password, you need to do the following:

NOTE: Messing up this file will corrupt your operating system. I suggest STRONGLY making a backup of your system before moving forward. Or, you could just leave things as they are, and “paul” will have to enter password when doing a sudo command

 and then you will be nano-editing a file. Add the following to the last line of the file:

paul ALL=(ALL) NOPASSWD: ALL

Then Control o and enter to save the file, and then control x to exit.

Raspberry Pi Linux LESSON 19: Adding New Users

In this lesson we show how to add new users to the Raspberry Pi. The default Pi account on the Raspberry Pi has sudo access, which means that when logged on as “pi” you can pretty much do anything you want by accessing the sudo command prefix. In this lesson we do not add a sudo user, but just one that can pretty much do things in their account folder.  To add another user named austin without sudo priviledges, you would use the command:

$ sudo useradd austin -m -s /bin/bash -g users

Then to assign a password, you would give the command:

$sudo passwd austin

Then enter the password when prompted.

In creating a new user in the “users” group, that new user can create and edit files in his folder (/home/austin), and can look at most things on the system, but can not change or add things outside his folder. To allow the user to have sudo privileges, he would need to be added to the sudo group.

To remove a user, you need to be logged into an account with sudo privileges, and then enter the command:

$sudo userdel austin

Which would delete the user austin. This command would delete the user, but would keep their files and folders (/home/austin), but the person could not log in any more. If you wanted to remove the user, and all their files, you would use the following command:

$sudo userdel -r austin

For this command, the user austin, and all his files are removed.

Raspberry Pi Linux LESSON 9: Using the Linux Sort Command

In this lesson we explore a new and very powerful Linux command . . . the sort command. The sort command allows you to sort a file alphabetically, numerically or by calendar month. We show how to sort forward or backward, and how to send the sorted list either to a file or to the terminal window. This quick video will get you up to speed on sorting in Linux.