scottobear: (Default)

http://mausberrycircuits.com/pages/setup

SETUP

Connecting the switch to your Raspberry Pi 

For car switches: Car setup

For circuits without a button: Solder your own switch

Physical connections

On the switch PCB you will notice that the two leads are labeled “in” and “out.”Using the green diagram: Connect each lead to any GPIO-numbered pin (e.g. GPIO 17, GPIO 23, GPIO). Do not connect to a ground or power pin. GPIO 0 and 1 should be avoided as well. For Pi 2/A+/B+ GPIO click HEREThe script is setup by default for the “out” lead attached to GPIO 23 and the “in” lead attached to GPIO 24. If you would like to use different pins then simply change the pin in the script as explained at bottom of page.Connect your original Raspberry Pi power source/micro-USB cable into the micro-USB port on the switch.               For direct-plug circuits: Connect dircuit to Pi.

               For non-direct plug circuits: Connect another micro-USB cable from the circuit’s regular USB port to the power port of your Raspberry Pi.

Press the power button on the circuit and wait for your OS to boot.

Script setup

You can use either keyboard input or SSH to install the script for the switch

If you have a keyboard connected to your Pi then you can type the instructions listed below into the command line and there is no need to use SSH. The Pi must have internet access during installation (but not needed after) for setup. To access command line in RaspBMC, go to the power icon and then select exit and hit the ESC key when the blue screen shows up.

For SSH, recommend using Putty (www.putty.org) or WinSCP (winscp.net), both free.

To SSH into your Pi, find the Pi’s IP address provided by your router and enter it in the SSH client (use port 22). Common log-ins are:

RaspBMC/Raspbianuser: pi                      password: raspberryOpenELECuser: root                  password: openelecXbianuser: root                  password: raspberryArchuser: root                  password: root

Installing the script

For RaspBMC/Raspbian/Debian distributions (Xbian as well, omit the word sudo), type the following and hit enter after each line:

1. sudo wget http://files.mausberrycircuits.com/setup.sh

2. sudo bash setup.sh

3. sudo reboot

For OpenELEC:

1. wget http://files.mausberrycircuits.com/setupOE.sh

2. bash setupOE.sh

3. reboot

For Arch:

1. wget http://files.mausberrycircuits.com/setupArch.sh

2. bash setupArch.sh

3. reboot

After the Raspberry Pi has fully rebooted, your switch is now ready for use!

 

To use a different GPIO pin:

RaspBMC/Raspbian/Debian:

1. sudo nano /etc/switch.sh

OpenELEC:

1. nano /storage/.config/switch.sh

Arch:

1. nano /etc/switch.sh

At the top of the script you can change “GPIOpin1=23″ and “GPIOpin2=24″ to the pins of your choice as numbered in the header diagram above.

The white button on the rocker-switch circuits is a reset button – if for some reason the switch is not functioning as it should, put the rocker switch in the “off” position and press the reset button.

You can perform a hard-reset with the LED switch by holding for 5 seconds.

Please power down the Raspberry Pi prior to doing this (via SSH/remote/keyboard/mouse) as it will perform a hard reset if the Pi is still on.

image

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)

PROXYGAMBIT BETTER THAN PROXYHAM; TAKES COFFEE SHOP WIFI GLOBAL

Last weekend saw the announcement of ProxyHam, a device that anonymizes Internet activity by jumping on WiFi from public libraries and cafes over a 900MHz radio link. The project mysteriously disappeared and was stricken from the DEFCON schedule. No one knows why, but we spent some time speculating on that and on what hardware was actually used in the undisclosed build.

[Samy Kamkar] has just improved on the ProxyHam concept with ProxyGambit, a device that decouples your location from your IP address. But [Samy]’s build isn’t limited to ProxyHam’s claimed two-mile range. ProxyGambit can work anywhere on the planet over a 2G connection, or up to 10km (6 miles) away through a line-of-sight point to point wireless link.

The more GSM version of ProxyGambit uses two Adafruit FONA GSM breakout boards, two Arduinos, and two Raspberry Pis. The FONA board produces an outbound TCP connection over 2G. The Arduino serves as a serial connection over a reverse TCP tunnel and connects directly to the UART of a Raspberry Pi. The Pi is simply a network bridge at either end of the connection. By reverse tunneling a TCP connection through the ‘throwaway’ part of the build, [Samy] can get an Internet connection anywhere that has 2G service.

