Skip to content

Instantly share code, notes, and snippets.

@wataruoguchi
Last active August 13, 2016 15:28
Show Gist options
  • Select an option

  • Save wataruoguchi/26691d3dc13e8d6c3d922364cb305de0 to your computer and use it in GitHub Desktop.

Select an option

Save wataruoguchi/26691d3dc13e8d6c3d922364cb305de0 to your computer and use it in GitHub Desktop.
Get started with Raspberry Pi - time to be (more) geeky!

Preparation

  • Raspberry Pi 3 - Model B
  • USB keyboard
  • USB mouse
  • HDMI cable
  • Micro SD card
  • Mini USB power adopter

Format SD card

The one I have is SONY microSDXC 64GB

  1. Open Disk Utility
  2. Select the SD card
  3. Erase the SD card with:
  4. Format: MS-DOS(FAT)
  5. Sceme: Master Boot Record

Connect to Wi-Fi

It has built-in Wi-Fi!

Select an OS and install

  1. Choose Raspbian
  2. Click 'Install'
  3. It starts extracting files. Wait for a while (took 15 mins for me)

Re-map keys

As I am using a Mac keyboard. You may be able to skip this.

  1. $ sudo dpkg-reconfigure locales
  2. Change it to en_US.UTF-8
  3. $ sudo dpkg-reconfigure keyboard-configuration
  4. Change it to USA PC104
  5. Reboot

Update the package list

$ sudo apt-get update && apt-get upgrade -y

Install Chromium browser

Followed: http://raspberrypi.stackexchange.com/a/44690

  1. $ sudo vi /etc/apt/sources.list
  2. Add the two lines
  • deb http://ppa.launchpad.net/canonical-chromium-builds/stage/ubuntu vivid main
  • #deb-src http://ppa.launchpad.net/canonical-chromium-builds/stage/ubuntu vivid main
  1. $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB69B232436DAC4B50BDC59E4E1B983C5B393194
  2. $ sudo apt update
  3. $ sudo apt install chromium-browser

Configure timezone

$ sudo dpkg-reconfigure tzdata

SSHing

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

Kickoff! Start following the tutorial of mirrormirror

http://blog.dylanjpierce.com/raspberrypi/magicmirror/tutorial/2015/12/27/build-a-magic-mirror.html

Run Chromium on startup

  1. $ sudo vi /etc/xdg/lxsession/LXDE-pi/autostart
  2. Comment out @xscreensaver -no-splash with #
  3. Add this line @xset s off @xset -dpms @xset s noblank /usr/bin/chromium --noerrdialogs --kiosk --incognito "http://localhost"

Hmm, actually it doesn't work for me. Instead, I did...

  1. $ sudo vi ~/autostart
  2. Add this line chromium --noerrdialogs --kiosk http://www.page-to.display --incognito
  3. Save the file
  4. $ sudo vi ~/.bashrc
  5. Add this line ./autostart
  6. Save the file

Installing a web server

  1. $ sudo apt-get update && sudo apt-get install nginx php5-fpm php5-cli php5-mcrypt git
  2. $ sudo vi /etc/nginx/sites-available/mirror.conf
  3. Paste https://gist.github.com/ctrlaltdylan/18d78a608a3d81c964e7
  4. $ sudo vi /etc/nginx/sites-available/default
  5. Comment out listen [::]:80 default_server; (IPv6 line)
  6. sudo ln -s /etc/nginx/sites-available/mirror.conf /etc/nginx/sites-enabled/mirror.conf && sudo service nginx reload

Installing MirrorMirror

  1. $ sudo mkdir /home/pi/projects cd /home/pi/projects
  2. $ sudo git clone https://github.com/ctrlaltdylan/MirrorMirror.git
  3. $ curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
  4. $ cd MirrorMirror composer install
  5. $ sudo chmod -R 777 storage (warning. can be something else but 777)
  6. Open browser then http://localhost!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment