Experiment Goal:
To enable the following features:
– capturing of live video by means of Raspberry Pi Camera module
– streaming of the captured video to custom PC Client
Constellation:
Components:
– Board: Raspberry Pi model B or higher (RPi-Model-B ebay/RPi2-Model-B ebay)
– OS SD-card: NUBS (preinstalled/self-made after download)
– Camera: Raspberry Pi Camera module (ebay) or PiNoIr Camera module (ebay)
– Wi-Fi: EdiMax EW-7811Un (ebay) dongle
Useful Links:
]]>Access to the configuration screen is possible at any time after you booted with RPi. This is useful in case something went wrong or was forgotten at first boot (ex. to set SSH enabled to be able to connect with Putty) or whenever you want to enable/disable additional advanced options.
At the Terminal’s command prompt, type:
sudo raspi-config
This may be necessary if you plan to use a single monitor+keyboard+mouse set for working with both your Raspberry Pi and for your PC while both are connected to the same LAN router which has DHCP Server (all modern routers), which assigns IP addresses automatically.
Depending on your RPi usage model, you may need to switch between the following work-modes in as fast and comfortable ways as possible:
– working on your PI/PC directly with the same monitor+keyboard+mouse
– working on RPi from your PC through some Remote Control Utility (ex.to see all on one screen for simultaneous observation and capturing of results)
To allow this fast switch, I would recommend connecting both your RPi and your PC to KVM switch. This will also allow you to manage with a single monitor only.
Once we connected all our HW and we know the IP address of our Raspberry PI (from the above step: ifconfig command) we can use at least 4 ways to connect and work remotely described below.
However, there is one problem with some remote access methods described further. Remote Desktop and TightVnc Server don’t work with main desktop, but only with the secondary desktop (Raspbian has 2 desktops by default) and I was unable to figure out how to make it working with main desktop.
Although working with a secondary desktop may be enough for many use-cases, there are cases where you would like to see what is displayed on the main desktop. In this case x11vnc server is recommended.
– Check your /etc/apt/sources.list contains the following lines (as described here):
deb http://archive.raspbian.org/raspbian wheezy main contrib non-free
deb-src http://archive.raspbian.org/raspbian wheezy main contrib non-free
– sudo apt-get update
– sudo apt-get dist-upgrade
– Raspberry Pi firmware updater: sudo rpi-update
sudo apt-get install -y xrdp sudo service xrdp stop sudo service xrdp start
2. Start Remote Desktop application (mstsc.exe in Windows) to access your RPI
sudo apt-get install -y tightvncserver
Access to main desktop with TightVnc Server is possible with TightVNC Viewer or Android VNC Client
After installing and configuring VNC server (x11vnc) you will have access to RP’s main desktop from Windows/Linux with standard VNCClient or TightVNC Viewer
– install
sudo apt-get install -y x11vnc
– create the VNC start-up configuration file, stored in home directory
sudo nano ~/.xsessionrc
– in nano editor edit the text as follows:
x11vnc -bg -shared -forever -tightfilexfer -nopw -display :0
– press CTRL+O then ENTER to write (save) the file then CTRL+X to exit
– make the file executable
sudo chmod 775 ~/.xsessionrc
– to configure HDMI resolution open /boot/config.txt
sudo nano /boot/config.txt
– in nano editor
hdmi_force_hotplug=1 ;SVGA 1024×768@60Hz: hdmi_group=2 hdmi_mode=16 ;Full HD 1920×1080@60Hz: hdmi_group=2 hdmi_mode=82
– Press CTRL+O then ENTER to write (save) the file then CTRL+X to exit
– restart your RPi
If you plan expose your RPi to the Internet (using NAT virtual server feature for example) you may want to protect your RPi from being accessed by strangers. The following actions may be taken for this purpose.
For this, use ‘sudo raspi-config’ command’s menu ‘Change User Password’
For information on how to do this you may use this link or x11vnc help command which is quoted below.
"... You can create an x11vnc password file by running: 'x11vnc -storepasswd password /path/to/passfile' or 'x11vnc -storepasswd /path/to/passfile' or 'x11vnc -storepasswd the last one will use '~/.vnc/passwd' x11vnc x11vnc -rfbauth /path/to/passfile an existing '~/.vnc/passwd' file from another VNC application will work fine too. @# You can also use the -passwdfile or -passwd options. Note -passwd is unsafe if local users are not trusted. Make sure any -rfbauth and -passwdfile password files cannot be read by untrusted users. Use x11vnc -usepw to automatically use your '~/.vnc/passwd' or '~/.vnc/passwdfile' password files. and prompt you to create ~/.vnc/passwd if neither file exists. Under -usepw, x11vnc will exit if it cannot find a password to use... "