Although it’s just a proof of concept and should not be used by anyone who actually needs anonymity, the ProxyGambit does have a few advantages over the ProxyHam. It’s usable just about everywhere on the planet, and not just within two miles of the public WiFi access point. The source for ProxyGambit is also available, something that will never be said of the ProxyHam.

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)
Regarding Buffalo USB Nintendo gamepad controller for rasberry pi / retropie -

Tips for RetroPie:

There are 10 buttons, but this is an “8-button” gamepad because the Turbo and Clear buttons are modifier buttons and not action buttons. These buttons, in fact, do not appear to the operating system at all. When you do gamepad configuration in EmulationStation or any with any configuration tool, the Turbo and Clear don’t appear. The turbo/clear functions are built into the controller itself.

To apply turbo, press-and-hold Turbo, and press the button to which you want to apply turbo. So enable turbo for button A, press Turbo+A. To turn off turbo for A, you Clear+A. You apply turbo to buttons independently, so you can, for instance, have turbo turned on for buttons A and X, but not B or Y.

This (and all) controllers require TWO configurations: one for EmualtionStation (the menu system), and one for playing games. The first one is easy because a graphical tool steps you through it. The configuration for games requires that you edit a text file. Second, even after you configure it for games, some emulators, such as the one for SNES, will get buttons mixed up. To fix this, you need to specify a different driver. So to fix BOTH these issues, do the following:

(1) Exit EmulationStation to the console, and optionally start LX (startx)
(2) Append the following to: /opt/retropie/configs/all/retroarch.cfg

# Start
input_joypad_driver = linuxraw
input_player1_joypad_index = "0"
input_player1_up_axis = "-1"
input_player1_down_axis = "+1"
input_player1_left_axis = "-0"
input_player1_right_axis = "+0"
input_player1_a_btn = "0"
input_player1_b_btn = "1"
input_player1_x_btn = "2"
input_player1_y_btn = "3"
input_player1_select_btn = "6"
input_player1_start_btn = "7"
input_exit_emulator_btn = "4"
input_menu_toggle_btn = "5"
# End

(3) Reboot the Pi and you’re good to go. The left-front button will exit out of games and get you back to the EmulationStation menu. The right button brings up the in-game menu, although up/down on the gamepad doesn’t change menu items. That may be a side-effect of using the linuxraw driver above. You can either comment out the linuxraw line, or use a keyboard to move through that in-game menu.

Regarding Cirago Bluetooth 3.0 High Speed & Wi-Fi Combo USB Mini Adapter, Class 2 (BTA7300) - seems to work out of box.

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)

Make sure any and all roms for the retropie I make for / give to Sean (or anyone) are all Public Domain. Don’t want either of us to hit any bumps over a rogue copy of Yar’s Revenge.

Is archive.org’s ROM list correct? Are these all Public Domain?
https://archive.org/details/internetarcade
https://archive.org/details/consolelivingroom
https://archive.org/details/tosec
https://archive.org/details/softwarelibrary
https://archive.org/details/historicalsoftware

PDRoms biggest (to me) known resource for public domain and test files for nearly every console ever released.

Other sources to check -

http://www.theoldcomputer.com/
http://mamedev.org/roms/
https://sites.google.com/site/jbrodack/
http://www.chrismcovell.com/creations.html
http://www.zophar.net/pdroms.html
http://www.theoldcomputer.com/roms/index…lic-Domain
http://www.freeroms.com/roms/snes/public_domain.htm
http://snesbox.com/game/public-domain/rom
http://www.emulator-zone.com/doc.php/roms.html
http://www.doperoms.com/roms/Super_Nintendo_Snes.html
http://www.romnation.net/srv/roms/54522/…omain.html
http://www.emuparadise.me/Neo_Geo_Pocket…main/90841
http://atariage.com/forums/topic/150242-…-roms-etc/
http://www.giantbomb.com/forums/general-…es-392080/

https://archive.org/details/internetarcade
https://archive.org/details/consolelivingroom
https://archive.org/details/tosec
https://archive.org/details/softwarelibrary
https://archive.org/details/historicalsoftware


Tweak this to put the original Fallout on the Pi? – might be a fun goof to have in the PIp-boy. (video) – reference (mentions sound changes, possibly updated in newest version)


