Edge Device Setup

Note: Deploying to your laptop running Linux? Skip this step and Get a realtime object detector running

Your edge device should meet the following minimum requirements:

  1. Linux-based OS installed: The OS must support Docker. We’ve tested the following with the edgeIQ Docker image:

    1. Raspbian Buster

    2. Raspbian Stretch

    3. Debian Buster

    4. Debian Stretch

  2. SSH access set up: SSH is required for the alwaysAI CLI to communicate with the device.

  3. Docker supported: Docker is required in order to run the edgeIQ Docker image.

  4. USB or ribbon camera capable (optional): A camera is required only for apps that will be using a realtime video feed from a connected camera.

If you have a Raspberry Pi and you don’t have one of the above OS images installed on it, head to the Raspberry Pi setup guide to get it ready to go.

Boards other than the Raspberry Pi will often come with a set of instructions to flash an OS on the board. Choose a Debian-based image (we recommend Buster but Stretch will also work).

Install Docker and Other Dependencies

This guide covers installing Docker and other edgeIQ dependencies on the following OS’s:

Raspbian Buster

  1. Connect to your device: At this point, SSH should already be enabled. If it isn’t, follow the Raspberry Pi setup guide to enable it. From your host machine, SSH to your device using the device credentials. If you left the Raspbian defaults, your username will be pi, your hostname will be raspberrypi, and the password will be raspberry.

     $ ssh <username>@<hostname>
    

    If the hostname is not found on your network, try the IP address.

  2. Enable the camera:

    1. If you’re using the Raspberry Pi ribbon camera, in a terminal run the sudo raspi-config command to bring up the configuration tool. In the “Interfaces” tab select the “Camera” line and choose to enable the camera. You can reboot now or wait until after the Docker install.

    2. If you’re using a USB webcam, you’ll need to add the USB webcam module. Open the /etc/modules file using nano:

       $ nano /etc/modules
      

    and add bcm2835-v4l2 to the end of the modules list.

  3. Install Docker: Run the following commands in the SSH connection to install Docker on your Raspberry Pi:

     $ curl -sL get.docker.com | sed 's/9)/10)/' | sh  
     $ sudo usermod -aG docker <username>  
     $ sudo reboot
    
  4. Once the Pi reboots, open a new SSH connection and test the Docker installation with the following command:

     $ docker run hello-world
    

Your Rasbian Buster device is now ready to go!

Debian Buster

On Debian installs, SSH and camera support is usually enabled out of the box. The remaining task is to install Docker. To install Docker, follow these steps:

  1. From your development machine, SSH to your device using the device credentials:

     $ ssh <username>@<hostname>
    
  2. Download the latest Docker packages from the Docker download page. Select your architecture from the list, then download containerd.io, docker-ce-cli, and docker-ce.

  3. Install each package in the following order:

     $ sudo apt-get install ./containerd.io_<version>  
     $ sudo apt-get install ./docker-ce-cli_<version>  
     $ sudo apt-get install ./docker-ce_<version>
    

    If Docker fails to start during the install, follow the steps outline in the Workaround for Docker Start Failure section.

  4. Give your user access to docker and reboot your device:

     $ sudo usermod -aG docker <username>  
     $ sudo reboot
    
  5. Once the device reboots, open a new SSH connection and test the Docker installation with the following command:

     $ docker run hello-world
    

Your Debian Buster device is now ready to go!

Workaround for Docker Start Failure

If you get an error when installing docker-ce, it may be caused by an update to how Buster manages IP tables. Run dockerd in the foreground to get the full error message:

    $ sudo dockerd

If your error message looks like this:

    failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables --wait -t nat -N DOCKER: iptables v1.8.2 (nf_tables):  CHAIN_ADD failed (No such file or directory): chain PREROUTING  
    (exit status 4)

Then you can work around the issue with the following steps:

    $ sudo update-alternatives --set iptables /usr/sbin/iptables-legacy  
    $ sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy  
    $ sudo service docker start