9. Workflow Test Drive
23 Jan 2018workflow
parallel development environments
In this class we will work across two environments to complete prototypes:
- a laptop: your primary work space, you should always start exploring/testing your idea by writing code on your laptop to confirm general functionality
- a Raspberry Pi: move your generally-functional code to your Raspberry Pi for platform-specific tests and, eventually, deployment.
In other words, I recommend doing most of your programming on your laptop and moving to the pi only after you have confirmed basic functionality.
SCP
To Test Drive this workflow process let's assume we have already tested a file on our laptop and now want to send it to our Raspberry Pi. We will then rename the file and send it back to our Laptop. Prior to beginning, remember that the general format for scp
is as follows:
scp [FILENAME] [USERNAME]@[HOSTNAME]:/home/[USERNAME]
- On your laptop create an empty text file:
touch test.txt
- Now send it over to your user's home directory:
scp test.txt pi@creativetech.local:/home/pi
- Enter the password for the user. After a moment the file transfer should finish.
- On your Raspberry Pi verify that the file is where it should be with
ls
- On your Raspberry Pi rename that file to something different:
mv test.txt sendback.txt
- On your laptop run the following command to get your
IP Address
:ipconfig getifaddr en0
- On your laptop select and copy the address to your clipboard
- Back on your Raspberry Pi format your
scp
line to send the renamed file back to your laptop:scp sendback.txt [USERNAME]@[IP ADDRESS]:/Users/[USERNAME]
- Enter the password for your user. After a moment the file transfer should finish.
- Confirm that sendback.txt made it back to the right place on your laptop.