PROTIP : Raspbian is essentially Debian
Debian comes with package managment ,
long before Appstores and the like existed. Most Linux distros
have package managment , and under Debian it’s called APT
(Advanced Package Managment).
Packages are stored in online repositories , and accessed through
a package manager.

apt-get is a simple command-line tool
aptitude is a graphical package manager
synaptic is a GUI package manager

CODE: SELECT ALL

sudo apt-get update
sudo apt-get install dosbox

(wheezy version is here, too)

 

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)

By Case -

Rainbow – Mame  - Roms for atari 800 and some of my old bits and bobs that I ‘ve owned for years and would love to play again +- http://blog.petrockblock.com/2012/07/22/retropie-setup-an-initialization-script-for-retroarch-on-the-raspberry-pi/ (32 gig sd card) -

(Possibly add media center?)

Bumblebee with added Monitor HAT – Kali Linux / Pen Tester - https://learn.adafruit.com/kali-linux-on-the-raspberry-pi-with-the-pitft/installing-kali - Maybe PwnPi? HaPi? (8 gig sd)

Smoke – TOR / Router and/or – Access Point for Xfinity to use at in-laws (so they can hit netflix with the smart dvd player through the walled garden of xfinity wifi to wifihttp://qcktech.blogspot.com/2012/08/raspberry-pi-as-router.html (4 gig sd card) – Raspberry B+ 512 k  (all others are Raspi 2, model B 1 gig

Frost Gray – Pi – Pye-Newt-Cam – stream live to youtube  / stills via dropbox (using Motion) – may use a small HAT monitor? (8 gig sd)  - pi 2 model b - http://www.pubnub.com/blog/create-realtime-raspberry-pi-security-camera-w-parse/

Black Box – Media Center – Kodi http://kodi.wiki/view/HOW-TO:Install_Kodi_on_Raspberry_Pi, something else.  (8 gig sd) Raspi 2 model b, for the house

 


re:tor -

7 Things You Should Know About Tor

We posted last week about the Tor Challenge and why everyone should use Tor. Since we started our Tor Challenge two weeks ago we have signed up over 1000 new Tor relays. But it appears that there are still some popular misconceptions about Tor. We would like to take this opportunity to dispel some of these common myths and misconceptions.

1. Tor Still Works

One of the many things that we learned from the NSA leaks is that Tor still works. According to the NSA “Tor Stinks” slides revealed by the Guardian last year, the NSA is still not able to completely circumvent the anonymity provided by Tor. They have been able to compromise certain Tor users in specific situations. Historically this has been done by finding an exploit for the Tor Browser Bundle or by exploiting a user that has misconfigured Tor. The FBI—possibly in conjunction with the NSA—was able to find one serious exploit for Firefox that lead to thetakedown of Freedom Hosting and exploit of its users. Firefox was patched quickly, and no major exploits for Firefox affecting Tor users appear to have been found since.
As the Tor developers noted in 2004, if someone is actively monitoring both your network traffic and the network traffic of the Internet service you’re communicating with, Tor can’t prevent them from deducing that you’re talking to that service. Its design does assume that at least one side of the connection isn’t being monitored by whomever you’re trying to stay private from.

We can conclude from this that Tor has probably not been broken at a cryptographic level. The best attacks on Tor are side-channel attacks on browser bugs or user misconfiguration and traffic correlation attacks.

2. Tor is Not Only Used by Criminals

One of the most common misconceptions we hear is that Tor is only used by criminals and pedophiles. This is simply not true! There are many types of people that use Tor. Activists use it to circumvent censorship and provide anonymity. The military uses it for secure communications and planning. Families use Tor to protect their children and preserve their privacy. Journalists use it to do research on stories and communicate securely with sources. The Tor Project website has an excellent explanation of why Tor doesn’t help criminals very much. To paraphrase: Criminals can already do bad things since they will break laws they have much better tools at their disposal than what Tor offers, such as botnets made with malware, stolen devices, identity theft, etc. In fact using Tor may help you protect yourself against some of these tactics that criminals use such as identity theft or online stalking.

You are not helping criminals by using Tor any more than you are helping criminals by using the Internet.

3. Tor Does Not Have a Military Backdoor

Another common opinion that we hear is that Tor was created by the military and so it must have a military backdoor. There is no backdoor in the Tor software. It is true that initial development of Tor was funded by the US Navy. However, it has been audited by several very smart cryptographers and security professionals who have confirmed that there is no backdoor. Tor is open source, so any programmer can take a look at the code and verify that there is nothing fishy going on. It is worked on by a team of activists who are extremely dedicated to privacy and anonymity.

4. No One in the US Has Been Prosecuted For Running a Tor Relay

As far as EFF is aware, no one in the US has been sued or prosecuted for running a Tor relay. Furthermore we do not believe that running a Tor relay is illegal under US law. This is, of course, no guarantee that you won’t be contacted by law enforcement, especially if you are running an exit relay. However EFF believes this fact so strongly that we are running our own Tor relay. You can find out more about the legalities of running a Tor relay at the Tor Challenge Legal FAQ. However, if you are going to use Tor for criminal activity (which the Tor project asks that you not do) you can create more problems for yourself if you get prosecuted. Criminal activity also brings more scrutiny on to Tor making it worse for the public as a whole.

5. Tor is Easy to Use

You might think that because it is privacy software Tor must be hard to use. This is simply not true. The easiest way to get started with Tor is to download the Tor Browser Bundle. This is a browser that comes pre-configured to use Tor in a secure manner. It is easy to use and is all you need to start browsing with Tor. Another easy way to use Tor is with Tails. Tails is a live operating system that runs on a DVD or thumb drive. Tails routes your entire Internet connection through Tor. And when you shut it down, Tails “forgets” everything that was done while it was running.

6. Tor is Not as Slow as You Think

It is true that Tor is slower than a regular Internet connection. However, the Tor developers have been doing a lot of hard work to make the Tor network faster. And it is faster today than ever before. One of the best things that can be done to speed up the Tor network is to create more relays. If you would like to contribute to making the Tor network faster, you can check out our Tor Challenge

7. Tor is Not Foolproof

Tor is not perfect; you can destroy your own anonymity with Tor if you use it incorrectly. That’s why it is important to always use Tor Browser Bundle or Tails and make sure that you keep your software up to date. It is also important to remember that if you log into services like Google and Facebook over Tor, those services will still be able to see your communications within their systems. Additionally Tor users should be mindful of the fact that an adversary who can see both sides of their connection may be able to perform a statistical analysis to confirm that the traffic belongs to you.

Tor is some of the strongest anonymity software that exists. We think that it is important to dispel misconceptions about it so that the public can be more informed and confident in its usefulness. There are many great reasons to use Tor and very few reasons not to. So get started with Tor, and take back your privacy online.

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)

