Changes

3,572 bytes added ,  00:39, 27 October 2020
Sort of works?
= Dataplicity Tutorial 1: Getting Access, Online Interface, and Unix Tools =

We use Dataplicity to remotely manage Raspberry Pi’s and access to flight hardware such as PyCubed. First, ask Langston, Moritz, or Flynn for access to Dataplicity.

https://www.dataplicity.com

Head over to the <code>devices</code> page:

[[File:https://media.githubusercontent.com/media/stanford-ssi/sequoia-software/assets/dataplicity/devices.png=true|thumb|none|alt=Devices|Devices]]

Select the <code>Sequoia</code> Raspberry Pi:

[[File:https://media.githubusercontent.com/media/stanford-ssi/sequoia-software/assets/dataplicity/pycubed_mnt.png?raw=true|thumb|none|alt=PyCubed|PyCubed]]

The PyCubed drive is mounted at <code>/media/PYCUBED</code>. In the web view here, there are a number of software tools available to you, such as the ability to reboot, in the right column. All of the unix tools installed on the Raspberry Pi are somewhat accessble to you–for example, you can use the <code>nano</code> text editor to edit files but you can’t use the <code>scp</code> command to copy files from your computer to the Raspberry Pi in this interface.

== Editing files on the PyCubed drive ==

Let’s edit a file on the PyCubed drive with <code>nano</code>!

<source lang="bash">nano main.py</source>
[[File:https://media.githubusercontent.com/media/stanford-ssi/sequoia-software/assets/dataplicity/nano_main.png?raw=true|thumb|none|alt=Nano main|Nano main]]

<code>Enter</code> to edit the file. Once you make your edits, type <code>ctrl-o</code> to “write” the file. Then, do <code>ctrl-x</code> to exit.

[[File:https://media.githubusercontent.com/media/stanford-ssi/sequoia-software/assets/dataplicity/nano_main_save.png?raw=true|thumb|none|alt=Nano main save|Nano main save]]

== Copying files to the PyCubed drive ==

Make a file and put some stuff in it.

[[File:https://media.githubusercontent.com/media/stanford-ssi/sequoia-software/assets/dataplicity/tmp_test.png?raw=true|thumb|none|alt=Temp test|Temp test]]

This time, let’s save the file with <code>ctrl-s</code> (same as <code>ctrl-o</code> but it does not prompt for a file name). Then <code>ctrl-x</code> to exit.

[[File:https://media.githubusercontent.com/media/stanford-ssi/sequoia-software/assets/dataplicity/nano_save.png?raw=true|thumb|none|alt=Nano save|Nano save]]

Make sure you saved the file with the <code>cat</code> command (<code>cat</code> is technically for concatenating (combining) files, but works fine for printing them in the terminal!)

[[File:https://media.githubusercontent.com/media/stanford-ssi/sequoia-software/assets/dataplicity/cat.png?raw=true|thumb|none|alt=Cat image|Cat image]]

Now, we will move the file to the PyCubed with the <code>cp</code> (“copy”) command. Syntax for this is

<source lang="bash">cp SOURCE DESTINATION</source>
For you, this would be:

<source lang="bash">cp tmp/test /media/PYCUBED/</source>
[[File:https://media.githubusercontent.com/media/stanford-ssi/sequoia-software/assets/dataplicity/copied.png?raw=true|thumb|none|alt=Copied|Copied]]

Print the file in your terminal with:

<source lang="bash">cat /media/PYCUBED/test</source>
And then delete the file with:

<source lang="bash">rm /media/PYCUBED/test</source>
Despite all of these cool things, ''we don’t recommend using the web interface'' because it crashes fairly often.


-----

== Next Steps ==

Checkout the [[tutorial_2.md|next tutorial]] to learn how to access Dataplicity enabled Raspbery Pi’s with Porthole in your desired terminal—-on your computer, ''not'' in a browser!