Showing posts with label Raspberry Pi. Show all posts
Showing posts with label Raspberry Pi. Show all posts

Thursday, June 5, 2014

RaspBMC Remote Desktop

First of all, although possible to connect to setup remote desktop on RaspBMC it works awfully slow and probably does not bring a other usability than navigating through UI.
Video simply hangs so it's impossible to watch any.

These are the steps to set it up:
1.  Open your favorite text editor and save the script,

e.g. command : nano vncserver
and paste this script:

!/bin/sh

case $1 in
  start)
    if [ -f /var/run/vnc.pid ] ; then
      echo "VNC server is already running"
    else
      initctl stop xbmc
      sudo vnc_dispmanx 2>/dev/null &
      echo $! | sudo dd of=/var/run/vnc.pid
      initctl start xbmc
    fi
    ;;
  stop)
    if [ -f /var/run/vnc.pid ] ; then
      sudo kill -TERM $(cat /var/run/vnc.pid)
      sudo rm /var/run/vnc.pid
    else
      echo "VNC server is not running"
    fi
    ;;
  *)
    echo "Usage $0 start|stop"
    ;;
esac

2. chmod +x vncserver

3. sudo mv vncserver /usr/local/sbin

4. vncserver start
If you want to check if it's running, check if vnc_dispmanx has the default VNC port open (5900)
pi@raspbmc:~$ sudo netstat -lnptu |grep vnc
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      3687/vnc_dispmanx

tcp6       0      0 :::5900                 :::*                    LISTEN      3687/vnc_dispmanx

5. When you're done, you should turn it off, as it's quite CPU hungry: 

vncserver stop

Connecting with VNC viewerFrom Ubuntu you can use vncviewer:

sudo apt-get install vncviewer

vncviewer 192.168.1.101:5900


Sunday, December 22, 2013

Raspbmc home media center

Most of recent TV sets are already packed with bunch of hi-tech stuff that change the way we perceive watching TV. In the past we were bound to a range of channels, even though having satelite at home gave us quite a wide rande of it - counted in hundreds. The Internet added completely new possibilities. Almost every TV available today  has internet connectivity. We do not any longer have to stick to what is beeing broadcasted but we choose ourselves what to watch and when.

What if you have an old TV without RJ45 socket or WiFi? Do you have to buy special subscription or decoders to access a large entertainment centers?
No, you can have it all for free with Raspberry Pi.

All you need to do is download Raspbmc Linux image and put it on SD card, which you then insert to Raspberry Pi.
Then you plug Raspberry Pi to internet - Raspbmc has DHCP configured by default so it will boot and start setup automatically after you tun it on.
Then you also plug it to TV with HDMI cable and watch things happen.


Now..hm... I don't have a keyboard, how to steer my new media centre?
XBMC offers a few possibilities of remote control.
I found Yatse on my Andorid smart phone the easiest way.

You can then add audio and video plugins that allow you to watch or listen to various media channels, search through Youtube or Vimeo and many, many others...

Still don't forget you have a small computer on board so you can do other stuff with it, program, setup webserver, etc. If you'd like to connect to it even for such a prosaic thing as uploading some files, you can access it through SSH.

Here's a good tutorial how to do it.

E.g. to upload file to /tmp folder on Pi:
scp file.mp4 pi@192.168.1.105:/tmp

The default pi password is raspberry

If you want you can configure WiFi on Raspbmc like this.

You can also play with XBMC and try extending it with new features. Have a look at development tutorials here.

If you'd like to have access to media channels in your local language, like me in Polish, you'd probably find some plugins for your language in the web. I found some for mine.

Have fun !

Friday, November 1, 2013

Rapspberry Pi Webcam

Next trial with RP, this time setting up a webcam over HTTP.

I followed the steps:

1. Connect webcam to USB port, check device is recognized


lsusb
I got:

Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 046d:0802 Logitech, Inc. Webcam C200
Bus 001 Device 005: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter


2. Install Motion



sudo apt-get install motion
3. configure Motion



sudo nano /etc/motion/motion.conf
This is my file:

daemon=on
norm=3
input=8
auto_brightness=on
framerate=2
height=480
width=640
jpeg_filename=motion/%Y%m%d/%v-%H%M%S-%q
noise_tune=on
output_all=off
output_motion=off
output_normal=on
quality=100
snapshot_interval=300
target_dir=/home/pi
text_left=(c) Nestcam
text_right=%d %b %Y\n%k:%M:%S
threshold=500
v4l2_palette=6
videodevice=/dev/video0
webcam_localhost=off
webcam_maxrate=2
webcam_port=8080
wecam_quality=100

sudo nano /etc/default/motion
It should be:

start_motion_daemon=yes

4. Start motion daemon:

sudo /etc/init.d/motion start

Check logfile for any errors:

tail -f /var/log/syslog

If all is fine open in browser http://<your Raspberry Pi IP address>:8080