Contents

What does it do?

This project configures your Raspberry Pi to connect to the Internet through ethernet, and share that connection over WiFi.

What do you need?

  • A Raspberry Pi, model B.
  • A boot SD card for the Raspberry Pi.
  • A USB WiFi device that supports “Access Point” mode.
  • An Ethernet cable to connect to the local network.

Please make sure you Wifi dongle supports Access Point or Master Mode

  • Edimax does NOT support Access Point (UPDATE 7/9/13: Edimax DOES support Access point, tutorial here: Raspberry Hotspot with Edimax USB WiFi Adapter)
  • AirLink 101 / AWL5088 does NOT support Access Point
  • Panda Ultra, Mid-Range and 300Mbps Wireless N adapters support Access Point
  • Ralink RT5370 and RT5372 DO support Access Point

What skill level is required?

This project does not require any coding or compilation. Very basic Linux and networking knowledge would be useful, but not essential.

To edit a configuration file (for example /etc/udhcpd.conf) use the following command

sudo nano /etc/udhcpd.conf

You will find yourself in a simple editor. Move around using the arrow keys. To save the file press Ctrl-o. To exit press Ctrl-x.

How does it work?

The Raspberry Pi is configured as a WiFi Hotspot, just like you would see in an internet cafe. It allows you to connect to the internet over WiFi using the Raspberry Pi as the bridge to the internet. The basic steps are

  • Enable a WiFi Access Point and broadcast on the channel of your choice
  • Assign dynamic IP addresses to any device that connects to WiFi network
  • Join the WiFi and Ethernet networks together by using Network Address Translation

Instructions

The following steps were performed on Raspbian but should be much the same on any Debian-based distro.

1. Install the necessary software.

sudo apt-get install hostapd udhcpd

2. Configure DHCP. Edit the file /etc/udhcpd.conf and configure it like this:

