2018-08-04

Secure Copy

The Pocketbeagle does not have an internet connection out of the box. Causing us to download files to the PC it is connected to and use scp(Secure Copy) to move files to the Pocketbeagle. We will use this to copy the Adafruit-BeagleBone IO Python Library to the Pocketbeagle.

Download the Adafruit-BeagleBone IO Python Library from GitHub. Extract it to a directory in your home partition. On my machine I put it here:

[mac@xyz~]$ /home/mac/BeagleBone

scp is similar to ssh, if you can ssh to a machine you can use scp to transfer files to and from that machine. Now, ssh into the Pocketbeagle using

ssh 192.168.7.2 -l debian

from a terminal. Once logged in type 'pwd', this will show where you are in the directory structure. You should be at on the below on the PocketBeagle.

~]$ /home/debian

Now run the command 'mkdir downloads' to make a directory named downloads. You can now type the command 'ls' to see the directory listed.

To use scp you will either need to open another terminal or log off from the Pocketbeagle, and then run the command below, (edit the command to match your system). Use the same password used for ssh.

scp -r /home/mac/BeagleBone/adafruit-beaglebone-io-python-master debian@192.168.7.2:/home/debian/downloads

Now ssh back into the Pocketbeagle and 'cd downloads' then 'ls' You will see the new directory that was copied

adafruit-beaglebone-io-python-master

Next

cd adafruit-beaglebone-io-python-master

to enter the directory and you can run 'ls' to see the files. Run

sudo python setup.py install

Test the install by typing 'cd' to get back to home then type 'python' at the command prompt. Then type

import Adafruit_BBIO.GPIO as GPIO

If all went well you should see something similar to the below.

debian@beaglebone:~$ python
Python 2.7.13 (default, Jan 19 2017, 14:48:08) 
[GCC 6.3.0 20170118] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_BBIO.GPIO as GPIO
>>> 

Hold the CTRL key while pressing 'd' to return to your home prompt.