These are instructions to setup both your Chromebook and your EV3 so you can use Linux. We will also install Python and related software. Some common tasks like copying files and running programs are also covered. Things you need to type are indicated by a change in font. When you type a command you will need to follow it by pressing the enter key.
Chromebook Developer Mode
The first step is to enter Developer Mode. This will ERASE THE CONTENTS of your Chromebook! BACKUP everything you want to keep! More details at http://www.howtogeek.com/162120/how-to-install-ubuntu-linux-on-your-chromebook-with-crouton/.
  • Enter Developer Mode (hold down escape and refresh, tap power button).
  • Press ctrl-D at recovery screen.
  • Press enter to accept that OS verification is OFF.
  • Press ctrl-D at warning screen (or wait 30 sec.)
  • Setting up Developer Mode will take a few minutes. Go get some coffee. Grade some homework. Play with the cat... It will beep at you when it is done.

Setup Chrome
  • Pick a language (probably English).
  • Select US keyboard.
  • Select the network:
    • o SSID:
    • o Password:
    • Click Continue.
    • Accept Google Terms and Conditions.
    • Enter g-mail address.
    • Enter password.

Install Crouton
  • Open Chrome browser and go to http://goo.gl/fd3zc. This will download the Crouton installer script. Click "Save."
  • Press ctrl-alt-T to open Crosh developer shell.
  • Type the this command followed by the enter key: shell
  • Type: sudo sh ~/Downloads/crouton –e –t xfce
  • You will be asked to create two passwords (they can be the same). You will need to type both of them twice. Be sure to remember them. These instructions will call them password 1 and password 2. You will not see the passwords as you type them.
  • It will ask you to move the mouse (track pad) for a few seconds (to generate random numbers for security).
  • Again this will take a few minutes. Get more coffee. Grade more homework. Annoy cat…
  • You will be asked to supply a user name and yet another password (again you can use the same password if you like). We will call this password 3.
  • You are now ready to start Crouton by typing: sudo startxfce4
  • You will be asked for two passwords. These are passwords 1 and 2.
  • Select "default config".
  • Sit back and admire the Linux desktop.

Switching from Linux to Chrome
  • To switch back to Chrome use ctrl-alt-shift-back
  • To switch back to Linux use ctrl-alt-shift-forward

Restarting Chromebook
If for some reason you need to restart the Chromebook you need to make sure you keep it in Developer Mode. If you leave Developer Mode you will ERASE EVERYTHING on the Chromebook!
  • Power on the Chromebook.
  • DO NOT PRESS SPACEBAR!
  • At the warning screen you either need to press ctrl-D or wait 30 sec.
  • Log into Chrome
  • If it is not already open, use ctrl-alt-T to get Crosh terminal.
  • Type: shell
  • Type: sudo startxfce4
  • Enter passwords 1 and 2.

Installing Linux software
You can open a terminal window from the menu bar at the bottom of the Linux window. To install Linux packages you type:

sudo apt-get install <package name>

where <package name> is the name of the desired software package. You may be asked for a password. Answer "Y" when asked to confirm the installation. Packages to install:
  • python3
  • idle3
  • ssh
  • sshfs

Installing ev3dev on Mindstorms EV3
Details of this procedure are at http://www.ev3dev.org/docs/getting-started/.
  • Use the Chrome browser to download the recommended version of ev3dev from https://github.com/ev3dev/ev3dev/releases. You want the version ending in .xz. Currently this version is ev3-ev3dev-jessie-2015-12-30.img.xz. Make a note of this file name.
  • You will need a microSD card (between 2 and 32 GB, NOT microSDXC) with a standard SD card adapter.
  • Put the microSD card in the adapter, making sure the write-protect switch is OFF.
  • Go to Linux on the Chromebook, and open a terminal window.
  • Run the command: df –h
  • Now insert the SD card into the Chromebook and rerun the command:
    df –h
  • The output should be slightly different because there should be an additional drive listed. The name of this drive should be something like /dev/mmcblk1p1. This is the name of the SD card. Make a note of this disk name.
  • Now, changing the name to match the disk name in the previous step, type: sudo umount /dev/mmcblk1p1
  • Again, changing the name to match the file downloaded in the first step and the disk name from the previous two steps (it is important to note that "p1" must be omitted from the drive name), type (all on one line):
    xzcat ~/Downloads/ev3-ev3dev-jessie-2015-12-30.img.xz | sudo dd bs=4M of=/dev/mmcblk1
  • When it is done type: sync
  • You can now remove the SD card from the Chromebook and its adapter.
  • Put the SD card into the SD slot in the EV3 brick and turn it on by pressing and holding the middle button. The EV3 should boot into "Brickman".

Connecting EV3 to Chromebook
There are three different methods to connect the EV3 to your Chromebook. You can use a USB cable and you can use Wi-Fi.
USB
  • To connect using USB you need to use the USB cable that came with the Mindstorms set to connect the EV3 brick and the Chromebook.
  • On the Brickman menu on the EV3, select "Wireless and Networks".
  • From this submenu select "Tethering".
  • Finally, turn on "Gadget".
  • A few seconds after doing this the number 192.168.0.1 should appear in the upper left of the EV3 screen.
  • If this number does not appear you may need to reboot the EV3 brick and try again. To do this, hit the back button (upper left button) repeatedly until you see the "Shutdown…" menu. Select "Reboot".
  • Go to the Linux side of the Chromebook and open a terminal window.
  • Type: ssh robot@192.168.0.1
  • You should be asked for a password. Use the password maker to gain access to the EV3.
WI-FI
  • To connect using Wi-Fi you will need to install a wireless network adaptor into the USB port on the EV3 brick.
  • On the Brickman menu on the EV3, select "Wireless and Networks".
  • From this submenu select "Wi-Fi".
  • Turn on "Powered".
  • When you do this the light on the Wi-Fi adaptor should come on.
  • After a few moments at the bottom of the menu you should see a list of available Wi-Fi networks. Select your desired network. If you don't see a list, select "Start Scan".
  • Once you select a network you will be taken to a submenu where you can select "Connect".
  • If it is required on your network you may be asked to enter a passphrase. To do this, use the buttons to highlight the rectangle where you need to enter the passphrase. Press the center button. This will take you to a menu where you can enter the passphrase. Select "OK" when you are done.
  • Now select "Accept".
  • A few seconds after doing this a number consisting of four integers separated by periods (for example the number could be 10.0.1.186) should appear in the upper left of the EV3 screen. This number is likely to be different each time you connect so you will need to look at the brick to determine its current number
  • Go to the Linux side of the Chromebook and open a terminal window.
  • Type the following, but replace the number with those displayed on the brick: ssh robot@10.0.1.186
  • If you want to login so that you can display graphic plots using matplotlib add the –X option: ssh –X robot@10.0.1.186
  • You should be asked for a password. Use the password maker to gain access to the EV3.
  • This should work at Roane State. If this doesn't work at your home or school, you may need to change some firewall settings on your Wi-Fi router. This will vary from router to router, but some magic words are "NAT", "Port Settings", "Remote Login", "SSH" and "Port 22".

Installing Python 3
Once your brick is installed on the network using Wi-Fi it can go out on the internet like any other computer. We can use this to update software. In particular, the latest version of Python is Python 3. Unfortunately our ev3dev software only has drivers for Python 2. To install Python 3 do the following:
  • Log into the EV3 using ssh using the Wi-Fi method described above.
  • Type: sudo apt-get update
  • Type: sudo apt-get install python3-pil
  • Type: sudo python3 –m easy_install python-ev3dev
  • Type: sudo apt-get install xauth
  • Logout out of the EV3 by typing: logout
  • Changing the number to match your EV3, log back in by typing:
    ssh –X robot@10.0.1.186
  • Type: sudo apt-get install python3-matplotlib

Copying Files
To copy a file to the EV3 from the Chromebook you need to do the following:
  • scp <old filename> robot@192.168.0.1:<new filename>
  • Here <old filename> represents the filename on the Chromebook. It could include the directory the file is in. Similarly <new filename> is the file name on the EV3. You may need to change the numbers, depending on how you are connecting the EV3 to your Chromebook.
  • You will need the EV3 password (maker)
To copy a file from the EV3 to the Chromebook do the following:
  • scp robot@192.168.0.1:<old filename> <new filename>
  • Here <old filename> represents the filename on the EV3. It could include the directory the file is in. Similarly <new filename> is the file name on the Chromebook. You may need to change the numbers, depending on how you are connecting the EV3 to your Chromebook.
  • You will need the EV3 password (maker)
Another option is to make it so the EV3 and the Chromebook share a directory. To do this, do the following in a terminal window on the Chromebook:
  • Type: mkdir ~/ev3
  • Type sshfs robot@192.168.0.1:/home/robot ~/ev3
  • Note, you may need to change the numbers listed in this example to match your EV3.
  • Now you can directly access the files on the EV3.
  • If you disconnect the EV3 you will need to reissue the sshfs robot@192.168.0.1:/home/robot ~/ev3 command to reattach the directory.

Writing and Running Programs
The easiest was to write and run programs is to share a directory between the EV3 and the Chromebook. Sharing a directory is described in the previous section.
  • Move to the shared directory on the Chromebook by typing: cd ~/ev3
  • Next open the editor by typing: idle3
  • Create a program file by going to the "File" menu and selection "New Window" (if you want to edit an existing file you would select "Open..,").
  • You can then type your program into the file. You must select "Save" before you try to run your program.
  • Open a second terminal window on the Chromebook and connect to the EV3 by typing the following. You will need to change the number to match your EV3: ssh robot@192.168.0.1
  • If you want to use matplotlib you will want to use:
    ssh –X robot@192.168.0.1
  • You will need the password: maker
  • Notice that the prompt is now "robot@ev3dev:" this means that commands you type in this window go to the EV3.
  • You can run your program by typing: python3 myprogram.py
  • Here "myprogram.py" should be replaced with the name on the program you want to run.

Running Python Programs Using Brickman
A Python file is a simple text file and cannot be run directly without a couple modifications. If you want to be able run a program directly through Brickman (no computer needed) then you need to turn it into an executable file.
  • First you need to add the following line to the beginning of the Python file. You can do this using IDLE or any other editor:
    #!/usr/bin/env python
  • Where <filename> is the complete name of the program file, including the .py, type: chmod +x <filename>
  • You should now be able to download the file to the EV3.
  • To run the file using Brickman select "File Browser" and navigate to the desired file.
  • Your program should run on the EV3.



Chromebook Setup.docx