Step 3: Set up your Environment

Before you can prototype with the development kit, you'll need to set up your environment to use the Arduino IDE and download the Alexa app in order to register your device.

Step 3.1: Confirm that you have the required hardware

  • A computer with a USB port – Used to connect the development kit boards to your computer.

  • 2.4-GHz wifi network – Used to register and connect the ACK module.

  • An additional micro-USB cable (optional) - Used to debug the Development Board and update the ACK module firmware over-the-wire.

Step 3.2: Get an Amazon Developer account

You need an Amazon Developer account to access the ACK Console Resources. If you already have an account, then you're all set.

Step 3.3: Install the Alexa app

You need the Alexa app on your mobile device to scan the barcode that comes with the USI Development Kit and register your development device with ACK managed services and connect to Alexa. After the setup is complete, you can use the Alexa app to control your development device.

Alexa App minimum version requirements

Platform Minimum Version
Android 2.2.314100.0
iOS 2.2.3153270.0

Check your Alexa app version

  1. In the Alexa app, open the menu and then navigate to > Settings > General > About.

  2. Verify that you have the correct minimum version of the Alexa app on your mobile device.

  3. If you don't have the required minimum version of the app, follow the instructions to download the Alexa app.

Step 3.4: Install Python 3

You need Python 3.6.0 or later to run the setup.py script that comes with the ACK Device SDK. The setup script is used to configure the Arduino IDE so that is can utilize ACK Device SDK source code.

Check to see if you have Python 3.6.0 or later installed; if you don't, then you'll need to install it.

To install Python for various operating systems

Select the tab that corresponds to your operating system.

Most macOS computers come with Python already installed, but you should check which version is installed. Open a terminal window and then run the following command to check what version of python is installed:

python -V

This command will report the version of Python:

Python 2.7.8

If you have a different version of Python (earlier or later) or if you do not get a response to the command at all, you can get it from the Python downloads page.

After installation, check the version number to confirm that it was successful:

python3 -V

You should see the the version of Python that you just installed:

Python 3.7.4

To find out if Python is installed on your machine, open a terminal window and run this command:

which python

If Python is installed, you will get back the installation location, which may or may not include the version number. If the location doesn't include a version number, then ask for it:

python -V

This command reports the version:

Python 2.8.4

If you do not have Python 3.6.0 or later installed, you can get it from the Python downloads page.

After installation, check the version number to confirm that it was successful:

python3 -V

You should see the the version of Python that you just installed:

Python 3.7.4

Python usually isn't included on Windows computers by default. However you can check if any version exists by using the command prompt. To get to the command prompt, open the Windows Start menu, and then enter “command” in the search bar. Select Command Prompt from the search results.

In the Command Prompt window, enter the following command and press Enter:

py

If Python is installed and in your path, then this command runs python.exe and shows you the version number:

Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

Otherwise, you see the following message:

'py' is not recognized as an internal or external command, operable program or batch file.

If you do not have Python 3.6.0 or later installed, you can get it from the Python downloads page.

After installation, check the version number to confirm that the installation is successful:

py

You should see the version of Python that you just installed:

Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

Step 3.5: Install and configure the Arduino IDE

This step may take as long as 15 minutes to complete.

