Home
build details

Show: section status errors & todos local changes recent changes last change in-page changes feedback controls

Duckiebot Initialization

Modified 2018-09-28 by Andrea Censi

Breandan Considine, Liam Paull

previous task next (10 of 33) index
task

The following was marked as "special-par-assigned".

Breandan Considine, Liam Paull

File book/opmanual_duckiebot/atoms_17_operation_manual_duckiebot/1_0_20_duckiebot_initialization-db18.md.

File book/opmanual_duckiebot/atoms_17_operation_manual_duckiebot/1_0_20_duckiebot_initialization-db18.md
in repo duckietown/docs-opmanual_duckiebot branch master18 commit 9a5d09dc
last modified by Aleksandar Petrov on 2019-07-06 06:48:03

Created by function create_notes_from_elements in module mcdp_docs.task_markers.

This page is for the DB18 configuration used in classes in 2018. For last year’s instructions see here.

An SD card of size at least 16 GB.

A computer with a Ubuntu OS (for flashing the SD card), an internet connection, an SD card reader, and 16 GB of free space.

Duckietown Shell, Docker, etc, as configured in Unit B-1 - Laptop Setup.

Duckietown Token set up as in Unit B-2 - Duckietown account.

A correctly configured Duckiebot SD card in configuration DB18. After assembling the Duckiebot, this will allow you to start it, connect to the internet, and get going.

Burn the SD card

Modified 2018-10-17 by Aleksandar Petrov

this currently only works on Ubuntu. Mac is not supported.

Plug the SD card in the computer using the card reader.

Then initalize it by running the command:

laptop $ dts init_sd_card [options]

The important options are:

--hostname         default: duckiebot
--linux-username   default: duckie
--linux-password   default: quackquack
--wifi             default: duckietown:quackquack
--country          default: US

For a full list of the options, run

laptop $ dts init_sd_card --help

If you plan on connecting with the Duckiebot over different networks (e.g. at home and in class), you can list them like that (note there should be no space after the commas):

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

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.

(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 your 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 with the correct size (usually /dev/mmcblk0) by pressing Enter.

  • When asked “Are you sure?” select y.

When the SD card is completely written, you should arrive at Press any key to continue. Do so and the script will exit.

on Ubuntu 16, you need to remove and re-insert the SD card. On Ubuntu 18 this is not necessary.

If the procedure fails with errors about directories not mounted, be patient and do it again, this time leaving the SD card in.

On successful end of the procedure, you can eject (safe remove) the drives and remove the SD card from your laptop.

Booting the Duckiebot

Modified 3 days ago by Aleksandar Petrov

Now insert the SD card into the Raspberry PI and push the button on the battery to power things up.

Don’t charge the battery while you are doing the initialization (or in general when the Duckiebot is turned on). The external power supply might not be able to provide sufficient current and the Raspberry Pi will reboot. Should that happen during the initialization procedure, you will likely have to burn the SD card again.

You should immediately see the green light next to where the SD card was inserted start to blink with activity.

If not, stop, as there is a problem with the SD card initialization (or possibly the PI, but this is unlikely).

Allow the robot time to boot. On first boot it may take up to 15 mins or more since some things are being configured.

Do not power the robot off (by holding the battery button) while this is in process.

You know that your Pi has successfully booted when you are able to ping your robot with the command below or with some method in Unit B-6 - Networking, a.k.a. the hardest part:

laptop $ ping hostname.local

Note that you should be connected to the same network as the robot in order to do that. If you are using a virtual machine you should use Bridged connection (typically NAT is used by default).

You should see output similar to the following:​

PING hostname.local (X.X.X.X): 56 data bytes
64 bytes from X.X.X.X: icmp_seq=0 ttl=64 time=2.164 ms
64 bytes from X.X.X.X: icmp_seq=1 ttl=64 time=2.303 ms
...

SSH to the Duckiebot

Modified 2018-09-28 by Andrea Censi

Next, try to log in using SSH, using

laptop $ ssh hostname

This should succeed without password.

If it doesn’t work, check that ~/.ssh/config contains something like:

Host hostname
    User duckie
    Hostname hostname.local
    IdentityFile ~/.ssh/DT18_key_00

This configuration was added by the init_sd_card command.

Rebooting the PI

Modified 2018-10-17 by Russell Buchanan

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:

laptop $ ssh hostname sudo reboot

Turn off the PI

Modified 2018-09-28 by Andrea Censi

To turn off the Duckiebot, use:

laptop $ ssh hostname sudo poweroff

Then wait 30 seconds.

If you disconnect the power before shutting down properly using shutdown, the system might get corrupted.

Then disconnect the USB cable (from the large connector next to the battery).

If you disconnect frequently the cable at the Raspberry Pi’s end, you might damage the port.

Because of mathjax bug

No questions found. You can ask a question on the website.