Setting up QT

What you’ll need

  • A monitor
  • A mouse and keyboard
  • Wireless internet
  • An Amazon Web Services account
  • A Google account to get an app for the tablet

QT has two ports: one USB-C and one USB-A. You’ll need to use the USB-C port for display and figure out how to control a mouse and keyboard. I suggest a USB-C hub that has a display port that you can use (USB-C or HDMI, for example) and has USB-A ports for your mouse and keyboard. Alternatively, you can use a USB-A hub to connect your mouse and keyboard to QT.

Note

If you have trouble using your mouse or keyboard through a USB-C port, try flipping the USB-C input going into QT. In theory, USB-C should go both ways, but in practice, sometimes not.

Basics

Turning QT on and off

To turn on QT, just plug in power to QT and it will boot.

To turn off QT, there are two options:

  1. Press the button on the backside of QT, near its feet.
  2. Login to the head computer (see below) and do sudo shutdown.

If you do sudo shutdown on the body computer, you only turn off the body computer—the head computer is still on.

Note

If you unplug QT to restart QT, it may mess up the boot timing of the two computers. Probably one of them takes longer because it boots in recovery mode. This screws up how the head and body computer network. You will not be able to connect to the head computer from the body computer. If this occurs, simple restart QT by pushing the button on its backside.

Accessing QT’s body computer

When you connect a monitor to QT and turn QT on, you will start on QT’s body computer.

Accessing QT’s head computer

To setup the head, you must Secure-SHell into it (SSH) from QT’s body computer. To do this

  1. Turn on QT.

  2. Open a terminal.

  3. Type the following and hit return:

    ssh qtrobot@192.168.100.1
    

Body

Getting your Amazon Web Service credentials

For QT to speak, we use Amazon Polly, which requires an Amazon Web Services account. At our current usage, using Amazon Polly is free up to a certain level), but you will need a credit card to create an account.

  1. Create an Amazon Web Services account.
  2. Once you sign in, in the top right of the page, click your account name (mine says “Audrow”), then in the drop-down menu click “My Security Credentials,” then click “Create New Access Key.”
  3. Record your access key and keep it somewhere safe. You can do this by downloading this or just viewing it and copy-pasting it to somewhere for later reference.

Note

It is best practice to create separate accounts with less access than your root account and use those access keys, see Amazon’s security best practices.

Setting up our interaction in a Docker container

  1. Change your system timezone to be in your current timezone. To do this, you can click the time in the upper-right of the desktop on QT and then click ‘Time & Date settings…’

  2. Open a terminal and clone this repository onto QT’s body computer:

    git clone -b master https://github.com/robotpt/cordial-docker ~/cordial-docker
    
  3. Run a script to allow for updates:

    sudo bash ~/cordial-docker/scripts/nuc_setup.bash
    

Warning

If this step fails, try the following commands before rerunning:

sudo apt install --reinstall python3-six
sudo apt install --reinstall python3-chardet

Note

This step takes five minutes or so.

  1. Setup Docker:

    1. Install Docker:

      curl -fsSL https://get.docker.com -o get-docker.sh
      sh get-docker.sh
      
    2. Set Docker to run without sudo:

      sudo groupadd docker
      sudo gpasswd -a $USER docker
      newgrp docker
      
    3. Test that Docker is installed correctly and works without sudo:

      docker run hello-world
      
    _images/hello_from_docker.png

    What is printed from running the hello-world docker container.

  2. Setup Docker-compose:

    1. Install Docker-compose:

      sudo curl -L "https://github.com/docker/compose/releases/download/1.25.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
      sudo chmod +x /usr/local/bin/docker-compose
      
    2. Check that docker compose is installed correctly:

      docker-compose version
      
  3. Setup the docker container:

    bash ~/cordial-docker/docker/run.sh
    
    .. note::
    
        The first time that you run the Docker script, it will take around 15 minutes (depending on your internet) to setup the container.  After that, it will be fast.  Feel free to take a break or go get coffee :-)
    
    .. note::
    
        I did have an error occur during this command one of the times I was setting it up.  It might have been a network issue.  I ran it again and it succeeded.  If you have trouble here let me know.
    
  4. Configure your AWS credentials by typing aws configure in the terminal that pops up.

Setting up remote access to QT

Get Dataplicity login credentials from Audrow and sign on. Go to the devices tab and then click “+ Add New Device”. Copy or enter this command into a terminal on QT’s body PC and enter QT’s password ‘qtrobot’. After that runs, remote access should be setup. You can confirm this by clicking the added device and confirming that you can explore the file system (e.g., ls /home/qtrobot and you should see familiar directories such as cordial-docker).