Wednesday, 12 August 2015

_Netbook based Video Surveillance using yawcam

SOURCE:
http://community.spiceworks.com/topic/486487-yawcam-webcam-server-alternatives

this is Windows alternative to RPi kerberos.io due to responsiveness issue,
looking for similar linux solution

_[Raspberry Pi] Jasper, voice recognition solution

SOURCE:
http://jasperproject.github.io/documentation/installation/

_[Raspberry PI] web server surveillance system Kerberos.io

SOURCE:
https://kerberos.io/

[Raspberry Pi] Using GPIO port, infrared remote control access (IR sensor)

SOURCE:
16x2 LCD to display status
http://www.adafruit.com/products/181
GPIO setup tutorial
https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/test-and-configure
What to do with I2C and SPI
http://quick2wire.com/articles/i2c-and-spi/

tutorials
http://www.modmypi.com/blog/raspberry-pis-remotes-ir-receivers
how to add lirc_rpi
http://www.jamesrobertson.eu/blog/2013/may/19/installing-lirc-on-raspbian.html
comprehensive tutorial
http://alexba.in/blog/2013/01/06/setting-up-lirc-on-the-raspberrypi/

python GPIO
http://openmicros.org/index.php/articles/94-ciseco-product-documentation/raspberry-pi/218-2-raspberry-pi-gpio-inputs-in-python

[Raspberry Pi] passwordless ssh login to pi

I have been rebooting raspberry pi a lot lately, and had to SSH into it each time manually and type in password.

There is a simple way to SSH without typing password each time.

1. On laptop 'ls ~/.ssh'
1.1 if above returns id_rsa.pub or id_dsa.pub, key already exists
1.2 if nothing returns or to make new keys 'ssh-keygen -t rsa -C login@devicename' (e.g. ssh-keygen -t rsa -C "kee@myThinkpad0")
1.3 'cat ~/.ssh/id_rsa.pub' returns 'ssh-rsa <RANDOM CHARACTERS> kee@myThinkpad0'

2. Use this command to append public key to Pi, cat ~/.ssh/id_rsa.pub | ssh <USERNAME>@<IP-ADDRESS> 'cat >> .ssh/authorized_keys'
2.1 I typed( cat ~/.ssh/id_rsa.pub | ssh pi@10.42.0.2 'cat >> .ssh/authorized_keys' )
2.2 This command asked for password, and did not succeed.
2.3 Checking whether the file or folder existed on Pi, 'ls ~/.ssh' returned nothing.
2.4 So, created a folder by 'mkdir ~/.ssh' on Pi made 2.1 work.

The source file mentions "Agent admitted failure to sign using the key" error as well as scp method.

I personally prefer scp (scp ./id_rsa.pub pi@10.42.0.2:~/.ssh), however, this might replace previous file which may not be preferred in some cases.

Source: https://www.raspberrypi.org/documentation/remote-access/ssh/passwordless.md

[Raspberry Pi] unknown host problem with shared internet

I have shared my laptop wifi internet access with raspberry pi using ethernet cable in previous post.

However, when I tried to ping www.google.com, it gave me an error of unknown host.

Trying to 'ping 8.8.8.8' also returned error, while to ping actual IP address worked. (i.e. 'ping xxx.xxx.xxx.xxx')

smithg400 from the source website mentioned specifying gateway in /etc/network/interfaces as well as DNS resolution and to have a look at /etc/resolv.conf

/etc/network/interfaces already had a gateway set up to the IP address of my laptop.

sudo cat /etc/resolv.conf returned empty. So I added nameserver xx.xx.xx.xx on the resolv.conf, which made DNS resolution work and I could ping www.google.com

This however, disappeared once I rebooted. Quick 'man resolvconf' returned that configuration file for resolv.conf is at /etc/resolvconf.conf. So, fix this file as well for persistent result.



Source: https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=57024

Tuesday, 11 August 2015

[Raspberry Pi] Connecting to raspberry pi using ethernet cable on linux mint 17 laptop

This post has been created using various sources I found on google.

1. To directly connect to PI, without sharing internet
2. Sharing internet

SOURCE:
http://stackoverflow.com/questions/16040128/hook-up-raspberry-pi-via-ethernet-to-laptop-without-router
http://elinux.org/RPi_cmdline.txt
https://pihw.wordpress.com/guides/direct-network-connection/
http://www.linuxcircle.com/2013/05/03/connecting-rpi-to-laptop-ethernet/
https://www.youtube.com/watch?v=ZK-JHfJqmkY

1.1 If headless (no monitor and keyboard for pi), mount SD card on your laptop
1.2 Go to boot partition, append ip=169.254.0.2 and save
1.3 Go to main partition, modify /etc/network/interfaces as below
1.3.1 (Recommended) save a copy of interfaces file for other setup
1.3.2 (Above procedures can be done on the RPi OS once logged in)
------------------------------------------------------------------------------------------------------------
auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet static
address 169.254.0.2
netmask 255.255.255.0
gateway 169.254.0.1

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



-----------------------------------------------------------------------------------------------------------
1.4 On laptop, click on network connections, add a new 'Ethernet' connection.
1.4.1 Name the connection as you like, go to IPv4 settings
1.4.2 Change Method: Manual, Add Addresses and set to 169.254.0.1
1.4.3 Netmask 255.255.255.0 Gateway 0.0.0.0



1.5 Reboot RPi and you can SSH using ssh pi@169.254.0.2








2.1 On laptop, click network icon. On drop down menu click network connections.
2.1.1 Name the new Ethernet connection as you wish, go to IPv4 tab
2.1.2 Change Method: Shared to other computers
2.1.3 Click this new connection on network dropdown menu
2.2 On laptop terminal, enter 'cat /var/lib/misc/dnsmasq.leases'
2.1.1 (Output looks like below, remember ip address)
----------------------------------------------------------------------------
1439123882 b8:27:eb:a1:b2:c3 10.42.0.39 raspberrypi
----------------------------------------------------------------------------

2.2 On raspberry pi, modify /etc/network/interfaces as below
--------------------------------------------------------------------------------------------------------
auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet static
address 10.42.0.39
netmask 255.255.255.0
gateway 10.42.0.1
--------------------------------------------------------------------------------------------------------
2.3 Reboot OR if using keyboard and monitor 'sudo ifdown eth0' and 'sudo ifup eth0' to get new ip address
2.4 'ping www.google.com' to test the connection