Skip to content

Commit

Permalink
Merge pull request #2 from micro-nova/document_deployment_and_testing
Browse files Browse the repository at this point in the history
Add development documentation
  • Loading branch information
linknum23 authored Sep 4, 2020
2 parents 4732e47 + 08d6f35 commit 1e2de44
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,21 @@ Implementation of the EthAudio Controller on the Raspberry Pi
## configuration
Download Raspberry Pi OS from [here](https://www.raspberrypi.org/downloads/raspberry-pi-os/) we are currently using the "Raspberry Pi OS (32-bit) with desktop and recommended software"
Follow steps on [rpi](https://www.raspberrypi.org/documentation/hardware/computemodule/cm-emmc-flashing.md) to flash the eMMC on the device

## Development setup
1. Use vscode with its python plugin, this should highlight errors
2. In a bash terminal you should setup an ssh key for interacting with the pi checkout this [guide](https://www.raspberrypi.org/documentation/remote-access/ssh/passwordless.md)

### Deploying code for testing
1. Find the rpi's ip address and set the variable expected by the copy_python_to_board.sh script
2. Copy the python files over
From the base of the git repo in bash
```./util/copy_python_to_board.sh```
3. ssh into the pi and run the files
```
ssh $RPI_IP_ADDRESS
export DISPLAY=:0 # use the connected display, this is set weird over ssh by default
```

## TODO add howto configure USB audio for shairport
## TODO follow strategy for handling 7.1 channel audio -> 4 stereo outputs
## TODO follow strategy for handling 7.1 channel audio -> 4 stereo output
26 changes: 26 additions & 0 deletions util/copy_python_to_board.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# get directory that the script exists in
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# check if RPI_IP_ADDRESS is set
if [[ -z "${RPI_IP_ADDRESS}" ]]; then
echo ""
echo "Please set RPI_IP_ADDRESS, for example:"
echo -e '\033[1;32mexport RPI_IP_ADDRESS=192.168.0.140\033[0m'
echo "for ssh key access"
echo -e '\033[1;32mexport RPI_IP_ADDRESS=pi@192.168.0.140\033[0m'
echo ""
exit 1
fi

# Python folder on EthAudio controller
RPI_PYTHON_FOLDER=/home/pi/python

# create directories if they don't exists
ssh $RPI_IP_ADDRESS "mkdir -p ${RPI_PYTHON_FOLDER}/ethaudio"
ssh $RPI_IP_ADDRESS "mkdir -p ${RPI_PYTHON_FOLDER}/tests"

# copy stuff to board
scp $SCRIPT_DIR/../python/ethaudio/*.py $RPI_IP_ADDRESS:${RPI_PYTHON_FOLDER}/ethaudio
scp $SCRIPT_DIR/../python/tests/*.py $RPI_IP_ADDRESS:${RPI_PYTHON_FOLDER}/tests

0 comments on commit 1e2de44

Please sign in to comment.