Skip to content

Instantly share code, notes, and snippets.

@pwalsh
Last active November 20, 2022 14:45
Show Gist options
  • Save pwalsh/acf50d3359f6ec5129b6 to your computer and use it in GitHub Desktop.
Save pwalsh/acf50d3359f6ec5129b6 to your computer and use it in GitHub Desktop.
Raspberry Pi Headless Setup
; Supervisor configuration to manage a jack server
[program:jackd]
command=/usr/bin/jackd -r -t2000 -ddummy -r44100 -p1024
user=pi
redirect_stderr=true
autostart=true
autorestart=true

The steps I've taken to setup my Raspberry Pi. My entrie setup flow is headless (connecting to the Pi over ssh on a local network), and on Mac OS X (which possibly matters for some stages). YMMV.

Raspian Image

  • Download the latest "lite" Raspbian image from here.
  • Connect your flash card to the computer you are working on
  • Run the following commands from the terminal (last command takes around 5-10 minutes to complete for me... be patient)
# get the disk name from this command, e.g.: disk3
diskutil list

# then unmount the disk
diskutil unmountDisk /dev/{DISK#}

# then write the image to the disk
sudo dd bs=1m if=/path/to/raspbian.img of=/dev/{DISK#}

Connect

Now, plug the flash drive into the Pi, and connect the Pi to the local network with a network cable.

We need to find where the Pi is on our local network.

$ arp -na | grep -i b8:27:eb

Mine is currently at 10.0.0.3.

ssh pi@<IPADDRESS>
# then answer yes to the security question
# then login with the `raspberry` password

Config and Upgrade

sudo raspi-config
# do expand filesystem
# go to advanced options and then add a hostname
# finish and reboot, then log in again
sudo apt-get update && sudo apt-get upgrade
# there will be prompts, answer `y` to them

Install software

sudo apt-get install build-essential git emacs python-dev python-pip supervisor
sudo pip install jupyter jupyter-console ipdb

Install pyo

sudo apt-get install libjack-jackd2-dev libportmidi-dev portaudio19-dev liblo-dev libsndfile-dev python-dev python-tk python-imaging-tk python-wxgtk3.0 jackd2
git clone https://github.com/belangeo/pyo.git
cd pyo
sudo python setup.py install --install-layout=deb --use-jack --use-double

Using prebuilt Jack does not work, as it is compiled with dbus support, which in turn requires X, and I'm running headless (Raspian Lite) without X and similar libs installed. So, instead, I compiled Jack:

git clone https://github.com/jackaudio/jack2.git
cd jack2
./waf configure
./waf
./waf install
@melvyniandrag
Copy link

Also interested in this. Following steps now, will update soon with results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment