Skip to content

Commit

Permalink
Adds Linux preliminaries (#86)
Browse files Browse the repository at this point in the history
* Adds content for linux prelim and warning about power

* Adds warning about shuting down duckiebot too early. Also formatting
  • Loading branch information
Russell Buchanan authored and AndreaCensi committed Oct 17, 2018
1 parent 3778e18 commit 592b000
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 21 deletions.
42 changes: 41 additions & 1 deletion book/opmanual_duckiebot/atoms_05_part_preliminaries/10_linux.md
@@ -1,4 +1,44 @@
# Linux basics {#preliminaries-linus status=draft}

Assigned: OPEN
Assigned: Russell Buchanan

Linux is a group of free and open-source software operating systems built around the Linux kernel first released in 1991. Typically, Linux is packaged in a form known as a Linux distribution such as Fedora or Ubuntu (the latter one is what we use in this course).


## Ubuntu

As of this writing the most recent version of Ubuntu is 18.04 LTS (Long Term Service) which will be supported until April 2023. However it is still very new so we recomend installing Ubuntu 16.04 LTS which will be supported until April 2021.


## Installation

It is highly recomended to install Ubuntu directly on your laptop or as a dual boot operating system alongside your exisiting OS. However we also provide some guidance on installing Ubuntu within a Virtual Enviornment on your laptop.

### Dual Boot

* First you need to download a .iso image file which contains the version of Ubuntu you want. Here is [16.04 LTS](http://releases.ubuntu.com/16.04/) make sure to download the desktop image.
* Next, you need a free USB drive with at least 2GB of space. The drive will be completely written over.
* You need some software to write the .iso to the USB. If on Windows you can use [Rufus](https://rufus.ie/)
* Create the bootable USB drive, disconnect the USB then reconnect to your computer.
* Restart your computer
- If your computer simply boots into the existing operating system you need to change the boot order in your BIOS.
- Restart your computer again and press the button during startup which lets you into the BIOS. It may say on your computer what this button is but you may need to Google depending on your laptop model. For example Lenovo might be F1 or F2.
- Look for an option to change boot order and put priority on your USB drive.
* Your computer should now boot into Ubuntu installation and you can follow the instructions for dual boot.

### Virtual Machine

* First you need to download a .iso image file which contains the version of Ubuntu you want. Here is [16.04 LTS](http://releases.ubuntu.com/16.04/) make sure to download the desktop image.
* Download you desired Virtual Machine such as Virtual Box

## Tutorial

[The Alternative](https://thealternative.ch/index.php?view=linuxdays) is a student club at ETHZ which has several tutorials on using Linux.

## Terminal

Some pointers:

* Open a terminal with Ctrl + Alt + T
* `/` is the top level root directoy which contains your
* `~` refers to your home folder located in `/home/![username]`
@@ -1,4 +1,4 @@
# Secure Shell {#preliminaries-secure-shell status=draft}
# Secure Shell (SSH) {#preliminaries-secure-shell status=draft}

Assigned: OPEN

Expand Down
Expand Up @@ -46,17 +46,19 @@ If you plan on connecting with the Duckiebot over different networks (e.g. at ho

laptop $ dts init_sd_card --wifi duckietown:quackquack,myhomenetwork:myhomepassword,myuninetwork:myunipassword

If you want to add additional networks later and you have to edit the `/etc/wpa_supplicant/wpa_supplicant.conf` file in the `root` drive.

If you are using a 16GB SD card, also add the `--compress` option.

Make sure to set your country correctly with the `--country` option. (Ex. CA for Canada, CH for Switzerland)

If you want to add additional networks later and you have to edit the `/etc/wpa_supplicant/wpa_supplicant.conf` file in the `root` drive.

Note: \[For ETH Zurich students only\] To connect to the netoworks on campus use the `--ethz-username` and `--ethz-password` options. Keep in mind that the ETH network prevents hostname resolution so, in general, you won't be able to connect to yout Duckiebot despite it being connected to the internet.

After you run the `dts init_sd_card` command with your options follow the instructions that appear on screen:

- You will then have to enter your laptop's `sudo` password to run Etcher.

- Select the drive at `/dev/mmcblk0` by pressing <kbd>Enter</kbd>.
- Select the drive with the correct size (usually `/dev/mmcblk0`) by pressing <kbd>Enter</kbd>.

- When asked "Are you sure?" select <kbd>y</kbd>.

Expand Down Expand Up @@ -131,6 +133,7 @@ After this you will be prompted for your password every time you connect to your

## Rebooting the PI {#setup-duckiebot-reboot}

Warning: Do not test these commands now if you just booted up your duckiebot for the first time. It is likely not finished initializing and shutting down the duckiebot or disconnecting its internet access could interrupt the process and require you to re-flash the SD card.

To reboot:

Expand Down
Expand Up @@ -93,7 +93,7 @@ The following keys are supported:

Run the base image on the duckiebot:

duckiebot $ docker -H ![hostname].local run -it --net host --privileged --name base duckietown/rpi-duckiebot-base:master18 /bin/bash
laptop $ docker -H ![hostname].local run -it --net host --privileged --name base duckietown/rpi-duckiebot-base:master18 /bin/bash


Then when the container has started
Expand Down
Expand Up @@ -12,14 +12,10 @@ Requires: You have configured Docker communication as documented in [](#docker-s

## Check the camera hardware

It might be useful to do a quick camera hardware check.

See: The procedure is documented in [](#howto-mount-camera).
It might be useful to do a quick camera hardware check as documented in [](#howto-mount-camera).


## Viewing a Single Image


These commands assume that you have completed the steps in [](#docker-setup),
and in particular that you set `DOCKER_HOST` correctly and can use `docker ps` successfully.

Expand All @@ -34,14 +30,11 @@ Then point your browser to the address

and verify that it is the output from your camera.

If the image is all black, check that you have removed the lens cap.


Now stop the `picam` container:

laptop $ docker -H ![hostname].local stop picam


warning The `picam` container is just for this example to verify your camera works. You should leave this container stopped if you plan to use the camera in other containers.

## Viewing an Image Stream on Your Laptop

Expand Down
Expand Up @@ -174,9 +174,9 @@ Arrange the Duckiebot and checkerboard according to [](#fig:extrinsic_setup2). N

### Docker

If you ran
If you ran:

laptop $ dts calibrate ![hostname]
laptop $ dts calibrate ![hostname]

then the same terminal will immediately take you into the extrinsic calibration step. After the following Setup step, push <kbd>Enter</kbd>.

Expand Down
@@ -1,20 +1,22 @@
# Camera troubleshooting {#setup-troubleshooting-camera status=draft}

Assigned: Russell
Assigned: Russell Buchanan

## Cannot see image.jpg in web browser

### Go to your Portainer.io and make sure the picam container is running
### Resolution: make sure the picam container is running
You can run with:

laptop $ docker -H ![hostname].local run -d --name picam --device /dev/vchiq -v /data:/data duckietown/rpi-docker-python-picamera:master18

### Make sure dt18_01_health_stats_rpi-simple-server_1 container is running.
### Resolution: make sure dt18_01_health_stats_rpi-simple-server_1 container is running.
If it's not running something went wrong with your initialization. Try:

laptop $ docker -H ![hostname].local run -dit --privileged --name dt18_01_health_stats_rpi-simple-server_1 --net host --restart unless-stopped duckietown/rpi-simple-server:master18

### Remove the battery pack and check the camera cable for damage.
However you likely either shutdown or disconnected it from the internet during initialization. The only fix is to re-flash the SD card.

### Resolution: remove the battery pack and check the camera cable for damage.
Some people bent the cable too much breaking it.

## You see a black image like this:
Expand Down

0 comments on commit 592b000

Please sign in to comment.