start 192.168.42.2 # This is the range of IPs that the hostspot will give to client devices.
end 192.168.42.20
interface wlan0 # The device uDHCP listens on.
remaining yes
opt dns 8.8.8.8 4.2.2.2 # The DNS servers client devices will use.
opt subnet 255.255.255.0
opt router 192.168.42.1 # The Pi's IP address on wlan0 which we will set up shortly.
opt lease 864000 # 10 day DHCP lease time in seconds

Edit the file /etc/default/udhcpd and change the line:

DHCPD_ENABLED="no"

to

#DHCPD_ENABLED="no"

You will need to give the Pi a static IP address with the following command:

sudo ifconfig wlan0 192.168.42.1

To set this up automatically on boot, edit the file /etc/network/interfaces and replace the line “iface wlan0 inet dhcp” to:

iface wlan0 inet static
  address 192.168.42.1
  netmask 255.255.255.0

If the line “iface wlan0 inet dhcp” is not present, add the above lines to the bottom of the file.

Change the lines (they probably won’t all be next to each other):

allow-hotplug wlan0
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet manual

to:

#allow-hotplug wlan0
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp

3. Configure HostAPD. You can create an open network, or a WPA-secured network. A secure network is recommended to prevent unauthorized use and tampering, but you can also create an open network. To create a WPA-secured network, edit the file /etc/hostapd/hostapd.conf (create it if it doesn’t exist) and add the following lines:

interface=wlan0
driver=nl80211
ssid=My_AP
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=My_Passphrase
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

Change ssid=, channel=, and wpa_passphrase= to values of your choice. SSID is the hotspot’s name which is broadcast to other devices, channel is what frequency the hotspot will run on, wpa_passphrase is the password for the wireless network. For many, many more options see the file /usr/share/doc/hostapd/examples/hostapd.conf.gz

If you would like to create an open network, put the following text into /etc/hostapd/hostapd.conf:

interface=wlan0
ssid=My_AP
hw_mode=g
channel=6
auth_algs=1
wmm_enabled=0

Change ssid= and channel= to values of your choice. Note that anyone will be able to connect to your network, which is generally not a good idea. Also, some regions will hold an access point’s owner responsible for any traffic that passes though an open wireless network, regardless of who actually caused that traffic.

Edit the file /etc/default/hostapd and change the line:

#DAEMON_CONF=""

to:

DAEMON_CONF="/etc/hostapd/hostapd.conf"

4. Configure NAT (Network Address Translation). NAT is a technique that allows several devices to use a single connection to the internet. Linux supports NAT using Netfilter (also known as iptables) and is fairly easy to set up. First, enable IP forwarding in the kernel:

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

To set this up automatically on boot, edit the file /etc/sysctl.conf and add the following line to the bottom of the file:

net.ipv4.ip_forward=1

Second, to enable NAT in the kernel, run the following commands:

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT

These instructions don’t give a good solution for rerouting https and for URLs referring to a page inside a domain, like www.nu.nl/38274.htm. The user will see a 404 error. Your Pi is now NAT-ing. To make this permanent so you don’t have to run the commands after each reboot, run the following command:

sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"

Now edit the file /etc/network/interfaces and add the following line to the bottom of the file:

up iptables-restore < /etc/iptables.ipv4.nat

5. Fire it up! Run the following commands to start the access point:

sudo service hostapd start
sudo service udhcpd start

Your Pi should now be hosting a wireless hotspot. To get the hotspot to start on boot, run these additional commands:

sudo update-rc.d hostapd enable
sudo update-rc.d udhcpd enable

At the completion of these instructions, your Pi should be providing a wireless network and allowing other devices to connect to the Internet. From my experience, the Pi makes a decent access point, although with cheaper WiFi dongles range will be fairly limited. I haven’t stress tested this setup, but it seems to work fairly well and is handy when a “real” access point isn’t available. I wrote most of the instructions from memory, if you find any errors/typos I’ll correct them.

This tutorial originally was a post on the Raspberry Pi forum here, you can reply to that topic if you have issues. Thanks go to all the people who tested my tutorial on the forum, and to poing who contributed the WPA HostAPD config.
Please make sure you Wifi dongle supports Access Point or Master Mode

  • Edimax doesn’t support Access Point (UPDATE 7/9/13: Edimax DOES support Access point, tutorial here: Raspberry Hotspot with Edimax USB WiFi Adapter)
  • AirLink 101 / AWL5088 doesn’t support Access Point
  • Panda Ultra, Mid-Range and 300Mbps Wireless N Adapters support Access Point
  • Ralink RT5370 supports Access Point

