General linux and other guide/troubleshooting basic¶
Some conventions used in these docs:
- Wherever you see text that is formatted
like this, it is a code snippet. You should copy and paste those code snippets instead of attempting to type these out; this will save you debugging time for finding your typos.
- Double check that your copy-paste has copied correctly. Sometimes a paste may drop a character or two and that will cause an error in the command that you are trying to execute. Sometimes, depending on what step you are doing, you may not see the issue. So, do make a point of double checking the paste before pressing return.
- You will see a $ at the beginning of many of the lines of code. This indicates that it is to be entered and executed at the terminal prompt. Do not type in the dollar sign $.
- Wherever there are
<bracketed_components>in the the code, these are meant for you to insert your own information. Most of the time, it doesn’t matter what you choose as long as you stay consistent throughout this guide. That means if you choose
<edisonhostname>, you must use
myedisonevery time you see
<edisonhostname>. Do not include the
< >brackets in your commands when you enter them. So for the example above, if the code snipped says
ssh root@<edisonhostname>.local, you would enter
Before you get started¶
Some familiarity with using the Terminal app (Mac computers) or Putty (Windows computers) will go a long way, but is not required for getting started. Terminal (or PuTTY) is basically a portal into your rig, allowing us to use our computer’s display and keyboard to communicate with the little [Edison or Pi] computer in your rig. The active terminal line will show your current location, within the computer’s file structure, where commands will be executed. The line will end with a $ and then have a prompt for you to enter your command.
There are many commands that are useful, but some of the commands you’ll get comfortable with are:
cdmeans “change directory” - you can
cd <directorynamewithnobrackets>to change into a directory; and
cd ..will take you backward one directory and
cdwill take you back to the root directory. If you try to
cdinto a file, your computer will tell you that’s not going to happen.
lsmeans “list”, is also your friend - it will tell you what is inside a directory. If you don’t see what you expect, you likely want to
cd ..to back up a level until you can orient yourself. If you aren’t comfortable with what
lsdo or how to use them, take a look at some of the Linux Shell / Terminal commands on the Troubleshooting page and the reference links on the Technical Resources page.
catmeans “concatenation” - it will show you the contents of a file if you
cat <filename>. Very useful when trying to see what you have in preferences or other oref0 files.
nanoare both editing command prefixes. Using those will bring you into files for the purposes of editing their contents. It is like
catexcept you will be able to edit.
vieditor, you will need to enter the letter
ito begin INSERT mode (and a little INSERT word will be shown at the bottom of the screen once you do that). While in INSERT mode, you will be able to make edits. To exit INSERT mode, you will press
esc. To save your changes and quit, you need to exit INSERT mode and then type
nanoeditor, you are automatically in editing mode. You can make your edits and then to exit and save, you’ll use
y(to save the edits), and then
returnto save the edits to the same filename you started with.
- Up and Down arrow keys can scroll you back/forward through the previous commands you’ve entered in the terminal session. Very useful if you don’t want to memorize some of the longer commands.
Control-rwill let you search for previous commands.
One other helpful thing to do before starting any software work is to log your terminal session. This will allow you to go back and see what you did at a later date. This will also be immensely helpful if you request help from other OpenAPS contributors as you will be able to provide an entire history of the commands you used. To enable this, just run
script <filename> at the beginning of your session. It will inform you that
Script started, file is <filename>. When you are done, simply
exit and it will announce
Script done, file is <filename>. At that point, you can review the file as necessary.
ls <myopenaps> will show the following files and subdirectories contained within the directory:
ls settings will show the contents of the
settings subdirectory; the files which collect longer-term loop data.
ls monitor will show the contents of the
monitor subdirectory; current data going on right now in your loop.
ls enact will show the contents of the
enact subdirectory; loop’s suggested and enacted temp basals and changes.