• Ready for review
  • 2. Initializing the Duckiedrone software

    Now that the atoms are taken care of, we can focus on the bits.

     

    What you will need:

    • A computer (a.k.a. “base station”) with an internet connection

    • Balena Etcher or similar program

    • A mini SD card (32GB, U3, Class 10), e.g., that from your Duckiebox

    What you will get:

    • An DD21 initialized and customized mini SD card

    Flashing the SD card

     

    1. Download the Duckiedrone DD21 system image (~2.1 GB): (v11) https://duckietown-public-storage.s3.amazonaws.com/brown/disk_image/dt-amelia-DD21-brown2022-sd-card-v11.zip

    2. Download a tool for flashing SD cards on your operating system, e.g.:

      1. Balena Etcher (for Windows, Linux, and macOS)

    3. Flash the DD21 system image on the SD card using the downloaded tool.
      In the case of Balena Etcher:

      1. Plug in the SD card to your computer. You might need an adapter depending on your available hardware. The Duckiedrone box has one SD card to USB-A adapter inside which can be used for this purpose.

      2. Open the Balena Etcher app

      3. Select “Flash from file”

      4. Choose the file downloaded from above (no need to unzip it first)

      5. Then “Select Drive” and choose your SD card

        1. Make sure you verify the drive is the correct one. It should be ~30GB in size

      6. Proceed with “Flash”

        1. Accept any system-level permissions requests that might pop-up

      7. The flashing process will take around 15 minutes.

        1. a successful flashing procedure will show “The Flashing is complete!” at the end.

    The next step is particularly important. Skipping it means having to re-flash the SD card.

    Customizing the Duckiedrone hostname and client network settings

    Changing the Duckiedrone hostname (also known as the “robot name") is needed to prevent conflicts when multiple Duckiedrones are operating in the same environment. If you intend to operate the drone in isolation from other Duckiedrones (e.g., at home), you can maintain the default settings.

    Carefully note:

    The hostname can only be changed at this stage in the process. It cannot be changed later.

    The hostname must start with a lower case letter and can contain only lower case letters (of the latin alphabet) and numbers

    • Using special charachters will brake things and require re-flashing

    • Examples:

      • argo

      • mydrone01

      • mydrone_01

      • My Drone

      • Argo

     

    1. To change your robot’s hostname navigate to the newly flashed SD card.

      1. You will have to unplug it from your base station first and plug it back in as Balena Etcher dismounts the drive after finishing the flashing process.

      2. If the flashing is successful, you will see that it has one partition called boot, with many files inside and overlays folder. Do not manually alter these files.

    2. There will be a second partition called config. Open this partition. You will find two files inside:

      1. hostname

      2. wpa_supplicant.conf

         

    3. Open the hostname file with any text editor program (e.g., Notepad on Windows) and replace the default robot name, amelia, with one of your choosing.

      1. Make sure to follow the guidelines in the info box above.

      2. A wrong hostname will mean having to reflash the SD card and start from step 1.

      3. Save the file before closing it.

    4. Open the wpa_supplicant.conf with a text editor of your choice and either edit the default connection settings or duplicate them to add a new network. These parameters will be used only when booting the Duckiedrone in client-network mode, as detailed in 3. First boot.

    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 country=US # NOTE: the following block is a template, use it to define connection to custom wifi networks network={ id_str="network_1" ssid="duckietown" psk="quackquack" key_mgmt=WPA-PSK }
    • country: change it if you are not in the US (e.g., CH for Switzerland, CA for Canada; full list of country codes)

    • id_str: an identifier for the network; change it if adding a new one;

    • SSID: name of the Wi-Fi you want the Duckiedrone to connect to;

    • psk: password for the above Wi-Fi;

    You can add as many Wi-Fi settings as you want, e.g., for home, school, office, etc., by copying and pasting the first block. Note that this file can be edited after the first boot too.

    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 country=US # NOTE: the following block is a template, use it to define connection to custom wifi networks network={ id_str="network_1" ssid="duckietown" psk="quackquack" key_mgmt=WPA-PSK } network={ id_str="network_2" ssid="example-second-network" psk="quackquack2" key_mgmt=WPA-PSK } network={ id_str="network_3" ssid="example-third-network" psk="quackquack3" key_mgmt=WPA-PSK }

    5. Eject your SD card safely; do not just unplug it from the base station.

     

    You are now ready for the first boot (https://ethidsc.atlassian.net/l/cp/EyDf1TLm).

    Troubleshooting

    Problem: I’m using a Mac and the Flashing step fails for lack of permissions.

    Solution: Go to your computer’s System Preferences > Security & Privacy > Files and Folders and enable access to “removable volumes”