via - http://elinux.org/RPI-Wireless-Hotspot

 


see also  - http://itsacleanmachine.blogspot.com/2013/02/wifi-access-point-with-raspberry-pi.html

http://qcktech.blogspot.com/2012/08/raspberry-pi-as-router.html

https://github.com/scottobear/rpi-update

 

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)

At the command prompt type

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

This will load a basic text editor with the wifi configuration file.

You will just need to add a new “section” to the file for your network or modify an existing one.

e.g. Say that your SSID is “salmagundi” and it uses WPA2 security with a wifi password of “n0beef” you would add the following lines

network ={
ssid=”salmagundi”
psk=”n0beef”
key_mgmt=WPA-PSK
proto=RSN
pairwise=CCMP TKIP
group=CCMP TKIP
auth_alg=OPEN
}

To save this press <Ctrl> X then press Y and finally press <ENTER>.

At this point if you reboot your device it should then connect to your WiFi.

type

sudo reboot

Now remove the Ethernet Cable.

During boot up you should see the WiFi dongle’s activity light start blinking (rapidly) to indicate it has established a connection to your wifi.

see also - https://learn.adafruit.com/adafruits-raspberry-pi-lesson-3-network-setup/finding-your-pis-ip-address

 

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)

http://www.instructables.com/id/Raspberry-Pi-Dropbox-Alternative/

also - http://pimylifeup.com/raspberry-pi-webcam-server/

Step 1: Resources

I have to start with credit to the websites that I used for my research:http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome - The software I used was called Motion, it handles the streaming of the webcam to the web as well as detecting motion and saving the movie files.

https://github.com/andreafabrizi/Dropbox-Uploader - This software allow you to sync your files into a Dropbox Account

http://www.slblabs.com/2012/09/26/rpi-webcam-stream/ - This site explains a few different ways to setup the camera on the raspberry pi to set up a simple web stream of the image.

http://mogshade.wordpress.com/2012/12/23/simple-home-security-with-raspberry-pi-and-dropbox/ - This site is where i started with for implementing the upload of the movie files to a Dropbox account

http://www.instructables.com/id/Host-your-website-on-Raspberry-pi/ - This Instructable was used to set up a simple website to view your Web Stream from.

Step 2: Setting Up Your Raspberry Pi

Picture of Setting Up Your Raspberry Pi
First things first. The raspberry pi should be setup with a standard version of Raspbian. If any help on doing this is needed please refer tohttp://www.raspberrypi.org/ or http://learn.adafruit.com/adafruit-raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-piWe also need to setup a SSH connection to access the Raspberry Pi remotely. So do this refer tohttp://raspberrypi4dummies.wordpress.com/2013/03/17/connect-to-the-raspberry-pi-via-ssh-putty/

Now You should setup port forwarding for your raspberry pi for both port 80 and 8081
while you are in your router settings also write down your Raspberry Pi’s Public IP address as it will be what we use in the next few steps.

Step 3: Installing the Motion Detection Software

Picture of Installing the Motion Detection Software

Now lets install the Motion Software onto the Raspberry Pi.

1) Install Motion using the following commands:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install motion

2) Now lets setup the Motion Software, the following will open the configuration file:
sudo nano /etc/motion/motion.conf

a) In this file, you can adjust a whole bunch of things in the motion software but there are a few things that we need to change first
daemon – default is set to OFF, we need to set it to ON so that it will run in the background
webcam_localhost – Set to OFF so that you can access the stream from other computers
stream_port – Take note of the port as this is where you will point your browser to view the stream
control_localhost – Set to OFF as this will allow you to adjust some of the features remotely (I dont use this but it could be useful)
control_port – Take note of this port as it will be how you can change some parameters remotely in your web browser
framerate – I set this to 2 or 3 frames per second (over 5 will bog down your Pi)

b) We also need to change one last setting:
sudo nano /etc/default/motion
change “start_motion_daemon=no” to “start_motion_daemon=yes

Now if you start the Motion software, in some browsers you will be able to view the stream. if you cannot yet, we will correct that in the next step.

Step 4: Setting up the Web Server

Picture of Setting up the Web Server
Next thing to make the web stream visible from nearly all browsers we need to setup a small web server on the raspberry pi along with a simple HTML page.We are going to install Apache, PHP5, and PHP5 mod for apache. Not all of them may be used in this project but they are good to have in case you want to make your website a bit more that we will setup here.