To install and configure the Arduino Software (IDE)

  1. On the Arduino Software page, under Download the Arduino IDE, select the appropriate installer.

  2. Launch the Arduino IDE.

  3. Choose the Arduino Zero board and the Programming Port in the IDE:

    1. Open the Board manager by going to Tools > Board > Boards Manager.

    2. Find the Arduino SAMD Boards (32-bits ARM Cortex-M0+) package, version 1.6.18 or later, and install it.

    1. Verify that the USB cable is connected from the Arduino Programming Port to your machine.

    2. Select Tools > Arduino SAMD Boards (32-bits ARM Cortex-M0+) Boards > Arduino Zero (Programming Port).

    3. Select the Arduino Programming Port serial connection:

    In the Arduino IDE, select your serial port from the Tools > Port menu. On macOS it should be something like /dev/cu.usbmodem xxxxx (Arduino/Genuino Zero (Programming Port)).

    Tools > Port > /dev/cu.usbmodem 14302 (Arduino/Genuino Zero (Programming Port)).

    If you don't know the name of your serial port, open the Terminal application and run the following command:

      ls /dev/{tty,cu}.*
    

    In the Arduino IDE, select your serial port from the Tools > Port menu. On Linux it should be something like /dev/cu.usbmodem xxxxx (Arduino/Genuino Zero (Programming Port)).

    Tools > Port > /dev/cu.usbmodem (Arduino/Genuino Zero (Programming Port)).

    If you don't know the name of your serial port, open the Terminal application and run the following command:

      ls /dev/{tty,cu}.*
    

    In the Arduino IDE, select your serial port in from the Tools > Port menu. On Windows, it should be something like COM4 (Arduino/Genuino Zero (Programming Port)).

    If you have more than one USB COM device connected and you're not sure what port to select, navigate to the Windows desktop and right-click on My Computer, and then navigate to Properties > Hardware > Device Manager > Ports (COM & LPT). To find out what board is the Arduino Zero, you can disconnect your board and re-open the menu; the entry that disappears should be the Arduino Zero board.


Step 3.6: Run the setup script

Use the setup.py script that comes with the ACK Device SDK to make the ACK SDK source code and sample applications discoverable by the Arduino IDE.

  1. Download the ACK Device SDK v3.0 or later from the ACK Console Resources, if you haven't already.

  2. Unzip the file.

  3. Change directories into the unzipped folder, and use setup.py in user/platform/arduino to add the sample applications to the Arduino IDE example library.

    Change directories into the unzipped <ack-device-sdk>/user/platform/arduino directory. Replace /Users/username/Downloads with the path to your download location.

     cd /Users/<username>/<Downloads>/<ack-device-sdk>/user/platform/arduino
    

    Run the script:

     python3 ./setup.py
    

    You might see the following permission denied message:

     ./setup.py: Permission denied
    

    If so, you'll need to specify that it's an executable program:

     sudo chmod +x setup.py
    

    Now run your program:

     python3 ./setup.py
    

    To view the helper commands available for setup.py, include the following --help argument

    python3 ./setup.py --help

    On Linux, open a shell and then change directories into the unzipped user/platform/arduino directory. Replace $HOME/username/Downloads with the path to your download location.

     cd $HOME/<username>/<Downloads>/<ack-device-sdk>/user/platform/arduino
    

    Run the script:

     python3 ./setup.py
    

    You might see the following permission denied message:

     ./setup.py: Permission denied
    

    If so, you'll need to specify that it's an executable program:

     sudo chmod +x setup.py
    

    Now run your program:

     python3 ./setup.py
    

    To view the helper commands available for setup.py, include the following --help argument

    python3 ./setup.py --help

    Open the command prompt, and then change directories into unzipped ACK Device SDK folder > user\platform\arduino. Replace c:\downloads with the path to your download location.

     cd /d c:\downloads\<ack-device-sdk>\user\platform\arduino
    

    Run the script, using -3 as an argument to specify Python 3

     py -3 setup.py
    

    To view the helper commands available for setup.py, include the following --help argument

    py -3 user\platform\arduino\setup.py --help

  4. Restart the Arduino IDE application to pick up the ACK sample applications, shown as examples in the Arduino IDE. You should now see the custom examples available in the File > Examples > Examples from Custom Libraries menu.

Setup script troubleshooting

Q: When I run the setup.py script, I see an error message "Arduino documents directory 'C:\users\xxx\Arduino\documents' not found." Why?
This can happen if you have a non-standard installation of the Arduino IDE or, in some cases, other software on your computer that has altered environment variables for their own use, making setup.py unable to find the Arduino documents directory.

For this case, there's the --targetroot argument, which tells setup.py where the Arduino Documents directory is. You will need to specify the location of your Arduino documents folder as an argument to --targetroot, such as the following example:

setup.py --targetroot` <your_path\Arduino\documents>

You can confirm the location of your Arduino documents folder in the Arduino IDE by going to Settings > and viewing the Sketchbook location; the Sketchbook location is the Arduino Documents folder.