Interactive Media Arts Capstone Technical Documentation

This documentation covers some technical issues I encountered as I work on the IMA capstone interactive project.

Enabling SSH for headless Raspberry Pi


SSH is disabled by default in the latest Raspbian Jessie, however, we can enable it by putting a file called ssh in the /boot/ directory in the sd card.

Connecting Raspberry Pi to nyu WiFi


  1. Get the MD4 hash of the password by running the command below:
    $ echo -n 'YOUR_REAL_PASSWORD' | iconv -t utf16le | openssl md4
  2. Open wpa_supplicant.conf with your favorite text editor:
    $ sudo vi /etc/wpa_supplicant/wpa_supplicant.conf
  3. Append the following text to the file:
  4. Remember to run the following command to clean up history for security reason:
    $ history -w
    $ history -d

Passwordless SSH Access


  1. Check if there are ssh keys on your computer
    $ ls ~/.ssh
  2. If there’s none, generate new keys on your computer
    $ ssh-keygen -t rsa -C "Raspberry Pi #123"
  3. If there’s no ~/.ssh folder on the Pi, create one with following command
    $ cd ~
    $ install -d -m 700 ~/.ssh
  4. Copy your public key from your computer to your Pi by running following command on your computer
    $ cat ~/.ssh/ | ssh @ 'cat >> .ssh/authorized_keys'

Disable Password Login for SSH


  1. Open the file below on Raspberry Pi
    $ sudo vi /etc/ssh/sshd_config
  2. Set #PasswordAuthentication to no
    #PasswordAuthentication yes # old
    PasswordAuthentication no   # new

Configuring for GrovePi+

Source: – Pi/get-started-with-the-Grove – pi/setting-software/

  1. Clone the repo
    $ git clone - Pi.git
  2. Run the script
    $ cd /home/pi/Desktop/Grove - Pi/Script
    $ sudo chmod +x
    $ sudo ./

Serial Communication between Raspberry Pi and Arduino

Sources: (This didn’t seem to work with GrovePi+ RPISER)

Setting up PHP Serial


  1. Get PhpSerial.php from GitHub
    $ wget
  2. Untar the file
    $ tar -zxvf 1.0.1.tar.gz
  3. Copy PhpSerial.php to the folder where index.php lives
    $ sudo cp PHP-Serial-1.0.1/src/PhpSerial.php /var/www/html/
  4. Install minicom to prevent Arduino from resetting itself every time we open a connection to it through serial
    $ sudo apt-get install minicom
  5. Run below command and then
    1. go to serial port setup, and then set the serial device to /dev/ttyUSB0 (or whatever yours is)
    2. set the Bps/Par/Bits to C, 9600 (this may differ for different Arduinos.)
    3. Then ‘save setup as dfl’ and exit.
    $ sudo minicom -s -c on
  6. Run minicom before running any PhpSerial command

Setting up Automatic Email Notification on Boot on nyu Network


  1. Create a file auto_mail and paste the text below and save it
    IP="$(ifconfig | grep -A 1 'wlan0' | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 1)"
    telnet 25 <<EOF
    MAIL FROM: <>
    RCPT TO: <>
    From: "Raspberry Pi" <>
    To: "Your Name" <>
    Subject: Notification
  2. Open the rc.local with command below
    $ sudo vi /etc/rc.local
  3. Add the path to the previous file you created to rc.local before exit 0
    sh /home/pi/auto_mail
  4. Reboot to test
    $ sudo reboot

Installing VIM GUI


$ sudo apt-get install vim-gui-common

Recording and Saving Video with OpenCV and python

Below is the version of cv2 I’m using:

cv2.__version__ = ‘2.4.11’

After Googling for so long, I figured something like this would work on macOS:

import cv2
fourcc ='m','p','4','v')
out = cv2.VideoWriter()'output.mp4', fourcc, 20, (width,height))
while (camera.isOpened()):
_, frame =


RST LED on GrovePi+ is on

GrovePi+ will not work properly when the RST led is on, to resolve the problem, navigate to the Troubleshooting folder in GrovePi, and run

$ ~/GrovePi/Troubleshooting/

grovepi.digitalRead() not working on GrovePi+

Somehow this function doesn’t work with firmware 1.2.7, downgrade to firmware 1.2.6 will solve the problem

$ cd ~/GrovePi/Firmware/Source/v1.2/grove_pi_v1_2_6/

$ bash

grovepi.ultrasonicRead() not working when GrovePi+ firmware is 1.2.6

Open and comment out the 3rd line in ultrasonicRead()

# Read value from Grove Ultrasonic

def ultrasonicRead(pin):

  write_i2c_block(address, uRead_cmd + [pin, unused, unused])

  time.sleep(.06) #firmware has a time of 50ms so wait for more than that


  number = read_i2c_block(address)

  return (number[1] * 256 + number[2])


Useful Links



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s