Now Install the applications with the following command:
sudo apt-get install apache2 php5 libapache2-mod-php5 

Next allow overrides:
sudo nano /etc/apache2/sites-enabled/000-default

Change “AllowOverride None” to “AllowOverride ALL

Now restart the server to to allow the overrides

sudo service apache2 restart

Now your Website is Up and running. If you type the IP address for your Raspberry Pi into a browser you should be able to see a simple website.

Step 5: Setting Up a Basic Webpage

Picture of Setting Up a Basic Webpage
Now that you have a basic website being hosted on your raspberry Pi as well as the motion capture software lets combine the two.first lets change the permissions to the directory for the HTML file

sudo chmod 777 /var/www

If you type in the following command line it will bring you to the HTML file that is the front page of your website:

sudo nano /var/www/index.html

This file currently contains the HTML code for a very basic website. We are going to change it to the following in order to display the web streaming image.

<xmp>
<html>
<body>
<h1> Raspberry Pi DropBox Camera Stream </h1>
<img src=”http://Raspberry pi’s IP:8081″>
</body>
<html>
</xmp>

Note: Remove the <xmp> & </xmp>, this was the only way I know to get HTML into an instructable

Save this file and then in a web browser type in the raspberry pi’s IP address and check out your new website

Step 6: Linking your Raspberry Pi to your Dropbox Account

Picture of Linking your Raspberry Pi to your Dropbox Account
First be sure that you have a DropBox account (www.dropbox.com). If you do not then set one up before going on.Then Download Dropbox Uploader
First Change to which ever directory that you would like to install this program into (I just did it to the Home Directory)

Now download the application using the following command:
curl “https://raw.github.com/andreafabrizi/Dropbox-Uploader/master/dropbox_uploader.sh” -o dropbox_uploader.sh

Now change the permissions of the program
sudo chmod +x dropbox_uploader.sh

Finally run the script and follow the instructions it gives you.  This will guide you through setting up the OAuth connection to your dropbox account
./dropbox_uploader.sh

If you have any issues, try reading the README.txt in the files you downloaded or visible here

https://github.com/andreafabrizi/Dropbox-Uploader/blob/master/README.md

Step 7: Create Automatic Dropbox Uploads

Picture of Create Automatic Dropbox Uploads
Now we just need to create 2 Python Scripts. One to upload the Movie files and another to clear the temp directory from time to time.First lets start with with creating the Python Script to Upload to Dropbox automatically.

Change the directory to which ever directory you would like (i did this in the home directory)
Then use the following command to create the script called Uploader

sudo nano uploader.py

Now you should be in the blank python script file. Insert the following code into the file.
Please Note that this script is assuming that Motion’s files are being saved in the Temp Directory (the default)

import os
path=”/tmp/motion/”
def upload_files():
if not os.path.exists(path):
return
os.stdir(path)
for files in os.listdir(“.”):
if files.endswith(“.avi”):
cmd = “/home/pi/dropbox_uploader.sh upload ” + path + files
os.system(cmd)
os.system(“sudo rm /tmp/motion/” + files)
if _name_ == “_main_”:
upload_files()

Save and close the file (CTRL + X)

Now lets create the second File that clears the Temp Directory (this will happen each time the raspbery pi is restarted but I wanted to have more control)

sudo nano cleartmp.py

In this new file place the following simple code

import os
os.system(“sudo rm /tmp/motion/” + “*.jpg”)

again Save and Close the file (CTRL + X)

Now One last time to make these two things run automatically

Type the following command to modify the crontab file

crontab -e

Add the following to lines to the bottom of this file

* * * * * python /home/pi/uploader.py # Sync webcam files dropbox to run each minute
@hourly python /home/pi/cleartmp/pr #Clear temp for motion each hour

Close and Save

Step 8: Finished

Picture of Finished
Now you are all set. I know that alot of this was a brute force method but it works. Also be careful as the website not very secure as it is just accessed via your IP address.Finally, you can go through and play with the settings in motion to fine tune it as to what you would like.

Enjoy!

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)

wpid-screenshot_2014-07-08-18-37-58_kindlephoto-134975773.png

  1. Set up a tiny (3.5″) display on one of the Raspberry Pis -
  2. then slap Kali Linux on that device.
  3. House Temperature / Humidity Sensor Monitor and  Kitty Cam
  4. Media CenterWill it Do Netflix? 

Possible others:

Since I’ve recently received for Fur-baby father’s day last Saturday at Micro Center -

MCM Electronics Raspberry Pi 2 Model B Camera Kit  -

Raspberry Pi 2 Model B Board, 8GB Operating System microSD Card, Multicomp Clear Pi 2 Model B Case, Raspbery Pi Wi-Pi wireless ethernet adapter, Raspberry Pi Power Supply, Pi Camera, 36 Page Raspberry Pi User Guide

MCM Electronics Raspberry Pi 2 Model B Media Center -

Raspberry Pi 2 Model B Board, 8GB Operating System microSD Card, Multicomp Black Pi 2 Model B Case, Raspberry Pi Power Supply, Wi-Pi Wireless Adapter, 3′ HDMi Cable, 7′ Ethernet Cable, 36 Page Raspberry Pi User Guide

MCM Electronics Raspberry Pi 2 Model B Complete Kit

Raspberry Pi 2 Model B Board, 8GB Operating System microSD Card, Multicomp Clear Pi 2 Model B Case, Raspberry Pi Power Supply, Wi-Pi Wireless Adapter, Raspberry PI Drawstring Bag, Raspberry Pi Power Supply, Wi-Pi Wireless Adapter, Cyntech Raspberry Pi Hub, USB Keyboard, USB Mouse, 3′ HDMi Cable, 36 Page Raspberry Pi User Guide

(To make the Keyboard behave properly with the Raspberry Pi, I had to do the following -

  • Switch to root user.
  • Run ‘dpkg-reconfigure locales’ and change from en_GB.UTF-8 to en_US.UTF-8.
  • Run ‘dpkg-reconfigure keyboard-configuration’ and change the keyboard to USA PC104 )

Additionally, I still have my Arduino Starter Kit. (from my Birthday haul this year)

1 x Arduino Projects Book
1 x Arduino UNO Rev 3 microcontroller
1 x USB cable
1 x Breadboard
1 x Easy-to-assemble wooden base
1 x 9V battery snap
70 x Solid core jumper wires
2 x Stranded jumper wires
6 x Photoresistors
3 x Potentiometers (10K ohm)
10 x Push buttons
1 x Temperature sensor
1 x Tilt sensor
1 x Alphanumeric LCD (16×2 character display)
1 x Bright white LED
1 x Multicolor RGB LED
8 x Red LEDs
8 x Green LEDs
8 x Yellow LEDs
3 x Blue LEDs
1 x Small DC motor (6/9V)
1 x Small servo motor
1 x Piezo capsule
1 x H-bridge motor driver
2 x Optocouplers
5 x Transisitors
2 x Mosfet transistors
5 x 100nF capacitors
3 x 100uF capacitors
5 x 100pF capacitors
5 x Diodes
3 x Transparent gels (red, green, blue)
1 x 40 pin male header strip
20 x 220 ohm resistors
5 x 560 ohm resistors
5 x 1K ohm resistors
5 x 4.7K ohm resistors
10 x 10K ohm resistors
5 x 1M ohm resistors
5 x 10M ohm resistors

I’ve also ordered:

PiTFT Plus 480x320 3.5

PiTFT Plus 480×320 3.5″ TFT+Touchscreen for Raspberry Pi – Pi 2 and Model A+ / B+ PID: 2441

Raspberry Pi Model B+ / Pi 2 Case Lid - Clear
Raspberry Pi Model B+ / Pi 2 Case Lid – Clear PID: 2257
Pi Model B+ / Pi 2 Case Base - Clear
Pi Model B+ / Pi 2 Case Base – Clear PID: 2253
Assembled Pi Cobbler Plus - Breakout Cable for Pi B+/A+/Pi 2
Assembled Pi Cobbler Plus – Breakout Cable for Pi B+/A+/Pi 2 PID: 2029
I may investigate a battery pack later, but for now, plugging into the wall looks good. 

Originally published at The Scotto Grotto. You can comment here or there.

Profile

scottobear: (Default)
scott von berg

April 2017

S M T W T F S
       1
2 345678
9 10 11 12 13 14 15
16 1718 19 20 21 22
23 2425 26 2728 29
30      

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Oct. 3rd, 2025 09:57 am
Powered by Dreamwidth Studios