##Hardware
- RaspberryPi Zero
- 16GB or larger Class 10 SanDisk microSD card
- HD Audio output: Pimoroni's pHAT DAC
- RTl8192/8188CUS (for AP/Ad-hoc capability) 802.11n WiFi Adapter
- Micro USB OTG Adapter
##SD / OS / Software Setup
- Download latest raspbian here: https://www.raspberrypi.org/downloads/raspbian
- Follow SD card format & flash steps here: https://gist.github.com/jmsaavedra/d8375a91f24b8ed15282
- Bootup rPi from SD card, with all peripherals including WiFi connected to board
- Update system configuration (expand filesystem, boot settings)
$ sudo raspi-config
- Update the core OS packages (this takes several minutes)
$ sudo apt-get update
$ sudo apt-get upgrade
$ curl -sS get.pimoroni.com/phatdac | bash
- Reboot pi
$ sudo reboot
- Install Node via NVM
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh | bash
$ nvm install v5.8.0
$ nvm alias default v5.8.0
- Install
mpg123
audio playback utility
$ sudo apt-get install mpg123
Configuring Wireless Access Point (AP) mode allows for the following UX when setting up their device for the first time: User plugs in device. Device is not connected to the internet (ships with no WiFi credentials), and therefore boots up in "configuration mode". In configuration mode, the device itself broadcasts it's own WiFi network "MomBox", and the user joins this network on a laptop or phone. User opens browser, and is served a single webpage that contains a form with fields for "WiFi Network Name (SSID)" and "WiFi Password". Upon hitting the Submit button on this form, the device reboots and attempts to join named network. If the device ever fails to connect to the WiFi going forward (ie, network is down) it should boot up in Configuration Mode again. A single, inconspicuous button is on the bottom of the device to reboot in Configuration Mode at any time (ie, user wants to change WiFi networks).
Resources and tutorials for AP Mode on RPi w/Ubuntu:
- https://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point/compiling-hostapd
- http://slicepi.com/creating-an-ad-hoc-network-for-your-raspberry-pi
- http://printrbot.com/wp-content/uploads/2014/04/RPi-Ad-Hoc-Instructions.pdf
- http://stackoverflow.com/questions/34157743/raspberry-pi-and-edimax-7811un-incompatibility-in-ad-hoc-mode
- http://raspberrypi.stackexchange.com/questions/49660/ad-hoc-setup-in-rpi-3/50044
Ad-hoc mode is similar to AP mode, however the WiFi broadcasted is as a single device. This is useful for device to device connection; not as useful for serving a webpage/interface and far less device compatible. Not what we will use, but interesting to note.
$ cd /etc/network
$ sudo mv interfaces interfaces_wifi
$ sudo touch interfaces
$ sudo nano interfaces
Add the following to the interfaces file, then save & exit nano:
auto wlan0
iface wlan0 inet static
address 10.2.1.1
netmask 255.255.255.0
wireless-mode ad-hoc
wireless-essid myRpiNet
wireless-channel 1
Try restarting networking services:
$ sudo service networking restart
$ sudo systemctl daemon-reload
# if all else fails, reboot pi:
$ sudo reboot