|
# https://github.com/debian-pi/raspbian-ua-netinst |
|
$ wget `curl -s https://api.github.com/repos/debian-pi/raspbian-ua-netinst/releases/latest | python -mjson.tool | grep 'browser_download_url' | grep 'img.bz2' | cut -d'"' -f4` -O raspbian-ua-netinst.img.bz2 |
|
$ bunzip2 raspbian-ua-netinst.img.bz2 |
|
$ diskutil list |
|
$ diskutil unmountDisk /dev/diskX |
|
$ sudo dd bs=1m if=`ls raspbian-ua-netinst-*.img` of=/dev/rdiskX |
|
$ diskutil eject /dev/diskX |
|
|
|
# Login: |
|
# Username: root |
|
# Password: raspbian |
|
|
|
$ passwd |
|
|
|
$ apt-get install avahi-daemon |
|
|
|
$ ssh root@pi.local |
|
|
|
# https://www.raspberrypi.org/documentation/linux/usage/users.md |
|
$ adduser pi |
|
$ apt-get install sudo |
|
$ usermod -a -G sudo,video pi # Add user to sudo and video group, so one can use sudo and the Raspberry camera works |
|
|
|
# Optional: give passwordless sudo access: |
|
$ visudo |
|
# pi ALL = NOPASSWD: ALL |
|
|
|
# Optional: use improved memory management performance functions and create swap: |
|
$ sudo apt-get install raspi-copies-and-fills |
|
$ sudo dd if=/dev/zero of=/swap bs=1M count=512 |
|
$ sudo mkswap /swap |
|
$ sudo sh -c 'echo "/swap none swap sw 0 0" >> /etc/fstab' |
|
|
|
$ exit |
|
|
|
# https://www.raspberrypi.org/documentation/remote-access/ssh/passwordless.md |
|
$ ssh pi@pi.local 'mkdir ~/.ssh' |
|
$ cat ~/.ssh/id_rsa.pub | ssh pi@pi.local 'cat >> .ssh/authorized_keys' |
|
|
|
$ ssh pi@pi.local |
|
$ sudo locale-gen en_US en_US.UTF-8 |
|
$ echo -e "export LC_ALL=\"en_US.UTF-8\"\nexport LANG=\"en_US.UTF-8\"" >> ~/.bash_profile |
|
$ . ~/.bash_profile |
|
|
|
$ sudo apt-get install apt-utils |
|
$ sudo apt-get install keyboard-configuration |
|
$ sudo apt-get install raspi-config rpi-update |
|
|
|
# Expand partition, fix locals, timezone, keyboard layout, enable camera, optional overclock |
|
$ sudo raspi-config |
|
# Reboot |
|
|
|
$ sudo apt-get update |
|
$ sudo apt-get upgrade |
|
$ sudo rpi-update |
|
$ sudo reboot |
|
|
|
# Install OpenCV |
|
$ curl https://gist.githubusercontent.com/Lauszus/c8ce73f3177d6455c27c/raw/install_opencv.sh | bash |
|
|
|
# X11 |
|
$ sudo apt-get install xorg |
|
|
|
# Run script on display remotely |
|
$ echo "export DISPLAY=:0" >> ~/.bash_profile |
|
|
|
# https://www.raspberrypi.org/documentation/usage/camera/raspicam/raspistill.md |
|
# Should now be able to show pictures: |
|
$ raspistill -o cam.jpg |
|
|
|
# UV4L |
|
# Install instructions (source: http://www.linux-projects.org/modules/sections/index.php?op=viewarticle&artid=14): |
|
$ curl http://www.linux-projects.org/listing/uv4l_repo/lrkey.asc | sudo apt-key add - |
|
$ sudo sh -c 'echo "deb http://www.linux-projects.org/listing/uv4l_repo/raspbian/ wheezy main" >> /etc/apt/sources.list' |
|
$ sudo apt-get update |
|
$ sudo apt-get install uv4l uv4l-raspicam |
|
# Optional: |
|
$ sudo apt-get install uv4l-raspicam-extras |
|
$ sudo service uv4l_raspicam restart |
|
# Configuration: /etc/uv4l/uv4l-raspicam.conf |
|
# Remove preview: nopreview = yes |
|
|
|
# Example (based on http://www.linux-projects.org/modules/sections/index.php?op=viewarticle&artid=16#example4): |
|
$ wget http://linux-projects.org/downloads/examples/opencv_test.cpp |
|
$ g++ `pkg-config --cflags opencv` -o `basename opencv_test.cpp .cpp` opencv_test.cpp `pkg-config --libs opencv` -L/usr/lib/uv4l/uv4lext/armv6l -luv4lext -Wl,-rpath,'/usr/lib/uv4l/uv4lext/armv6l' |
|
$ uv4l --driver raspicam --auto-video_nr --encoding yuv420 --width 320 --height 240 # Manually load uv4l if you have not installed the optional uv4l-raspicam-extras package |
|
$ ./opencv_test |
|
# Makefile: https://github.com/Lauszus/ImageAnalysisWithMicrocomputer30330/blob/master/ZomBuster/src/Makefile |
|
|
|
# i3 |
|
$ sudo apt-get install i3 |
|
|
|
$ sudo apt-get autoremove |
|
$ sudo apt-get autoclean |
|
|
|
# Disable Camera module LED: |
|
$ sudo sh -c 'echo "disable_camera_led=1" >> /boot/config.txt' |
|
|
|
# WiringPi |
|
$ sudo apt-get -y install build-essential git-core make |
|
$ git clone git://git.drogon.net/wiringPi |
|
$ cd wiringPi |
|
$ ./build |
|
# Test WiringPi |
|
$ gpio -v |
|
$ gpio readall |
|
|
|
# WiFi |
|
# Check that driver is detected |
|
$ dmesg | grep -i wlan |
|
# Scan |
|
$ sudo apt-get install wireless-tools |
|
$ sudo iwlist wlan0 scan |
|
# Replace SSID and PASSWORD with your the network name and password |
|
$ sudo sh -c 'echo "\nallow-hotplug wlan0\nauto wlan0\niface wlan0 inet dhcp\n\twpa-ssid \"SSID\"\n\twpa-psk \"PASSWORD\"\n" >> /etc/network/interfaces' |
|
$ sudo /etc/init.d/networking restart |
|
# Make sure interface is detected |
|
$ sudo ifconfig wlan0 |
|
|
|
# Upload and compile on remote machine |
|
scp main.cpp pi@pi.local:~/ImageAnalysisWithMicrocomputer30330/ZomBuster/src && ssh pi@pi.local "make -j4 -C ~/ImageAnalysisWithMicrocomputer30330/ZomBuster/src" |
|
|
|
# Mount file system |
|
$ sshfs pi@pi.local:~/ImageAnalysisWithMicrocomputer30330/ZomBuster/src ~/sshfs -o noappledouble |
|
$ umount ~/sshfs |
|
|
|
# Reference: |
|
# http://www.pyimagesearch.com/2015/10/26/how-to-install-opencv-3-on-raspbian-jessie |
|
# http://milq.github.io/install-opencv-ubuntu-debian |
|
# https://github.com/milq/scripts-ubuntu-debian/blob/master/install-opencv.sh |
|
# http://raspberrypi.stackexchange.com/questions/27232/installing-opencv-3-0-on-raspberry-pi-b |
|
# https://github.com/jayrambhia/Install-OpenCV |
|
# https://help.ubuntu.com/community/OpenCV |